极坐标图的显示
最近在看 serge belongie 的shapecontext paper ,里面有一个极坐标图的显示
附带的有matlab的源码,这里用opencv 实现以下。继续啃paper ,有谁也在看一起交流下。
void drawPolarCircle(int nmaxR ,int nnumcircle)
{
IplImage * im_src = cvCreateImage(cvSize(nmaxR *2 + 30 , nmaxR *2 +30) , 8 ,3 );
cvZero(im_src);
float avg = log10f(nmaxR)/nnumcircle;
float r =avg;
CvPoint point = cvPoint(im_src->width/2 , im_src->height/2);
for (int i = 0 ; i < 5 ;++i)
{
cvDrawCircle(im_src ,point,pow(10,r) , CV_RGB(255,0,0),1);
printf("r=%f\n",pow(10,r));
r+=avg;
}
cvShowImage("s",im_src);
cvReleaseImage(&im_src);
}
int _tmain(int argc, _TCHAR* argv[])
{
drawPolarCircle(80,5);
cvWaitKey(-1);
return 0;
}
{
IplImage * im_src = cvCreateImage(cvSize(nmaxR *2 + 30 , nmaxR *2 +30) , 8 ,3 );
cvZero(im_src);
float avg = log10f(nmaxR)/nnumcircle;
float r =avg;
CvPoint point = cvPoint(im_src->width/2 , im_src->height/2);
for (int i = 0 ; i < 5 ;++i)
{
cvDrawCircle(im_src ,point,pow(10,r) , CV_RGB(255,0,0),1);
printf("r=%f\n",pow(10,r));
r+=avg;
}
cvShowImage("s",im_src);
cvReleaseImage(&im_src);
}
int _tmain(int argc, _TCHAR* argv[])
{
drawPolarCircle(80,5);
cvWaitKey(-1);
return 0;
}
作者: 小马_xiao
出处:http://www.cnblogs.com/xiaomaLV2/>
关于作者:专注halcon\opencv\机器视觉
本文版权归作者,未经作者同意必须保留此段声明,且在文章页面明显位置给出 原文链接