Chapter 6-image transformation-map an image to a polar index space (cvlogpolar)

Source: Internet
Author: User

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:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.