Compare Method

NI Vision for Visual Basic

Compare Method

Syntax

CWIMAQVision.Compare SourceImage, Operand, DestImage, Operator

Return Type

Long

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

Purpose

Performs comparison operations between two images or an image and a constant.

Remarks

Use this method with image types U8, I16, and SGL. All input images must have the same image type.

This method is optimized for MMX.

Parameters

SourceImage As CWIMAQImage

The first input image.

Operand As Variant

Either the second input image or a constant.

DestImage As CWIMAQImage

The resulting image. It can be one of the source images.

Operator As CWIMAQCompareOperators

The comparison operator to use. If you need to use cwimaqAverage, cwimaqMin or cwimaqMax, use CWIMAQVision.Average, CWIMAQVision.Min or CWIMAQVision.Max instead.

Example

Dim i As New CWIMAQImage

' Compare a constant to an image in Viewer1.
' Store the result in i
CWIMAQVision1.Compare CWIMAQViewer1.Image, 50, i, cwimaqClearIfEQ

' Compare image i to the image in Viewer1.
' Do the comparison inplace (store the result in i)
CWIMAQVision1.Compare CWIMAQViewer1.Image, i, i, cwimaqClearIfGT

Compare Example

See Also

Average

Min

Max