Mask Method

NI Vision for Visual Basic

Mask Method

Syntax

CWIMAQVision.Mask SourceImage, MaskImage, DestImage

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Copies SourceImage into DestImage. If a pixel value is 0 (OFF) in MaskImage, the corresponding pixel in DestImage is set to 0.

Remarks

Use this method with all image types. The SourceImage and DestImage must be the same type. MaskImage must be a U8 image.

This method is optimized for MMX.

Parameters

SourceImage As CWIMAQImage

The source image.

MaskImage As CWIMAQImage

The binary image that contains the mask applied to the source image. All non-zero pixel values are on, and all pixel values of 0 are off.

DestImage As CWIMAQImage

The resulting image.

Example

Dim i As New CWIMAQImage
Dim maskImage As New CWIMAQImage

' Mask the image in Viewer1 and store the result in i
CWIMAQVision1.RegionsToMask maskImage, CWIMAQViewer1.Regions
CWIMAQVision1.Mask CWIMAQViewer1.Image, i, maskImage

Mask Example

See Also

RegionsToMask