最近在看 serge belongie 的shapecontext paper ,里面有一个极坐标图的显示
附带的有matlab的源码,这里用opencv 实现以下。继续啃paper ,有谁也在看一起交流下。
![](https://images.cnblogs.com/cnblogs_com/xiaomaLV2/201207/201207091341129938.png)
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;
}