首页 > 代码库 > opencv缩小两次寻找边界

opencv缩小两次寻找边界

核心函数:cvPyrDown,cvCanny

wKiom1PsduuzuoI0AAbu0OBQznI009.jpg

程序:

#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <iostream>
#include "function.h"
int FindBorder_Canny(int argc,char** argv)
{
IplImage* src=http://www.mamicode.com/cvLoadImage("e:\\picture\\11.jpg",0);
cvNamedWindow("src");
cvShowImage("src",src);
IplImage* HalfSizeDst=HalfSize(src);
HalfSizeDst=HalfSize(HalfSizeDst);
IplImage* CannyDst=cvCreateImage(cvGetSize(HalfSizeDst),HalfSizeDst->depth,HalfSizeDst->nChannels);
cvCanny(HalfSizeDst,CannyDst,50,150,3);
cvNamedWindow("CannyDst");
cvShowImage("CannyDst",CannyDst);
cvWaitKey(0);
cvDestroyWindow("src");
cvDestroyWindow("CannyDst");
cvReleaseImage(&src);
cvReleaseImage(&CannyDst);
return 0;
}


本文出自 “flyclc” 博客,请务必保留此出处http://flyclc.blog.51cto.com/1385758/1540034