imaqParticleFilter2

NI Vision for LabWindows/CVI Function

imaqParticleFilter2

Usage

int imaqParticleFilter2(Image* dest, Image* source, const ParticleFilterCriteria2* criteria, int criteriaCount, int rejectMatches, int connectivity8, int* numParticles);

Purpose

Filters particles based on their morphological measurements.

Note   This function is obsolete. The replacement function is imaqParticleFilter3().

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.
rejectMatches int Set this parameter to TRUE to transfer only those particles that do not meet all the criteria. Set this parameter to FALSE to transfer only those particles that meet all the criteria to the destination.
connectivity8 int Set this parameter to TRUE to use connectivity-8 to determine whether particles are touching. Set this parameter to FALSE to use connectivity-4 to determine whether particles are touching. For more information about connectivity, refer to Chapter 9, Binary Morphology, in the NI Vision Concepts Manual.
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.