资源描述:
《opencv图像的创建复制及保存》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1、工程例子来源自OpenCV中文网中的教程。2、运行环境为win32,VS2008.3、Opencv库已经安装,如我的安装目录如下:D:ProgramFilesOpenCV2.04、项目中包含头文件与库目录,并引用相应的库,具体如下:otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin193
2、9servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCounty
3、partyCommitteeSecretary,Ministersand1、命令行参数:otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAf
4、terthevictoryofthelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,Ministersand源代码://opencvhello.cpp:定义控制台应用程序的入口点。//#i
5、nclude"stdafx.h"#include"highgui.h"int_tmain(intargc,_TCHAR*argv[]){IplImage*pImg;//声明IplImage指针//载入图像,强制转化为Grayif(argc==3&&(pImg=cvLoadImage(argv[1],0))!=0){IplImage*pImg2=cvCreateImage(cvGetSize(pImg),pImg->depth,pImg->nChannels);cvCopy(pImg,pImg2,NULL);cvSaveI
6、mage(argv[2],pImg2);//把图像写入文件otherstaffoftheCentre.Duringthewar,ZhuwastransferredbacktoJiangxi,andDirectorofthenewOfficeinJingdezhen,JiangxiCommitteeSecretary.Startingin1939servedasrecorderoftheWestNorthOrganization,SecretaryoftheSpecialCommitteeAfterthevictoryof
7、thelongMarch,hehasbeentheNorthwestOfficeoftheFederationofStateenterprisesMinister,ShenmufuguSARmissions,DirectorofNingxiaCountypartyCommitteeSecretaryandrecorderoftheCountypartyCommitteeSecretary,MinistersandcvNamedWindow("Image",1);//创建窗口cvShowImage("Image",pImg
8、);//显示图像cvWaitKey(0);//等待按键cvDestroyWindow("Image");//销毁窗口cvReleaseImage(&pImg);//释放图像cvReleaseImage(&pImg2);//释放图像return0;}}otherstaffoftheCentre.Duringthewar