对数极坐标图像几何学首先是从生物视觉系统的视网膜生理结构获得灵感的,具有数据压缩特性。在人工视觉系统中,与常见的笛卡尔坐标系中的图像对比,在没有减小视域大小和视网膜中心部分图像的分辨率的情况下,对数极坐标图像允许更加快速的采样率。

The log-polar image geometry was first motivated by its resemblance with the structure of the retina of some biological vision systems and by its data compression qualities. When compared to the usual cartesian images, the log-polar images allow faster sampling rates on artificial vision systems without reducing the size of the field of view and the resolution on the central part of the retina (fovea). In the last years, however, it has been noticed that the log-polar geometry also provides important algorithmic benefits. For instance in [AlexTRA99], it is shown that the use of log-polar images increases the size range of objects that can be tracked using a simple translation model. We expect that increasing the ``order" of the transformation towards the planar model, these advantages can still be observed.

The log-polar transformation is a conformal mapping from the points on the cartesian plane (x,y) to points in the log-polar plane (x,h):

5e4fb03985b733a75120d2e3ca8e678f.png

The mapping is described by:

x =  M * log(sqrt(x.^2 + y .^ 2))

h =atan(y/x)

OpenCV实现:

#include

#include

int main(int argc, char** argv)

{

IplImage* src;

//if( argc == 2 && (src=cvLoadImage(argv[1],1)) != 0 )

if(src = cvLoadImage(argc > 1? argv[1] : "fruits.jpg", 1))

{

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( "log-polar", 1 );

cvShowImage( "log-polar", dst );

cvNamedWindow( "inverse log-polar", 1 );

cvShowImage( "inverse log-polar", src2 );

cvWaitKey();

}

return 0;

}

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐