Table: | For specifying the ending angle |
Table: | For selecting the Operation Mode |
+ combination: | For generating LUTs |
MIL_ID SrcImageOrDstXLutBufId, | //in |
MIL_ID DstImageOrYLutBufId, | //in |
MIL_DOUBLE CenterPosX, | //in |
MIL_DOUBLE CenterPosY, | //in |
MIL_DOUBLE StartRadius, | //in |
MIL_DOUBLE EndRadius, | //in |
MIL_DOUBLE StartAngle, | //in |
MIL_DOUBLE EndAngle, | //in |
MIL_INT64 OperationMode, | //in |
MIL_INT64 InterpolationMode, | //in |
MIL_DOUBLE *DstSizeXPtr, | //out |
MIL_DOUBLE *DstSizeYPtr | //out |
This function performs a rectangular-to-polar or polar-to-rectangular transformation. Alternatively, this function can generate the X- and Y-coordinate LUTs required to perform the transformation using MimWarp().
For a rectangular-to-polar transformation, the zone of interest to convert is based on a circle centered at CenterPosX and CenterPosY, with the part to convert having the specified start and end radius (StartRadius and EndRadius) and specified start and end angle (StartAngle and EndAngle), measured with respect to the X-axis of the image.
The result will be mapped to the destination buffer as follows:
The increment in angle is determined by the length, in pixels, of the outside arc, calculated as follows:
(endangle - startangle) / arclength.
A polar-to-rectangular transform performs the reverse of the transform described above. It takes a polar buffer and maps it to a rectangular buffer. Use the CenterPosX, CenterPosY, StartAngle, EndAngle, StartRadius, EndRadius parameters to specify where in the destination buffer the contents of the polar buffer will be mapped.
To determine the required size of the destination image or LUT buffer, call the function with DstImageOrYLutBufId set to M_NULL; in this case, DstSizeXPtr and DstSizeYPtr will return the required X- and Y- size of the buffer, respectively. Note that DstSizeXPtr and DstSizeYPtr will return MIL_DOUBLE values; to allocate an appropriate buffer using these values, you should use a ceiling function, such as ceil(), to obtain the X- and Y- sizes as integer (MIL_INT) values.
Specifies the identifier of the source image buffer or the destination X-coordinate LUT buffer.
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of the destination image buffer or the Y-coordinate LUT buffer.
See the Parameter associations section for possible values that can be specified.
Specifies the start angle of the zone of interest. The scan starts at this angle.
For specifying the starting angle
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
-360.0 <= Value <= 720.0 |
Specifies the start angle. If the start angle (StartAngle) is less than the end angle (EndAngle), the direction of the scan will be counter clockwise. If the start angle is greater than the end angle, the direction of the scan will be clockwise. There is no maximum span limit between StartAngle and EndAngle. (summarize)Specifies the start angle. (more details...) |
Specifies the end angle of the zone of interest. The scan ends at this angle.
For specifying the ending angle
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
-360.0 <= Value <= 720.0 |
Specifies the end angle. If the end angle (EndAngle) is greater than the start angle (StartAngle), the direction of the scan will be counter clockwise. If the end angle is less than the start angle, the direction of the scan will be clockwise. There is no maximum span limit between StartAngle and EndAngle. (summarize)Specifies the end angle. (more details...) |
Specifies the transform to perform.
See the Parameter associations section for possible values that can be specified.
Specifies the interpolation mode and overscan used when transforming the source image. When generating the LUTs to perform the transformation, this parameter is ignored and should be set to M_DEFAULT.
This parameter must be set to one of the values below.
For specifying the interpolation mode used in the
conversion
|
|||||||||||||||||||||||||||||||||||||||
Value | Description |
MIL system-specific tooltip (‡) |
|||||||||||||||||||||||||||||||||||||
M_DEFAULT |
Specifies the default interpolation mode and overscan. When transforming the source image, the default is the same as M_NEAREST_NEIGHBOR + M_OVERSCAN_ENABLE. When only generating the LUTs to perform the transformation, this is the only possible value. (summarize)Specifies the default interpolation mode and overscan. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_BICUBIC + |
Specifies bicubic interpolation. The new value is determined by taking a weighted average of the 16 values (4x4) that surround the source point. Note that the sum of the weights used for bicubic interpolation might be greater than one. If this occurs and the result reflects an overflow or underflow, the result is saturated according to the depth and data type of the destination buffer. (summarize)Specifies bicubic interpolation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_BILINEAR + |
Specifies bilinear interpolation. The new value is determined by taking a weighted average of the 4 values (2x2) that surround the source point. (summarize)Specifies bilinear interpolation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_NEAREST_NEIGHBOR + |
Specifies nearest neighbor interpolation. The new value is that of the pixel closest to the source point. (summarize)Specifies nearest neighbor interpolation. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa |
You can add one of the following values to the above-mentioned values to specify how to determine the value of a destination pixel when its associated point falls outside the source buffer.
For specifying how to determine the value of a
destination pixel when its associated point falls outside the
source buffer
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description |
MIL system-specific tooltip (‡) |
|||||||||||||||||||||||||||||||||||||
M_OVERSCAN_CLEAR |
Sets the destination pixel to 0. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_OVERSCAN_DISABLE |
Leaves the destination pixel as is. |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
M_OVERSCAN_ENABLE |
Uses pixels from the source buffer's ancestor buffer. If the source buffer is not a child buffer or if the point falls outside the ancestor buffer, leave the destination pixel as is. This is the default value. (summarize)Uses pixels from the source buffer's ancestor buffer. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa | ||||||||||||||||||||
MIL system specific | |||||||||||||||||||||||||||||||||||||||
Points falling outside the source image are undefined. |
‡ | j | k M10 |
l | m | p | r U27 |
y U75 |
aa | ||||||||||||||||||||||||||||||
M_OVERSCAN_FAST |
Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. The overscan could be hardware-specific thereby having a different behavior than the other supported overscan modes. Note that when using M_OVERSCAN_FAST, the destination pixels in the overscan area are undefined. The pixels can therefore contain different values from one function call to the next, even if the function's parameter values are the same. (summarize)Specifies that MIL will automatically select the overscan that optimizes speed, according to the specified operation and the target system. (more details...) |
‡ | a | c M10 |
g | h | i | j | k M10 |
l | m | o | p | r U27 |
t U28 |
u U36 |
v | y U75 |
aa |
The table below lists possible values for the SrcImageOrDstXLutBufId, DstImageOrYLutBufId, and OperationMode parameters.
For selecting the Operation Mode
|
|||||||||||||||||||||||||||||||||||||||
OperationMode | Description | ||||||||||||||||||||||||||||||||||||||
SrcImageOrDstXLutBufId | |||||||||||||||||||||||||||||||||||||||
DstImageOrYLutBufId | |||||||||||||||||||||||||||||||||||||||
M_POLAR_TO_RECTANGULAR |
Performs a polar-to-rectangular transformation. (summarize)Performs a polar-to-rectangular transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcImageOrDstXLutBufId |
Specifies the identifier of the source image buffer containing the polar image. This buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error. (summarize)Specifies the identifier of the source image buffer containing the polar image. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstImageOrYLutBufId |
Specifies the identifier of the destination buffer in which to store the transformed rectangular image. Use the CenterPosX, CenterPosY, StartAngle, EndAngle, StartRadius, EndRadius parameters to specify the zone in which to write the rectangular version of the polar image. This buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error. Note that after performing the operation, the destination image will not be calibrated, even if the source image was calibrated. (summarize)Specifies the identifier of the destination buffer in which to store the transformed rectangular image. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_POLAR_TO_RECTANGULAR_LUT + |
Generates X- and Y-coordinate LUTs for use with MimWarp() to perform the specified polar-to-rectangular transformation. (summarize)Generates X- and Y-coordinate LUTs for use with MimWarp() to perform the specified polar-to-rectangular transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcImageOrDstXLutBufId |
Specifies the identifier of the destination buffer in which to store the X-coordinate LUT. This buffer must be a signed 16- or 32-bit buffer with an M_LUT attribute. (summarize)Specifies the identifier of the destination buffer in which to store the X-coordinate LUT. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstImageOrYLutBufId |
Specifies the identifier of the destination buffer in which to store the Y-coordinate LUT. This buffer must be a signed 16- or 32-bit buffer with an M_LUT attribute. (summarize)Specifies the identifier of the destination buffer in which to store the Y-coordinate LUT. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RECTANGULAR_TO_POLAR |
Performs a rectangular-to-polar transformation. (summarize)Performs a rectangular-to-polar transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcImageOrDstXLutBufId |
Specifies the identifier of the source image buffer containing the rectangular image. Use the CenterPosX, CenterPosY, StartAngle, EndAngle, StartRadius, EndRadius parameters to define the image's zone of interest to transform. This buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error. (summarize)Specifies the identifier of the source image buffer containing the rectangular image. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstImageOrYLutBufId |
Specifies the identifier of the destination image buffer in which to place the transformed zone of interest. This image is a polar image. This buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error. (summarize)Specifies the identifier of the destination image buffer in which to place the transformed zone of interest. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_RECTANGULAR_TO_POLAR_LUT + |
Generates X- and Y-coordinate LUTs for use with MimWarp() to perform the specified rectangular-to-polar transformation. (summarize)Generates X- and Y-coordinate LUTs for use with MimWarp() to perform the specified rectangular-to-polar transformation. (more details...) |
||||||||||||||||||||||||||||||||||||||
SrcImageOrDstXLutBufId |
Specifies the identifier of the destination buffer in which to store the X-coordinate LUT. This buffer must be a signed 16- or 32-bit buffer with an M_LUT attribute. (summarize)Specifies the identifier of the destination buffer in which to store the X-coordinate LUT. (more details...) |
||||||||||||||||||||||||||||||||||||||
DstImageOrYLutBufId |
Specifies the identifier of the destination buffer in which to store the Y-coordinate LUT. This buffer must be a signed 16- or 32-bit buffer with an M_LUT attribute. (summarize)Specifies the identifier of the destination buffer in which to store the Y-coordinate LUT. (more details...) |
You can add the following value to the above-mentioned values to specify the number of fractional bits in the coordinates of the source point.
For generating LUTs
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description | ||||||||||||||||||||||||||||||||||||||
M_FIXED_POINT + n |
Specifies the number of fractional bits for the source point ( x s , y s ). To do so, add the define M_FIXED_POINT + n to M_POLAR_TO_RECTANGULAR_LUT or M_RECTANGULAR_TO_POLAR_LUT where n >= 0. If nothing is added to M_POLAR_TO_RECTANGULAR_LUT or M_RECTANGULAR_TO_POLAR_LUT, it is assumed that there are no fractional bits in the coordinates of the source point. (summarize)Specifies the number of fractional bits for the source point ( x s , y s ). (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milim.lib. |
DLL | Requires mil.dll; milim.dll. |