| MIL 10 Reference
| Customize Help
| Save Settings

MimTransform



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

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 Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
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 Fast Fourier transform (FFT), a Discrete Cosine transform (DCT), or a polar-cartesian coordinates transformation.
Syntax
void MimTransform(
MIL_ID SrcImageRBufId, //in
MIL_ID SrcImageIBufId, //in
MIL_ID DstImageRBufId, //in
MIL_ID DstImageIBufId, //in
MIL_INT64 TransformType, //in
MIL_INT64 ControlFlag //in
)
Description

This function performs a forward or reverse FFT or DCT transformation on an image. It also perfoms a cartesian-to-polar or polar-to-catesian point-to-point coordinates transformation.

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
SrcImageRBufId

Specifies the identifier of the source buffer for the real component of the image.

[Matrox GPU processing driver]

The source image buffer for the real component must be unsigned monochrome 8- or 16-bit, or floating-point.

See the Parameter associations section for possible values that can be specified.

SrcImageIBufId

Specifies the identifier of the source buffer for the imaginary component of the image.

[Matrox GPU processing driver]

The source image buffer for the imaginary component must be unsigned monochrome 8- or 16-bit, or floating-point.

See the Parameter associations section for possible values that can be specified.

DstImageRBufId

Specifies the identifier of the destination buffer for the real component of the image.

This parameter can be set to M_NULL. See the parameter association table for more details.

[Matrox GPU processing driver]

The destination image buffer for the real component must be unsigned monochrome 8- or 16-bit, or floating-point.

See the Parameter associations section for possible values that can be specified.

DstImageIBufId

Specifies the identifier of the destination buffer for the imaginary component of the image.

This parameter can be set to M_NULL. See the parameter association table for more details.

[Matrox GPU processing driver]

The destination image buffer for the imaginary component must be unsigned monochrome 8- or 16-bit, or floating-point.

See the Parameter associations section for possible values that can be specified.

TransformType

Specifies the type of transform to perform on the image.

See the Parameter associations section for possible values that can be specified.

ControlFlag

Specifies if the transform is a forward transform or a reverse transform.

See the Parameter associations section for possible values that can be specified.

The table below lists possible values for the SrcImageRBufId, SrcImageIBufId, DstImageRBufId, DstImageIBufId, TransformType, and ControlFlag parameters.

function map For selecting the transformation type.
CollapseTransformType Description
MIL system-specific
tooltip (†)
ControlFlag
SrcImageRBufId
SrcImageIBufId
DstImageRBufId
DstImageIBufId
Collapse M_DCT8X8

Performs a discrete cosine transform on each 8x8 pixel block in the image.

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

Performs a forward transform on the image.

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

Specifies the identifier of the source buffer for the real component of the image in the spatial domain.

The width and height of the source buffer must be a multiple of 8.

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

(summarize)
a b c e f g h i j k l m n o p q r s
Collapse 8-bit signed/unsigned image buffer ID

Performs calculations in fixed-point format and returns to the destinations in 23.9 fixed point format.

a b c e f g h i j k l m n o p q r s
Collapse 16-bit signed/unsigned image buffer ID

Performs calculations in fixed-point format and returns to the destinations in 25.7 fixed point format.

a b c e f g h i j k l m n o p q r s
Collapse 32-bit signed image buffer ID

Conserves the fixed point format between the destination buffer and the source buffer.

a b c e f g h i j k l m n o p q r s
Collapse Floating-point image buffer ID

Specifies that processing will be performed in floating-point arithmetic. The destination buffer should also be a floating-point buffer.

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

Specifies the identifier of the source buffer for the imaginary component of the image in the spatial domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for SrcImageRBufId.

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

Specifies the identifier of the destination buffer for the real component of the image in the frequency domain. If SrcImageRBufId is an integer buffer, this must be a 32-bit signed integer buffer. If SrcImageRBufId is a floating-point buffer, this must also be a floating-point buffer.

The width and height of the destination buffer should be a multiple of 8.

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

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

Specifies the identifier of the destination buffer for the imaginary component of the image in the frequency domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for DstImageRBufId.

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

Performs a reverse transform on the image.

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

Specifies the identifier of the source buffer for the real component of the image in the frequency domain. This must be a 32-bit integer buffer or a floating-point buffer.

The width and height of the source buffer must be a multiple of 8.

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

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

Specifies the identifier of the source buffer for the imaginary component of the image in the frequency domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for SrcImageRBufId.

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

Specifies the identifier of the destination buffer for the real component of the image in the spatial domain.

The width and height of the destination buffer should be a multiple of 8.

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

(summarize)
a b c e f g h i j k l m n o p q r s
Collapse 8-bit signed/unsigned image buffer ID

The format of the source buffer is assumed to be in 23.9 fixed point format.

a b c e f g h i j k l m n o p q r s
Collapse 16-bit signed/unsigned image buffer ID

The format of the source buffer is assumed to be in 25.7 fixed point format.

a b c e f g h i j k l m n o p q r s
Collapse 32-bit signed image buffer ID

The fixed point format of the destination buffer is the same as that of the source.

a b c e f g h i j k l m n o p q r s
Collapse Floating-point image buffer ID

If SrcImageRBufId is a floating-point buffer, this must also be a floating-point buffer and processing will be performed in floating-point arithmetic.

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

Specifies the identifier of the destination buffer for the imaginary component of the image in the spatial domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for DstImageRBufId.

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

Performs a Fast Fourier transform.

(summarize)
a b c d e f g h i j k l m n o p q r s
MIL system specific

The transformation is always done in floating-point.

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

Performs a forward transform on the image. For floating-point destination buffers, the processing will be performed in floating-point arithmetic.

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

Specifies the identifier of the source buffer for the real component of the image in the spatial domain.

The width and height of the source buffer must be a power of 2.

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

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse 8-bit signed/unsigned image buffer ID

Calculations are performed in fixed-point format and returned to the destinations in 23.9 fixed point format.

a b c d e f g h i j k l m n o p q r s
Collapse 16-bit signed/unsigned image buffer ID

Calculations are performed in fixed-point format and returned to the destinations in 25.7 fixed point format.

a b c d e f g h i j k l m n o p q r s
Collapse 32-bit signed image buffer ID

The fixed point format of the destination buffer will be the same as that of the source buffer.

a b c d e f g h i j k l m n o p q r s
Collapse Floating-point image buffer ID

The destination buffer should also be a floating-point buffer and processing will be performed in floating-point arithmetic.

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

Specifies the identifier of the source buffer for the imaginary component of the image in the spatial domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for SrcImageRBufId.

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

Specifies that a faster version of the forward transform will be performed.

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

Specifies the identifier of the source buffer.

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

Specifies the identifier of the destination buffer for the real component of the image in the frequency domain. If SrcImageRBufId is an integer buffer, this can be a 32-bit signed integer buffer or a floating-point buffer. If SrcImageRBufId is a floating-point buffer, this must be a floating-point buffer also.

The width and height of the destination buffer must be a power of 2.

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

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

Specifies the identifier of the destination buffer for the imaginary component of the image in the frequency domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for DstImageRBufId.

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

Performs a reverse transform on the image.

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

Specifies the identifier of the source buffer for the real component of the image in the frequency domain. This must be a 32-bit integer buffer or a floating-point buffer.

The source buffer must be a 32-bit signed integer or a floating-point buffer.

The width and height of the source buffer must be a power of 2.

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

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

Specifies the identifier of the source buffer for the imaginary component of the image in the frequency domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for SrcImageRBufId.

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

Specifies the identifier of the destination buffer for the real component of the image in the spatial domain.

The width and height of the destination buffer must be a power of 2.

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

(summarize)
a b c d e f g h i j k l m n o p q r s
Collapse 8-bit signed/unsigned image buffer ID

The format of the source buffer is assumed to be in 23.9 fixed point format.

a b c d e f g h i j k l m n o p q r s
Collapse 16-bit signed/unsigned image buffer ID

The format of the source buffer is assumed to be in 25.7 fixed point format.

a b c d e f g h i j k l m n o p q r s
Collapse 32-bit signed image buffer ID

The fixed point format of the destination buffer is the same as that of the source.

a b c d e f g h i j k l m n o p q r s
Collapse Floating-point image buffer ID

If SrcImageRBufId is a floating-point buffer, this must also be a floating-point buffer and processing will be performed in floating-point arithmetic.

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

Specifies the identifier of the destination buffer for the imaginary component of the image in the spatial domain.

This buffer must be of the same type and pixel depth, and have the same dimensions and limitations as the buffer specified for DstImageRBufId.

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

Specifies that a faster version of the reverse transform will be performed.

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

Specifies the identifier of the destination buffer.

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

Performs a cartesian-to-polar or a polar-to-cartesian transform on the coordinates of the source buffer.

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

Converts the real and imaginary components of cartesian coordinates to the magnitude and phase components of polar coordinates.

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

Specifies the identifier of the source buffer for the real component of the cartesian coordinates. It must be a 32-bit floating-point buffer.

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

Specifies the identifier of the source buffer for the imaginary component of the cartesian coordinates. It must be provided.

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

Specifies the identifier of the destination buffer for the magnitude component of the polar coordinates.

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

Specifies that a faster version of the forward transform will be performed.

Only one of the destination buffers can be set to M_NULL

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

Specifies the identifier of the destination buffer. It must be a 32-bit floating-point buffer.

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

Specifies the identifier of the destination buffer for the phase component of the polar coordinates.

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

Specifies that a faster version of the forward transform will be performed.

Only one of the destination buffers can be set to M_NULL

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

Specifies the identifier of the destination buffer. The phase results are comprised in the range of 0-360.

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

Converts the magnitude and phase components of polar coordinates to the real and imaginary components of cartesian coordinates.

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

Specifies the identifier of the source buffer for the magnitude component of the polar coordinates. It must be a 32-bit floating-point buffer.

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

Specifies the identifier of the source buffer for the phase component of the polar coordaintes. It must be provided.

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

Specifies the identifier of the destination buffer for the real component of the cartesian coordinates. It must be a 32-bit floating-point buffers.

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

Specifies the identifier of the destination buffer for the imaginary component of the cartesian coordinates. The phase results are comprised in the range of 0-360.

(summarize)
a b c e f g h i j k l m n o p q r s
Combination constants for M_DEFAULT (when TransformType=M_DCT8X8); M_DEFAULT (when TransformType=M_FFT); M_FORWARD (when TransformType=M_DCT8X8); M_FORWARD (when TransformType=M_FFT); M_REVERSE (when TransformType=M_DCT8X8); M_REVERSE (when TransformType=M_FFT).

You can add one or more of the following values to the above-mentioned values to set the transform characteristics.

Note that only M_NORMALIZE is supported with both FFT and DCT. All other values are supported only with the FFT.

function map For the ControlFlag parameter
CollapseCombination value Description
Collapse M_1D_COLUMNS

Performs a 1-D transform on all columns of the image.

If M_1D_COLUMNS has been specified with the forward transform, then it must be specified for the reverse transform as well.

(summarize)
Collapse M_1D_ROWS

Performs a 1-D transform on all rows of the image.

If M_1D_ROWS has been specified with the forward transform, then it must be specified for the reverse transform as well.

(summarize)
Collapse M_CENTER

Centers the real part and the imaginary part of the spectrum. The center of the spectrum is put at the (SizeX/2-1, SizeY/2-1).

If M_CENTER has been specified with the forward transform, then it must be specified for the reverse transform as well.

(summarize)
Collapse M_MAGNITUDE +

Specifies whether to compute or use the magnitude.

When used with M_FORWARD, computes the magnitude of the forward FFT (the square root of R 2 +I 2 ). The magnitude is returned in the DstImageRBufId destination buffer, thereby overwriting the real component of the destination image.

When used with M_REVERSE, computes the real component of the transform from the magnitude and phase ( R = M cos(P) ). The result will be used to perform the reverse FFT.

For a reverse FFT, SrcImageRBufId and SrcImageIBufId must contain the magnitude and phase of a forward transform, respectively.

M_MAGNITUDE must be used with M_PHASE for a reverse FFT.

For a forward FFT, DstImageIBufId can be set to M_NULL if M_MAGNITUDE is used without M_PHASE.

M_MAGNITUDE can only be used in transforms processed with floating-point buffers.

(summarize)
Collapse M_NORMALIZE

Normalizes results (divide the final result by 8 for DCT and by (m x n) for FFT where m x n is the size of the image). M_NORMALIZE must be used with fixed-point arithmetic (all integer buffers) to avoid overflows.

If M_NORMALIZE has been specified with the forward transform, then it must be specified for the reverse transform as well.

(summarize)
Collapse M_PHASE

Specifies whether to compute or use the phase.

When used with M_FORWARD, computes the phase of the forward transform ( P = atan(I/R) ). The phase is returned in the DstImageIBufId buffer, thereby overwriting the imaginary component of the destination image. The phase is returned in the range of 0° to 360°.

When used with M_REVERSE, computes the imaginary component of the transform from the magnitude and phase ( I = M sin(P) ). The result will be used to perform the reverse FFT.

For a reverse FFT, SrcImageRBufId and SrcImageIBufId must contain the magnitude and phase of a forward transform, respectively.

M_PHASE must be used with M_MAGNITUDE for a reverse FFT.

For a forward FFT, DstImageRBufId can be set to M_NULL if M_PHASE is used without M_MAGNITUDE.

M_PHASE can only be used in transforms processed with floating-point buffers.

(summarize)
Collapse M_SATURATION

Clips (saturates) the results of a reverse FFT according to the destination buffer's data type.

M_SATURATION can only be used with a reverse FFT (M_FFT + M_REVERSE) operation which uses floating-point source buffers and integer destination buffers.

(summarize)
Combination constant for M_MAGNITUDE.

You can add the following value to the above-mentioned value to specify that the magnitude of the forward FFT is scaled logarithmically.

function map For M_MAGNITUDE
CollapseCombination value Description
MIL system-specific
tooltip (†)
Collapse M_LOG_SCALE

Scales logarithmically the magnitude of the forward FFT to be in the range of 0-255. This value is used to scale the spectrum into a displayable range.

M_LOG_SCALE can only be used in forward transforms processed with floating-point buffers.

(summarize)
a b c e f g h i j k l m n o p q r s
Combination constants for M_DEFAULT (when TransformType=M_POLAR); M_FORWARD (when TransformType=M_POLAR); M_REVERSE (when TransformType=M_POLAR).

You can add one of the following values to the above-mentioned values to specify the transform characteristics.

function map For specifying the transform characteristics
CollapseCombination value Description
MIL system-specific
tooltip (†)
Collapse M_FAST_PHASE

Performs faster phase computation.

For a forward polar transformation, it uses a faster computation of the phase results but slighly less accurate. For a reverse polar transformation, it has no effect.

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

Rescales the phase results.

For a forward polar transformation, it rescales the phase results to be in the range of 0.0-1.0. For a reverse polar transformation, SrcImageRBufId must contain the phase values in the range of 0.0-1.0.

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

Rescales the phase results.

For a forward polar conversion, it rescales the phase results to be in the range of 0-255. For a reverse polar transformation, SrcImageIBufId must contain the phase values in the range of 0-255.

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

Specifies that the magnitude values are returned or used squared.

For a forward polar transformation, it gives the square of the magnitude results (that is, R 2 +I 2 ). For a reverse transformation, SrcImageRBufId must contain the magnitude values squared.

(summarize)
a b c e f g h i j k l m n o p q r s
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC PROC PROC PROC DCT8X8 DEFAULT FORWARD FLOAT NONE FLOAT NONE SIGNED NONE FLOAT NONE PROC SIGNED PROC NONE FLOAT PROC NONE PROC REVERSE FLOAT PROC NONE FLOAT PROC NONE PROC FLOAT PROC NONE FLOAT PROC NONE SIGNED PROC NONE FLOAT PROC NONE PROC FFT DEFAULT FORWARD FLOAT PROC NONE FLOAT PROC NONE SIGNED PROC NONE FLOAT PROC NONE NULL PROC SIGNED PROC NONE FLOAT PROC NONE PROC REVERSE SIGNED PROC NONE FLOAT PROC NONE PROC FLOAT PROC NONE FLOAT PROC NONE SIGNED PROC NONE FLOAT PROC NONE NULL POLAR DEFAULT FORWARD FLOAT FLOAT NULL FLOAT NULL FLOAT REVERSE FLOAT FLOAT FLOAT FLOAT 1D COLUMNS 1D ROWS CENTER MAGNITUDE NORMALIZE PHASE SATURATION LOG SCALE FAST PHASE NORMALIZE PHASE NORMALIZE PHASE 255 SQUARE MAGNITUDE FFT