imaqDanielssonDistance

NI Vision for LabWindows/CVI Function

imaqDanielssonDistance

Usage

int imaqDanielssonDistance(Image* dest, Image* source);

Purpose

Creates a very accurate distance map based on the Danielsson distance algorithm. The function encodes the pixel value of a particle as a function of the distance of the pixel from the particle perimeter. For a faster but less precise algorithm, use imaqSimpleDistance().

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16

Parameters

Name

Type

Description

dest Image* The destination image.
source Image* The image that the function uses to compute the distance map. The function modifies the border of the source image. The border must be at least one pixel wide.

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

source—This function modifies the source image. If you need the original image, create a copy of the image using imaqDuplicate() before using this function.