Min Method

NI Vision for Visual Basic

Min Method

Syntax

CWIMAQVision.Min SourceImage, Operand, DestImage

Return Type

Long

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

Purpose

Computes the minimum value between two pixels or a pixel and a constant and copies the value to the destination pixel.

Remarks

Use this method with U8, I16, and SGL images.

If Operand is an image, the method copies the smaller pixel value of the two source pixels into the destination for each pixel. If Operand is a constant, the method copies the source image to the destination in the following manner: If the source image pixel value is less than the given constant, the function copies the source pixel to the destination. Otherwise the function copies the constant value to the destination.

If Operand is an image and Operand is of a type that contains more bits per pixel than SourceImage, Operand and DestImage must be the same type of image. Otherwise, SourceImage and DestImage must be the same type of image.

Parameters

SourceImage As CWIMAQImage

The first input image.

Operand As Variant

The second input image or a constant.

DestImage As CWIMAQImage

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

Example

Dim i As New CWIMAQImage

' Find the min of a constant and the image in Viewer1.
' Store the result in i
CWIMAQVision1.Min CWIMAQViewer1.Image, 50, i

' Find the min of the pixels image i and the image in Viewer1.
' Do the operation inplace (store the result in i)
CWIMAQVision1.Min CWIMAQViewer1.Image, i, i

See Also

Max