| Customize Help
| Save Settings

MimFlatField



Function Map
Synopsis
Applies a flat-field correction to remove artifacts from the specified source image.
Syntax
void MimFlatField(
MIL_ID FlatFieldContextImId, //in
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 ControlFlag //in
)
Description

This function applies a per-pixel gain and offset correction to the source image and writes the results in the destination image. This process removes artifacts from grabbed images, such as electrical bias, thermal agitation, and sensitivity variations.

The following equation defines the relationship between the source and destination pixel values.

Before using this function, you must configure the specified image processing context with the gain to apply, and the electrical bias, thermal agitation, and CCD sensitivity to remove, using MimControl(); otherwise, an error is reported. You can specify each of these on a per-pixel level using an image or on a global level using a constant.

Once the flat-field correction image processing context is configured, preprocess the context by calling MimFlatField() with M_PREPROCESS. If the preprocess operation is not done explicitly (using M_PREPROCESS), it will be done when MimFlatField() is first called. When preprocessing 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 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
FlatFieldContextImId

Specifies the identifier of a flat-field image processing context, previously allocated using MimAlloc() with M_FLAT_FIELD_CONTEXT.

SrcImageBufId

Specifies the identifier of the source image buffer. The buffer must be either an 8- or 16-bit unsigned image buffer.

When preprocessing a flat-field image processing context, set this parameter to the identifier of a typical source image buffer. Otherwise, to exclude the buffer from preprocessing, set this parameter to M_NULL.

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.

DstImageBufId

Specifies the identifier of the destination image buffer. The buffer must be either an 8- or 16-bit unsigned image buffer.

When preprocessing a flat-field image processing context, set this parameter to the identifier of a typical destination image buffer. Otherwise, to exclude the destination image buffer from preprocessing, set this parameter to M_NULL.

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.

ControlFlag

Specifies the operation to perform. This parameter must be set to one of the following values.

function map For specifying the operation to perform.
Click to summarizeValue Description
Click to summarize M_DEFAULT

Performs the flat-field correction operation.

Click to summarize 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 MimFlatField().

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.
FLAT FIELD CONTEXT UNSIGNED PROC NONE UNSIGNED PROC NONE DEFAULT PREPROCESS