
Chapter4 BlobAnalysis
IMAQVision for LabWindows/CVI User Manual 4-4 ni.com
Ifyou know enough about the shape features of the blobs you want to keep,
use imaqParticleFilter()to filter out particles that do not interest
you.If you do not have enough information about the particles you want to
keepat this point in your processing, usethe particle measurement
functionsto obtain this information before applying a particle filter. See the
Make Particle Measurements section for more information about the
measurement functions.
Separating TouchingBlobs
Use imaqSeparation()or apply an erosion or an open ope ration with
imaqMorphology()to separate touchi ng objects. The
imaqSeparation()function is an advanced function that separates blobs
withoutmodifying their shapes. However, e rosion and open functions alter
the shape of all the blobs.
Note Aseparation is a time-intensive operation compared to an erosion or open operation.
Considerusing an erosion or open if speed is an issue with your application.
Improving Blob Shapes
Use imaqFillHoles()to fill hol es in the blobs. Use
imaqMorphology()to perform a variety of operations on t he blobs. You
canuse t he IMAQ_AUTOM,IMAQ_CLOSE,IMAQ_PCLOSE,IMAQ_OPEN,and
IMAQ_POPENmethods to smooth the boundaries of the blobs. Open and
proper open smooth the boundaries of the blob by removing small
isthmuses while close widens the isthmuses. Close and proper close fill
smallholes in the blob. Auto-median removes isthmuses and fills holes.
For more information about these methods, see Chapter 9, Binary
Morphology,intheIMAQ Visio n Concepts Manual.
Make Particle MeasurementsAfteryou create a binary image and improve it, you can make particle
measurements.With these measurements you can determine the location of
blobsand their shape features. Use the following functions to perform
particle measurements:
•imaqGetParticleInfo()—Thisfunction returns the number of
blobs in an image and a report containing the pixel area, real-world
area, and bounding rectangle of the blobs. Youcan use the bounding
rectangle to determine the location of theblob in the image. You can
also havethis function return a report con taining 16 of the most