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=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;
}


你可能感兴趣的:(opencv,cvPyrDown,cvCanny)