Skeleton Method

NI Vision for Visual Basic

Skeleton Method

Syntax

CWIMAQVision.Skeleton SourceImage, DestImage, Skeleton

Return Type

Long

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

Purpose

Starting from a binary image, calculates the skeletons of the particles within an image or the lines delineating the zones of influence of the objects (skeleton of an inverse image).

Remarks

This method modifies the source image. If you need the original source image, create a copy of the image using the CWIMAQVision.Copy method before using this method.

Use this method with U8 images.

The calculation modifies the border of the source image. The border must be at least one pixel wide.

Parameters

SourceImage As CWIMAQImage

The image whose skeleton the method derives.

DestImage As CWIMAQImage

The resulting image.

Skeleton As CWIMAQSkeletons

The method to calculate the skeleton.

Example

Private Sub Run_Click()
    Dim i As New CWIMAQImage
        
    ' Threshold the image in Viewer1
    CWIMAQVision1.Threshold CWIMAQViewer1.Image, CWIMAQViewer1.Image, _
                            128, 255, , 255
    
    ' Perform a skeleton on the image in Viewer1.
    ' Store the result in i.
    CWIMAQVision1.Skeleton CWIMAQViewer1.Image, i, cwimaqSkeletonIZ
    
    CWIMAQViewer2.Attach i
End Sub