简易图像处理软件

时间:2015-05-15 13:53:23
【文件属性】:

文件名称:简易图像处理软件

文件大小:3.46MB

文件格式:RAR

更新时间:2015-05-15 13:53:23

图像处理,拉普拉斯,SOBEL,锐化,平滑,VC6

void CDIPDlg::OnOpen() { // TODO: Add your command handler code here CString fileName; CFileDialog OpenDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_EXPLORER,"图像文件格式(*.bmp)|*.bmp|JPG file format (*.jpg)|*.jpg|",NULL); if(OpenDlg.DoModal()!=IDOK) return; fileName=OpenDlg.GetPathName(); std::string tempName=(LPCSTR)CString(fileName); const char* tmp=tempName.c_str(); if((pImg=cvLoadImage(tmp,1))==0) return; wImg=cvCreateImage(cvGetSize(pImg),pImg->depth,pImg->nChannels); cvCopy(pImg,wImg,NULL); ShowImage( pImg,IDC_STATIC_P ); ShowOImage( pImg, IDC_STATIC_O ); } void CDIPDlg::OnSave() { // TODO: Add your command handler code here CFileDialog SaveDlg(FALSE,"bmp","未命名",OFN_HIDEREADONLY|OFN_EXPLORER,"图像文件格式(*bmp)|*.bmp|JPG file format (*jpg)|*.jpg|",NULL); if(SaveDlg.DoModal()==IDOK){ CString savefileName=SaveDlg.GetPathName(); std::string tempSaveName=(LPCSTR)CString(savefileName); const char* nameOfFile=tempSaveName.c_str(); if(wImg) cvSaveImage(nameOfFile,wImg); else cvSaveImage(nameOfFile,pImg); MessageBox("ok!"); } else MessageBox("no!"); } void CDIPDlg::OnEsc() { // TODO: Add your command handler code here CDialog::OnDestroy(); cvReleaseImage(&pImg;); cvReleaseImage(&wImg;); cvReleaseImage(&gImg;); cvDestroyAllWindows(); AfxGetMainWnd()->SendMessage(WM_CLOSE); } void CDIPDlg::OnGaos() { // TODO: Add your command handler code here wImg=cvCreateImage(cvGetSize(pImg),pImg->depth,pImg->nChannels); cvCopy(pImg,wImg,NULL); IplImage* in; in = wImg; IplImage* out = cvCreateImage(cvGetSize(in),IPL_DEPTH_8U,wImg->nChannels); // 建立辅助位图 cvSmooth(in,out,CV_GAUSSIAN,3,wImg->nChannels); // Gauss 平滑 // cvNamedWindow("高斯滤波",1); // cvShowImage("高斯滤波",out); ShowImage( out,IDC_STATIC_P ); wImg=cvCreateImage(cvGetSize(out),out->depth,out->nChannels); cvCopy(out,wImg,NULL); cvWaitKey(0); // cvDestroyWindow("高斯滤波"); cvReleaseImage(∈); cvReleaseImage(&out;); }


【文件预览】:
DIP
----DIP.h(1KB)
----DIP.dsw(531B)
----res()
--------DIP.rc2(395B)
--------DIP.ico(1KB)
----DIP.ncb(57KB)
----新建 文本文档.txt(11KB)
----DIP.opt(51KB)
----DIP.APS(44KB)
----DIP.clw(1KB)
----DIP.dsp(4KB)
----DIPDlg.h(2KB)
----StdAfx.cpp(205B)
----resource.h(2KB)
----DIPDlg.cpp(15KB)
----DIP.plg(1KB)
----StdAfx.h(1KB)
----DIP.rc(6KB)
----Debug()
--------StdAfx.obj(103KB)
--------DIP.obj(14KB)
--------DIP.pch(5.2MB)
--------DIP.res(9KB)
--------DIP.exe(2.05MB)
--------vc60.idb(265KB)
--------DIPDlg.obj(73KB)
--------DIP.ilk(2.43MB)
--------vc60.pdb(444KB)
--------DIP.pdb(3.95MB)
----ReadMe.txt(3KB)
----DIP.cpp(2KB)

网友评论

  • 很有用,但但仍需改进,谢谢上传