# Log-Polar Mapping(对数极坐标映射)

2010/04/09 21:05

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):

The mapping is described by:

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

h = atan(y/x)

OpenCV实现：

#include <cv.h>
#include <highgui.h>

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;
}

0
3 收藏

0 评论
3 收藏
0