学习opencv第六章习题5 , 使用x,y阶层数求出图像内唯一直线的角度


#include 
#include 
#include 
#include 

using namespace std;
const CvSize size = cvSize(200,200);
const int aperture[] = {3,5,9,11,13,17};
int main()
{
	IplImage *src = cvCreateImage(size,8,1);
	cvZero(src);
	cvLine(src
		//,cvPoint(0,size.height - 1)
		//,cvPoint(size.width -1 , 0)
		,cvPoint(0,0)
		,cvPoint(size.width - 1, size.height - 1)
		,CV_RGB(255,255,255)
		,3
		);
	cvShowImage("src",src);
	
	IplImage *deriv_x = cvCreateImage(size,IPL_DEPTH_32F,1);
	IplImage *deriv_y = cvCreateImage(size,IPL_DEPTH_32F,1);
	IplImage *magnitude = cvCreateImage(size,IPL_DEPTH_32F,1);
	IplImage *angle = cvCreateImage(size,IPL_DEPTH_32F,1);
	IplImage *mask = cvCreateImage(size,IPL_DEPTH_8U,1);
	for(int i=0;i

你可能感兴趣的:(opencv)