| MIL 10 Reference
| Customize Help
| Save Settings

MimResize



See also
Availability
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
Resize an image.
Syntax
void MimResize(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_DOUBLE ScaleFactorX, //in
MIL_DOUBLE ScaleFactorY, //in
MIL_INT64 InterpolationMode //in
)
Description

This function resizes the source image by the specified factors. Results are stored in the destination buffer starting from the top-left corner.

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 data source of the operation. This parameter must be given an image buffer identifier.

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, or M_BGR32 packed.

DstImageBufId

Specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier.

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, or M_BGR32 packed.

ScaleFactorX

Specifies the scaling factor for the width of the source image. This parameter can be set to one of the values below.

function map For specifying the scaling factor (width)
CollapseValue Description
Collapse M_FILL_DESTINATION

Resizes the source image to fill the entire width of the destination buffer. When set to M_FILL_DESTINATION, the source image is resized to fill the entire width of the destination buffer.

(summarize)
Collapse Value > 0.0

Uses a non-null positive value to multiply the width of the source image. A value greater than 1.0 enlarges the source image, while a factor less than 1.0 reduces it.

(summarize)
ScaleFactorY

Specifies the scaling factor for the height of the source image. This parameter can be set to one of the values below.

function map For specifying the scaling factor (height)
CollapseValue Description
Collapse M_FILL_DESTINATION

Resizes the source image to fill the entire height of the destination buffer. When set to M_FILL_DESTINATION, the source image is resized to fill the entire height of the destination buffer.

(summarize)
Collapse Value > 0.0

Uses a non-null positive value to multiply the height of the source image. A value greater than 1.0 enlarges the source image, while a factor less than 1.0 reduces it.

(summarize)
InterpolationMode

Specifies the mode of interpolation. This parameter can be set to one of the values below.

function map For specifying the mode of interpolation
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_DEFAULT

Same as M_NEAREST_NEIGHBOR + M_OVERSCAN_ENABLE + M_FAST.

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

Specifies averaging interpolation. No saturation is performed. The scaling factors for the width and height of the source image must be less than or equal to 1.

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

Specifies 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 +

Specifies 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_INTERPOLATE +

Specifies interpolated resizing: for zooming = bilinear, for dezooming = averaging. Gives the best speed/result compromise for interpolated resizing. No saturation is performed.

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

Specifies an interpolation based on the maximum pixel value in the specified source image. No saturation is performed. The scaling factors for the width and height of the source image must be less than or equal to 1.

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

Specifies an interpolation based on the minimum pixel value in the specified source image. No saturation is performed. The scaling factors for the width and height of the source image must be less than or equal to 1.

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

Specifies the 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 overscan
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
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 the speed and precision of the interpolation.

function map For the speed and precision
CollapseCombination value Description
Collapse M_FAST

Uses a fast interpolation. This is not as precise as a slow interpolation. The default setting is M_FAST.

(summarize)
Collapse M_REGULAR

Uses a slow interpolation. This is more precise than a fast interpolation.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE FILL DESTINATION FILL DESTINATION DEFAULT AVERAGE BICUBIC BILINEAR INTERPOLATE MAX MIN NEAREST NEIGHBOR OVERSCAN CLEAR OVERSCAN DISABLE OVERSCAN ENABLE OVERSCAN FAST FAST REGULAR