TianLiImageProcessDemo

所属分类:图形图像处理
开发工具:Visual C++
文件大小:655KB
下载次数:15
上传日期:2008-05-12 16:15:02
上 传 者gongzishuye
说明:  一个完整的图像处理界面程序,包括付利叶变换,直方图变换,直方图均衡等常用的图像处理方法,便于初学者参考。
(A complete image processing interface procedures, including profits Fourier transform, histogram transform, histogram equalization and other commonly used image processing methods, to facilitate reference for beginners.)

文件列表:
imgprocess\ChildFrm.cpp (1394, 2005-06-08)
imgprocess\ChildFrm.h (1256, 2005-06-08)
imgprocess\ConvDlg.cpp (1832, 2005-06-08)
imgprocess\ConvDlg.h (1504, 2005-06-08)
imgprocess\CqOctree.cpp (14471, 2005-06-08)
imgprocess\D0101.BMP (66614, 2005-06-08)
imgprocess\D0103.BMP (66614, 2005-06-08)
imgprocess\D0105.BMP (66614, 2005-06-08)
imgprocess\D0107.BMP (66614, 2005-06-08)
imgprocess\D0401.BMP (66614, 2005-06-08)
imgprocess\dftfft.cpp (19103, 2005-06-08)
imgprocess\Dib.cpp (56231, 2005-06-08)
imgprocess\Dib.h (5883, 2005-06-08)
imgprocess\DIBAPI.CPP (175984, 2005-06-08)
imgprocess\dibapi.h (6947, 2005-06-08)
imgprocess\ExpMFrm.cpp (2574, 2005-06-08)
imgprocess\ExpPView.cpp (8944, 2005-06-08)
imgprocess\GrayAdj.cpp (13569, 2005-06-08)
imgprocess\GrayAdj.h (2417, 2005-06-08)
imgprocess\HistView.cpp (3775, 2005-06-08)
imgprocess\HistView.h (1793, 2005-06-08)
imgprocess\ImgPDlg.cpp (10288, 2005-06-08)
imgprocess\ImgPDlg.h (4475, 2005-06-08)
imgprocess\ImgPDoc.cpp (4350, 2005-06-08)
imgprocess\ImgPDoc.h (1554, 2005-06-08)
imgprocess\ImgProc.aps (68688, 2007-01-03)
imgprocess\ImgProc.clw (12902, 2007-01-03)
imgprocess\ImgProc.cpp (4735, 2005-06-08)
imgprocess\ImgProc.dsp (6000, 2005-06-08)
imgprocess\ImgProc.dsw (544, 2005-06-08)
imgprocess\ImgProc.h (1549, 2005-06-08)
imgprocess\ImgProc.ncb (410624, 2007-01-03)
imgprocess\ImgProc.rc (31829, 2007-01-03)
imgprocess\ImgProc.plg (1221, 2007-01-03)
imgprocess\ImgPView.cpp (15366, 2005-06-08)
imgprocess\ImgPView.h (6203, 2005-06-08)
imgprocess\IP.cpp (18660, 2005-06-08)
imgprocess\LsnMFrm.cpp (18349, 2005-06-08)
imgprocess\LsnPView.cpp (479, 2005-06-08)
imgprocess\MainFrm.cpp (14888, 2005-06-08)
... ...

************************************************************ Digital Image Proecssing CAI Program HISTORY recording HuPingping Begin Date: 2002.6.20-10.4 ************************************************************ *********************************** Revised 1: (revised from ImageProcess.dsw of VC-ip.zip) File: imgp.arj LastDate: 2002/06/20-2002/7/5 Feature: 1. Change all the file name from long format to 8.3 format 2. Add new DOC/View generation process as following: (1) Change the variable pDocTemplate from local of ImgProc.CPP's InitInstance() to public global variable pDocTemplate of CImageProcessApp so that it can be used to create new doc in image processing. (2) The step to create a new DOC and its associate View from View or MainFrame A. Create a new DOC pNewDoc: CImageProcessDoc* pNewDoc = (CImageProcessDoc*)CntApp->pDocTemplate->CreateNewDocument(); B. Create a new frame that contains the new DOC and the associate View: CMDIChildWnd* pNewFrame = (CMDIChildWnd*)(CntApp->pDocTemplate->CreateNewFrame(pNewDoc, NULL)); C. Initializing the Doc data and show the View : CntApp->pDocTemplate->InitialUpdateFrame(pNewFrame, pNewDoc); {...} // application specific initialization of DOC data pNewDoc->m_pDib->UpdateImage(); pNewDoc->UpdateAllViews(NULL); 3. Add A new kind of View class for Histogram drawing (1) Add a new MFC class CHistogramView derive from CScrollView (which will add two new files we name them to HistView.h and HistView.Cpp) (2) Add codes in OnInitialUpdate() of HistView.Cpp for finding the histogram (3) Add codes in OnDraw() of HistView.Cpp for drawing the histogram (4) add codes in OnFindHistogram() of ImgPView.Cpp for create the New Histogram View of current DOC. A problem with release version compiling arise and solved. (For detail,see Problem&Solving 5) 4. Add the following member function in CImageProcessView:(ImgPProc.CPP) (1) Create a new DOC/VIEW to display a given BMP file void CImageProcessView::CreateNewFileImage(LPCSTR lpszDibFile) (2) Create a new DOC/VIEW to display the current DOC BMP file void CImageProcessView::CopyToNewImage() (3) Do GrayConvert to current image with given ConvertCurve and call the GrayAdj int CImageProcessView::GrayConvert(BYTE *Lut, long *Histogram, int Band, BYTE *ExtLut, int ExtDrawFlag) 5. Add the following member function in CDib:(CDib.CPP) (1) Call the private function UpdateInternal() to updatethe image display BOOL UpdateImage(); (2) Find the Histogram of current DIB int FindHistogram(long *Histogram); (3) Convert the DIB with given GrayConvertCurve BOOL GrayConvert(BYTE *ConvLut); (4) Find the Convertion LUT of Histogram Specific with SML methode void FindHistSpecLutBySML(long *Hist, long *HistS, BYTE *Lut); (5) Find the Convertion LUT of Histogram Specific with GML methode void FindHistSpecLutByGML(long *Hist, long *HistS, BYTE *Lut); Problem&Solving: 1. In the realization of copy current Doc/View image to a new one, I add a new member fuction of BOOL CDib::Create(HDIB m_hDibSrc). At first, the input parameter's name is "m_hDib", the creation is always failed. after two hours debuging and tracing, it is found that the name "m_hDib" is the same with CDIB class's member variable, so the source CDIB data can not be transported into this fuction. A badly faulty!!! 2. How to avoid the new DocView to be opened on startup of Programe? If we remove the line AddDocTemplate(pDocTemplate); in ???App.CPP, the new DocView will not apeare at the startup of program bu at the same time all the DOC operation will be failed(NewDoc or OpenDoc). How to do ??? An alternative way to do this is : (1) define a BOOL variable IsFirstDoc in App class and init it to TRUE at the construction of APP. (2) In OnNewDocument if DOC class, return FALSE and set the App's IsFirstDoc to FALSE if App's IsFirstDoc is TRUE. 3. A problem about the MoveWindow's rect parameters with the GetWindowRect's Rect For detail,see notes in CImageProcessView::FindHistogram and CImageProcessView::FindPos as well as in CMainFrame::CreateNewFileImage 4. The black screen problem and solving: VC++6.0 Studio 在编译时黑屏的原因是“控制面板/控制台”属性中的显示选项被设成了 “全屏”。 5. The Release version failure of New added HistViewblack. The HistView.H file contains following codes:(Auto generated by MFC add new class) #ifndef _DEBUG // debug version in ImgPView.cpp inline CImageProcessDoc* CImageProcessView::GetDocument() { return (CImageProcessDoc*)m_pDocument; } #endif This will cause the compile failure when compile it in ReleaseVersion,Replace the CImageProcessView with CHitogramView will solve this problem. 6. How to position the new created ViewWindow to given position of current ViewWindow (all these code are digested from void CImageProcessView::FindHistogram(...)) (1) use following codes to get the posiotion of new ViewWindow pNewFrame->GetWindowRect(&rc); int Width = rc.Width(); int Height = rc.Height(); (2) use following codes to get the posiotion of current ViewWindow CMDIChildWnd* pParentFrame = (CMDIChildWnd*)GetParentFrame(); CRect prc; // for a actual view that set by MoveWindow with rc(0,293,0,268) pParentFrame->GetWindowRect(&prc); // Get Rect of ChildFrame in Screen(return rc(73,366,2,270)) CntApp->m_pMainWnd->ScreenToClient(prc); // (return rc(26,319,2,270)) with Tools on,(return rc(2,295,2,270)) with Tools off // Problem: the RC's top and bottom will always more than the actual value(by 2 or 24+2) // the RC's left and right will always more than the actual value(by 2) int Adjust = CntApp->pTlBar->IsWindowVisible() ? 26 : 2; // The pTlBar is the ToolBar's pointer save in OnCreate of MainFrame window prc.top -= Adjust; prc.bottom -= Adjust; prc.left -= 2; prc.right -=2; // adjust to ractual coordinates // to adjust the position of NewViewWindow switch( PosCode ) { case HISTVIEW_BELOW_POS: rc.top = prc.bottom; rc.left = prc.left; break; case HISTVIEW_RIGHT_POS: rc.top = prc.top; rc.left = prc.right; break; case HISTVIEW_LEFT_POS: rc.top = prc.top; rc.left = prc.left-Width; break; case HISTVIEW_UP_POS: rc.top = prc.top - Height; rc.left = prc.left; break; } rc.right = rc.left+Width; rc.bottom = rc.top+Height; // reposition the NewViewWindow pNewFrame->MoveWindow(rc); pDoc->UpdateAllViews(NULL);

近期下载者

相关文件


收藏者