| Customize Help
| Save Settings

MimDeinterlace



Function Map
Synopsis
Produce a sequence of deinterlaced images from a sequence of images acquired from an interlaced camera.
Syntax
void MimDeinterlace(
MIL_ID DeinterlaceContextImId, //in
const MIL_ID *SrcImageArrayPtr, //in
const MIL_ID *DstImageArrayPtr, //in
MIL_INT SrcImageCount, //in
MIL_INT DstImageCount, //in
MIL_INT64 ControlFlag //in
)
Description

This function produces a sequence of deinterlaced images from a sequence of images grabbed from an interlaced camera. When an image is acquired using an interlaced camera, the even and odd fields are not taken at the exact same moment in time. If the object in the image was in motion, there is an offset between the position of the object in one field and its position in the other. Simply combining these two fields to produce a deinterlaced image results in noticeable deformities in moving objects, called interlacing artifacts. MimDeinterlace() uses averaging techniques to reduce or remove these interlacing artifacts and produce a higher quality deinterlaced image. To perform the deinterlacing operation, you can select one of several deinterlacing algorithms using MimControl() with M_DEINTERLACE_TYPE. They can be applied to the entire image or only to the pixels that are considered part of a moving object. To apply the algorithm to the latter, select the adaptive version of the algorithm (for example, M_ADAPTIVE_DISCARD).

Often, the order in which the fields are grabbed will depend on the camera being used. When using an algorithm that produces two output frames (for example, M_BOB or M_ADAPTIVE_BOB), it is important to set the field that is grabbed first using MimControl() with M_FIRST_FIELD. This will ensure that the sequence of output frames occur in chronological order and that the video stream is fluid.

The adaptive algorithms apply a motion detection algorithm to dynamically determine which pixels are part of an object in motion and which pixels are part of the background, prior to performing the deinterlacing algorithm. Using MimControl(), you can set the number of neighboring frames used for motion detection (M_MOTION_DETECT_NUM_FRAMES), the location of the frame to be processed within this group of frames (M_MOTION_DETECT_REFERENCE_FRAME), and the threshold value used to differentiate between pixels of objects in motion and pixels of background objects (M_MOTION_DETECT_THRESHOLD). To visualize which pixels are affected, you can have MimDeinterlace() output an image of these pixels, using MimControl() with M_MOTION_DETECT_OUTPUT; pixels that are part of an object in motion are set to the maximum value (0xFF for an a bit image), while the other pixels are set to 0. In this case, the deinterlacing part of the adaptive algorithm is not executed.

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
DeinterlaceContextImId

Specifies the identifier of the image processing context to be used for deinterlacing. The image processing context must have been previously allocated on the system using MimAlloc().

SrcImageArrayPtr
Accepts the address of one of the following:
  • array of type MIL_ID [optionally, in C++: a reference to a constant std::vector<MIL_ID> ] (and a maximum array rank for C# of 1)
    Required array size:(SrcImageCount)

Specifies an array containing the identifiers of the buffers of the images to deinterlace. Only 8-bit and 16-bit buffers are supported. All source images must be of the same type, same format, and on the same system. Note that all source and destination images must have the same size.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

DstImageArrayPtr
Accepts the address of one of the following:
  • array of type MIL_ID [optionally, in C++: a reference to a constant std::vector<MIL_ID> ] (and a maximum array rank for C# of 1)
    Required array size:(DstImageCount)

Specifies an array containing the identifiers of the buffers of the images in which to save the deinterlaced images. Only 8-bit and 16-bit buffers are supported. All destination images must be of the same type, same format, and on the same system. Note that all source and destination images must have the same size.

These images must not have a region of interest (ROI) associated with them. Using images with an ROI will cause an error.

SrcImageCount

Specifies the number of images in the source sequence.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the SrcImageArrayPtr parameter.

DstImageCount

Specifies the number of deinterlaced images in the destination sequence.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the DstImageArrayPtr parameter.

ControlFlag

Reserved for future use. Should be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
DEINTERLACE CONTEXT PROC NONE PROC NONE