Skip to main content

MimDeinterlace

BoardSupported
Host SystemYes
V4L2Yes
Clarity UHDYes
Concord PoENo
GenTLYes
GevIQYes
GigE VisionYes
IndioNo
Iris GTXYes
Radient eV-CLYes
Rapixo CLYes
Rapixo CoFYes
Rapixo CXPYes
USB3 VisionYes

Produce a sequence of deinterlaced images from a sequence of images acquired from an interlaced camera.

Syntax

void MimDeinterlace(
AIL_ID DeinterlaceContextImId, //in
const AIL_ID * SrcImageArrayPtr, //in
const AIL_ID * DstImageArrayPtr, //in
AIL_INT SrcImageCount, //in
AIL_INT DstImageCount, //in
AIL_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.

Parameters

DeinterlaceContextImId (in, AIL_ID)

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 *(in, AIL_ID)

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.

DstImageArrayPtr *(in, AIL_ID)

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.

SrcImageCount (in, AIL_INT)

Specifies the number of images in the source sequence.

DstImageCount (in, AIL_INT)

Specifies the number of deinterlaced images in the destination sequence.

ControlFlag (in, AIL_INT64)

Reserved for future use. Should be set to M_DEFAULT.

Copyright © 2026 Zebra Technologies.