【OpenCV学习】极坐标变换

#include "cv.h"
#include "highgui.h"
int main(int argc, char** argv)
{
    IplImage *src;
    if( argc == 2 && (src=/blog.armyourlife.info/cvLoadImage(argv[1],1)) != 0)
    {
        IplImage* dst = cvCreateImage( cvSize(256,256), 8, 3 );
        IplImage* src2 = cvCreateImage( cvGetSize(src), 8, 3 );
        cvLogPolar( src, dst, cvPoint2D32f(src->width/2,src->height/2),
            40, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS );
        cvLogPolar( dst, src2, cvPoint2D32f(src->width/2,src->height/2),
            40, CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS+CV_WARP_INVERSE_MAP );
        cvNamedWindow( "src", 1 );
        cvShowImage( "src", src );
        cvNamedWindow( "log-polar", 1 );
        cvShowImage( "log-polar", dst );
        cvNamedWindow( "inverse log-polar", 1 );
        cvShowImage( "inverse log-polar", src2 );
        cvWaitKey(0);
    }
}
//对比一下可以得出在进行一组正逆极坐标变换后图像会有失真
//极坐标函数可以模仿人类视网膜*凹视力,
//并且对于目标跟踪等可用于快速尺度和旋转变换不变模板匹配。 


本文转自gnuhpc博客园博客,原文链接:http://www.cnblogs.com/gnuhpc/archive/2012/10/13/2722882.html,如需转载请自行联系原作者
上一篇:Newell Teapot, Cup and Spoon


下一篇:【TDS学习笔记】Offline Backup/Restore the TDS