本文共 563 字,大约阅读时间需要 1 分钟。
#include "cv.h"#include "cxcore.h"#include "highgui.h"int main(int argc, char **argv){IplImage *pImg =NULL;IplImage *pCannyImg =NULL;if((argc == 2)&&(pImg = cvLoadImage(argv[1],0))!=0){pCannyImg =cvCreateImage(cvGetSize(pImg),IPL_DEPTH_8U,1);//申请空间cvCanny(pImg,pCannyImg,50,150,3);//边缘检测cvNamedWindow("canny",1);cvShowImage("canny",pCannyImg);cvSaveImage("lenabianyuan.jpg",pCannyImg);cvWaitKey(0);cvReleaseImage(&pImg);cvReleaseImage(&pCannyImg);return 0;}return -1;}本文转自gnuhpc博客园博客,原文链接:http://www.cnblogs.com/gnuhpc/archive/2012/06/28/2568762.html,如需转载请自行联系原作者