Selecting the Polar Image Area
The transformation to polar coordinates takes time and space to complete. You can minimize the amount of resources required by reducing the area of interest. The range should be as small as possible, but large enough to contain features of interest.
A polar sampling region is specified using the following parameters:
- An ellipse annulus section (ccEllipseAnnulusSection). This object describes an angular wedge, or section, of the annulus formed between two aligned ellipses with the same major/minor axis ratio.
- The number of X and Y samples. These parameters specify the size of the destination image and (equivalently) the number of divisions in the polar sampling grid. yNumSamples nominally specifies the height of the destination image and the number of samples in the radial grid direction. xNumSamples nominally specifies the width of the destination and the number of samples in the angular grid direction.
- An interpolation method selects how the image pixels are processed to generate the sample value at each sampling point. If you specify no interpolation, the sample value is the value of the single pixel whose center lies nearest to the sampling point. If you specify bilinear interpolation, the sample value is the bilinearly weighted average of the four pixels whose centers are nearest to the sampling point. See Sampling the Cartesian Source Image for a description of interpolation methods.
You specify these parameters using a ccPolarSamplingParams object in CVL.
The function cfPolarTransformImage() maps pixels in the (Cartesian) source image to pixels in the (polar) destination image. Each pixel in the destination image contains some number of whole and/or fractional pieces of the source image pixels. The source pixels are averaged together and normalized to form the corresponding output pixel for the destination image.