[][src]Function opencv::imgproc::warp_polar

pub fn warp_polar(
    src: &dyn ToInputArray,
    dst: &mut dyn ToOutputArray,
    dsize: Size,
    center: Point2f,
    max_radius: f64,
    flags: i32
) -> Result<()>

\brief Remaps an image to polar or semilog-polar coordinates space

@anchor polar_remaps_reference_image Polar remaps reference

Transform the source image using the following transformation: block formula

where block formula

and block formula

\par Linear vs semilog mapping

Polar mapping can be linear or semi-log. Add one of #WarpPolarMode to flags to specify the polar mapping mode.

Linear is the default mode.

The semilog mapping emulates the human "foveal" vision that permit very high acuity on the line of sight (central vision) in contrast to peripheral vision where acuity is minor.

\par Option on dsize:

  • if both values in dsize <=0 (default), the destination image will have (almost) same area of source bounding circle: block formula

  • if only dsize.height <= 0, the destination image area will be proportional to the bounding circle area but scaled by Kx * Kx: block formula

  • if both values in dsize > 0 , the destination image will have the given size therefore the area of the bounding circle will be scaled to dsize.

\par Reverse mapping

You can get reverse mapping adding #WARP_INVERSE_MAP to flags \snippet polar_transforms.cpp InverseMap

In addiction, to calculate the original coordinate from a polar mapped coordinate inline formula: \snippet polar_transforms.cpp InverseCoordinate

Parameters

  • src: Source image.
  • dst: Destination image. It will have same type as src.
  • dsize: The destination image size (see description for valid options).
  • center: The transformation center.
  • maxRadius: The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
  • flags: A combination of interpolation methods, #InterpolationFlags + #WarpPolarMode.
  • Add #WARP_POLAR_LINEAR to select linear polar mapping (default)
  • Add #WARP_POLAR_LOG to select semilog polar mapping
  • Add #WARP_INVERSE_MAP for reverse mapping.

Note:

  • The function can not operate in-place.
  • To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
  • This function uses #remap. Due to current implementation limitations the size of an input and output images should be less than 32767x32767.

See also

cv::remap