Rachel Zhang的专栏

因为理想,所以拼搏,关注计算机应用的点点滴滴……

Opencv实现Canny算子边缘检测

void CCVMFCView::OnCannyBorddetec()
{
	IplImage* src = 0;
	IplImage* dst = 0;
	IplImage* color_dst = 0;
	CvMemStorage* storage = cvCreateMemStorage(0);
	CvSeq* lines = 0;
	int i;

	if (workImg->nChannels==3) {
		src = cvCreateImage(cvGetSize(workImg), IPL_DEPTH_8U, 1);
		cvCvtColor(workImg, src, CV_BGR2GRAY);
	}
	else {
		src = cvCloneImage( workImg );
	}
	cvFlip(src);

	dst = cvCreateImage( cvGetSize(src), 8 ,1 );
	color_dst = cvCreateImage( cvGetSize(src), 8, 3 );

	cvCanny( src, dst, 50, 200, 3 );
	cvCvtColor( dst, color_dst, CV_GRAY2BGR );

	cvFlip(color_dst);
	m_dibFlag=imageClone(color_dst,&workImg);
	Invalidate();
}

阅读更多
文章标签: dst
个人分类: Computer Vision C/C++
上一篇opencv 金字塔图像分割
下一篇opencv 动态调节canny参数 边缘检测
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭