imaqParticleFilter4

NI Vision for LabWindows/CVI Function

imaqParticleFilter4

Usage

int imaqParticleFilter4(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, const ParticleFilterOptions2* options, const ROI* roi, int* numParticles);

Purpose

Filters particles based on their morphological measurements.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL

Parameters

Name

Type

Description

dest Image* The destination image that will contain only the filtered particles.
source Image* The image containing the particles to filter.
criteria const ParticleFilterCriteria2* An array of criteria to apply to the particles in the source image. This array cannot be NULL.
criteriaCount int The number of elements in the criteria array.
options const ParticleFilterOptions2* The options used by the function to filter binary particles.
roi const ROI* The ROI whose contours a particle must be contained in to avoid being filtered out. If rejectBorder is true in options, any particle touching the border of a contour in roi will also be filtered out. Set this parameter to NULL to filter particles in the entire image based on the criteria array.
numParticles int* On return, the number of particles left in the image.

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.

options—Set options to NULL to use the following default values:

rejectMatches FALSE
rejectBorder FALSE
fillHoles FALSE
connectivity8 TRUE