polar_trans_image_ext ( Image : PolarTransImage : Row, Column, AngleStart, AngleEnd, RadiusStart, RadiusEnd, Width, Height, Interpolation : )

Transform an annular arc in an image to polar coordinates.

polar_trans_image_ext transforms the annular arc specified by the center point (Row, Column), the radii RadiusStart and RadiusEnd and the angles AngleStart and AngleEnd in the image Image to its polar coordinate version in the image PolarTransImage of the dimensions Width x Height.

The upper left pixel in the output image always corresponds to the point in the input image that is specified by RadiusStart and AngleStart. Analogously, the lower right pixel in the output image always corresponds to the point in the input image that is specified by RadiusEnd and AngleEnd. In the usual mode (AngleStart < AngleEnd and RadiusStart < RadiusEnd), the polar transformation is performed in the mathematically positive orientation (counterclockwise). Furthermore, points with smaller radii lie in the upper part of the output image. By suitably exchanging the values of these parameters (e.g., AngleStart > AngleEnd or RadiusStart > RadiusEnd), any desired orientation of the output image can be achieved.

The parameter Interpolation is used to select the interpolation method 'bilinear' or 'nearest_neighbor'. With 'nearest_neighbor', the gray value of a pixel in the output image is determined by the gray value of the closest pixel in the input image. With 'bilinear', the gray value of a pixel in the output image is determined by bilinear interpolation of the gray values of the four closest pixels in the input image. The mode 'bilinear' results in images of better quality, but is slower than the mode 'nearest_neighbor'.

The angles can be chosen from all real numbers. Center point and radii can be real as well. However, if they are both integers and the difference of RadiusEnd and RadiusStart equals the height Height of the destination image, calculation will be sped up through an optimized routine.

The radii and angles are inclusive, which means that the first row of the target image contains the circle with radius RadiusStart and the last row contains the circle with radius RadiusEnd. For complete circles, where the difference between AngleStart and AngleEnd equals 2 * pi (360 degrees), this also means that the first column of the target image will be the same as the last.

To avoid this, do not make this difference 2 * pi, but 2 * pi * (1 - 1/Width) degrees instead.

The call:

polar_trans_image(Image, PolarTransImage, Row, Column, Width, Height)
produces the same result as the call:
polar_trans_image_ext(Image, PolarTransImage, Row-0.5, Column-0.5, 
                      6.2831853, 6.2831853/Width, 0, Height-1,
                      Width, Height, 'nearest_neighbor')

The offset of 0.5 is necessary since polar_trans_image does not do exact nearest neighbor interpolation and the radii and angles can be calculated using the information in the above paragraph and knowing that polar_trans_image does not handle its arguments inclusively. The start angle is bigger than the end angle to make polar_trans_image_ext go clockwise, just like polar_trans_image does.


Attention

For speed reasons, the domain of the input image is ignored. The output image always has a complete rectangle as its domain.


Parameters

Image (input_object)
(multichannel-)image(-array) -> object : byte / int2 / uint2
Input image.

PolarTransImage (output_object)
(multichannel-)image(-array) -> object : byte / int2 / uint2
Output image.

Row (input_control)
number -> real / integer
Row coordinate of the center of the arc.
Default value: 256
Suggested values: 0, 16, 32, 64, 128, 240, 256, 480, 512

Column (input_control)
number -> real / integer
Column coordinate of the center of the arc.
Default value: 256
Suggested values: 0, 16, 32, 64, 128, 256, 320, 512, 640

AngleStart (input_control)
number -> real
Angle of the ray to be mapped to the first column of the output image.
Default value: 0.0
Suggested values: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616

AngleEnd (input_control)
number -> real
Angle of the ray to be mapped to the last column of the output image.
Default value: 6.2831853
Suggested values: 0.0, 0.78539816, 1.57079632, 3.141592654, 6.2831853, 12.566370616

RadiusStart (input_control)
number -> real / integer
Radius of the circle to be mapped to the first row of the output image.
Default value: 0
Suggested values: 0, 16, 32, 64, 100, 128, 256, 512
Typical range of values: 0 <= RadiusStart

RadiusEnd (input_control)
number -> real / integer
Radius of the circle to be mapped to the last row of the output image.
Default value: 100
Suggested values: 0, 16, 32, 64, 100, 128, 256, 512
Typical range of values: 0 <= RadiusEnd

Width (input_control)
number -> integer
Width of the output image.
Default value: 512
Suggested values: 256, 320, 512, 640, 800, 1024
Typical range of values: 0 <= Width <= 32767

Height (input_control)
number -> integer
Height of the output image.
Default value: 512
Suggested values: 240, 256, 480, 512, 600, 1024
Typical range of values: 0 <= Height <= 32767

Interpolation (input_control)
string -> string
Interpolation method for the transformation.
Default value: 'nearest_neighbor'
List of values: 'nearest_neighbor', 'bilinear'


Parallelization Information

polar_trans_image_ext is reentrant and automatically parallelized (on tuple level, channel level).


See also

polar_trans_image, polar_trans_image_inv


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH