For two-dimensional graphics, log-polar conversion represents a change from Cartesian coordinates to polar coordinates, which is widely used in computer vision. This function imitates the central concave visual acuity of human retina, and can be used for rapid scaling and constant rotation transformation template matching for target tracking.
This routine changes polar coordinates and reverses them.
Bytes ----------------------------------------------------------------------------------------------
Logpolar
Map the image to the polar index space
Void cvlogpolar (const cvarr * SRC, cvarr * DST,
Cvpoint2d32f center, double m,
Int flags = cv_inter_linear + cv_warp_fill_outliers );
SRC
Enter the image.
DST
Output image.
Center
The center of the transformation. The output image is the most accurate here.
M
For the Scale Parameters of the amplitude, see the following formula.
Flags
The combination of interpolation method and the following selection mark
· Cv_warp_fill_outliers-fill all pixels in the output image. If these vertices correspond to the outer vertices, set them to zero.
· Cv_warp_inverse_map-indicates the inverse transformation from the output image to the input image, and therefore can be directly used for pixel interpolation. Otherwise, the function looks for Inverse transformations from map_matrix.
Fillval
Fill in the value of the external point.
The function cvlogpolar transforms the input image using the following transform:
Positive transformation (cv_warp_inverse_map is not set ):
DST (PHI, rock) <-Src (x, y)
Reverse conversion (cv_warp_inverse_map ):
DST (x, y) <-Src (PHI, rock ),
Here,
ROV = m * log (SQRT (X2 + y2 ))
Phi = atan (y/X)
Bytes ----------------------------------------------------------------------------------------------
/* Code */
# Include
/* Result */
Still watery
Log-polar:
Inverse log-polar: