Convex Method

NI Vision for Visual Basic

Convex Method

Syntax

CWIMAQVision.Convex SourceImage, DestImage

Return Type

Long

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

Purpose

Obsolete—Use ConvexHull instead. Computes the convex envelope for each labeled particle in the source image. If the source image contains more than one particle, you must label each particle with Label before calling this method.

Remarks

Use this method with image types U8 and I16.

Parameters

SourceImage As CWIMAQImage

The image containing the labeled particles whose convex envelopes the method calculates.

DestImage As CWIMAQImage

The resulting image.

Example

Dim i As New CWIMAQImage
Dim j As New CWIMAQImage
Dim numParticles

' Threshold the image in Viewer1 and store the results in i
CWIMAQVision1.Threshold CWIMAQViewer1.Image, i, 128, 255, , 255

' Label i. Do the operation inplace (store the results in i).
CWIMAQVision1.Label i, i, numParticles

' Find the convex envelope of the particles in i.
' Store the result in j.
CWIMAQVision1.Convex i, j

See Also

ConvexHull