| MIL 10 Reference
| Customize Help
| Save Settings

MimDeadPixelCorrection



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

Available on Windows
Available on Linux

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
Correct dead pixels in an image.
Syntax
void MimDeadPixelCorrection(
MIL_ID DeadPixelContextImId, //in
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 ControlFlag //in
)
Description

This function corrects dead pixels in the specified source image and places the resulting image in the destination image buffer. Dead pixels are replaced with an average of their non-dead pixel neighbors. Other pixels are copied from the source image buffer into the destination image buffer.

Before using this function, you must add the list of the coordinates of the dead pixels to the context, using MimPut() and two arrays (one for the X-coordinates and one for the Y-coordinates). Alternatively, you can add an image identifying the locations of the dead pixels to the context, using MimControl() with M_DEAD_PIXELS; this image acts as a dead pixel mask. In the dead pixel mask image, all non-zero pixels are considered dead pixels.

Specify the interpolation mode using MimControl() with M_INTERPOLATION_MODE. By default, the interpolation mode is M_AVERAGE.

The source and destination image buffers must be as large as (or larger than) the dead pixel mask, or equal to or larger than the largest specified coordinates of the dead pixels.

Once the dead pixel correction image processing context is configured, preprocess the context by calling MimDeadPixelCorrection() with M_PREPROCESS. If the preprocess operation was not done explicitly (using M_PREPROCESS), it will be done when MimDeadPixelCorrection() is first called. When preprocessed explicitly, the source and destination image buffers can be set to M_NULL. If, however, the source or destination image buffer is provided, it will be used in the preprocess operation, to better optimize future calls.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
DeadPixelContextImId

Specifies the identifier of the dead pixels image processing context. The context must have been allocated using MimAlloc() with M_DEAD_PIXEL_CONTEXT. In addition, the dead pixel image processing context must be already configured with the location of the dead pixels.

SrcImageBufId

Specifies the identifier of the source image buffer. The buffer must be a single-band image 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.

If performing a preprocess operation on the image processing context, set this parameter to the identifier of a typical source image buffer. Otherwise, to exclude this buffer from preprocessing, set this parameter to M_NULL.

DstImageBufId

Specifies the identifier of the destination image buffer. The buffer must be a single-band image 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.

If performing a preprocess operation on the image processing context, set this parameter to the identifier of a typical destination image buffer. Otherwise, to exclude this buffer from preprocessing, set this parameter to M_NULL.

ControlFlag

Specifies the control flag. This parameter must be set to one of the following:

function map For preprocessing the dead pixel image processing context
CollapseValue Description
Collapse M_DEFAULT

Corrects the dead pixels present in the source image.

Collapse M_PREPROCESS

Preprocesses the specified image processing context. Note that, if not called explicitly, this operation will be performed automatically upon the first call to MimDeadPixelCorrection().

If the identifier of the source and/or destination buffer is not set to M_NULL, information about the source and/or destination image buffer will be used in the preprocessing operation.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
DEAD PIXEL CONTEXT PROC NONE PROC NONE DEFAULT PREPROCESS