imaqWatershedTransform

NI Vision for LabWindows/CVI Function

imaqWatershedTransform

Usage

int imaqWatershedTransform(Image* dest, const Image* source, int connectivity8, int* zoneCount);

Purpose

Computes the watershed transform on an image. Refer to the NI Vision Concepts Manual for more information about watershed transform.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16

Parameters

Name

Type

Description

dest Image* The destination image.
source const Image* The source image.
connectivity8 int Specifies how the watershed transform algorithm determines whether an adjacent pixel belongs to the same or different catchment or watershed line.
zoneCount int* On return, specifies the number of zones detected in the image. A zone is a region of the image in which all of the pixels belong to the same catchment basin. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

int On success, this function returns a non-zero value. On failure, this function returns 0. To get extended error information, call imaqGetLastError().

Parameter Discussion

dest—If dest is of type IMAQ_IMAGE_U8, the function can store up to 255 unique labels not including the watershed line value of 0. If dest is of type IMAQ_IMAGE_I16, the function can store up to 32,767 unique labels not including the watershed line value of 0.