| MIL 10 Reference
| Customize Help
| Save Settings

MimPolarTransform



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver
Partially supported on Matrox Radient eCL
Partially supported on Matrox Radient eV-CXP
Partially supported on Matrox Solios eA/XA
Partially supported on Matrox Solios ecl/xcl/ev-cl

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Perform a polar-to-rectangular or rectangular-to-polar transform.
Syntax
void MimPolarTransform(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //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
)
Description

This function performs a rectangular-to-polar or polar-to-rectangular transformation.

For a rectangular-to-polar transformation set the zone to convert by specifying the center coordinates (CenterPosX and CenterPosY), the start and end radius (StartRadius and EndRadius), and the start and end angle (StartAngle and EndAngle) as follows:

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 CenterPosX, CenterPosY, StartAngle, EndAngle, StartRadius, EndRadius parameters to specify where in the destination buffer the contents of the polar buffer will be mapped.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
SrcImageBufId

Specifies the identifier of the source buffer.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

[Matrox GPU processing driver]

The source image buffer must be unsigned monochrome 8- or 16-bit, M_BGR32 packed, or floating-point.

DstImageBufId

Specifies the identifier of the destination buffer. To determine the required size of the destination buffer, call the function with DstImageBufId 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 int values.

This image 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.

[Matrox GPU processing driver]

The destination image buffer must be unsigned monochrome 8- or 16-bit, M_BGR32 packed, or floating-point.

CenterPosX

Specifies the X-coordinate of the center in the rectangular image.

CenterPosY

Specifies the Y-coordinate of the center in the rectangular image.

StartRadius

Specifies the start radius of the zone of interest, in pixels.

EndRadius

Specifies the end radius of the zone of interest, in pixels.

StartAngle

Specifies the start of scan in the zone of interest. 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.

The valid range for StartAngle is between -360.0 to 720.0°. There is no maximum span limit between StartAngle and EndAngle.

EndAngle

Specifies the end of scan in the zone of interest. 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.

The valid range for EndAngle is between -360.0 to 720.0°. There is no maximum span limit between StartAngle and EndAngle.

OperationMode

Specifies the transform to perform. This parameter must be set to one of the values below.

function map For specifying the transform
CollapseValue Description
Collapse M_POLAR_TO_RECTANGULAR

Performs polar-to-rectangular transform.

Collapse M_RECTANGULAR_TO_POLAR

Performs rectangular-to-polar transform. This is the default.

(summarize)
InterpolationMode

Specifies the interpolation used in the conversion.

This parameter must be set to one of the values below.

function map For specifying the interpolation used in the conversion
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_DEFAULT

Default for interpolation mode and type. Same as M_NEAREST_NEIGHBOR + M_OVERSCAN_ENABLE.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse M_BICUBIC +

Performs bicubic interpolation. Saturation is performed according to the type of the destination buffer.

(summarize)
a b c e f g h i j k l m n o p q r s
Collapse M_BILINEAR +

Performs bilinear interpolation. No saturation is performed.

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse M_NEAREST_NEIGHBOR +

Performs nearest neighbor interpolation. No saturation is performed.

(summarize)
a b c d e f g h i j k l m n o p q r s
Combination constants for any of the possible values of the InterpolationMode parameter.

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.

function map For specifying how to determine the value of a destination pixel when its associated point falls outside the source buffer
CollapseCombination value Description
MIL system-specific
tooltip (†)
Collapse M_OVERSCAN_CLEAR

Sets the destination pixel to 0.

a b c d e f g h i j k l m n o p q r s
Collapse M_OVERSCAN_DISABLE

Leaves the destination pixel as is.

a b c d e f g h i j k l m n o p q r s
Collapse 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)
a b c d e f g h i j k l m n o p q r s
MIL system specific

Points falling outside the source image are undefined.

d j k l m p q r
Collapse 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)
a b c d e f g h i j k l m n o p q r s
DstSizeXPtr

Specifies the required width of the destination buffer. If this parameter is not set to M_NULL, the width will be returned.

DstSizeYPtr

Specifies the required height of the destination buffer. If this parameter is not set to M_NULL, the height will be returned.

Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE POLAR TO RECTANGULAR RECTANGULAR TO POLAR DEFAULT BICUBIC BILINEAR NEAREST NEIGHBOR OVERSCAN CLEAR OVERSCAN DISABLE OVERSCAN ENABLE OVERSCAN FAST