
Chapter4 BlobAnalysis
©NationalInstruments Corporation 4-3 IMAQVision for LabWindows/CVI User Manual
Improve the Binary ImageAfter you threshold your image, you may want to improve the resulting
binary image with binary morphology. You can use primary binary
morphology or advanced binary morphology to remove unwanted blobs,
separate connected blobs, or improve the shape of blobs. Primary
morphology functions work on the image as a whole by processing pixels
individually.A dvanced morphology operations are built upon the primary
morphological operators and work on particles as opposed to pixels.
Note The terms blob and particle are used interchangeably in this chapter.
The advancedmorphology functions that im provebinary images require
thatyou specify the type of connectivity to use. Connectivity specifies how
IMAQVision determines whether two adjacent pixels belong to the same
particle. If you havea blob that contains narrow areas, use connectivity-8
to ensure thatthe software recognizes the connected pixels as one blob.
Ify ou havetwo blobs that touch at one point , use connectivity-4t o ensure
thatthe software recognizes the pixels as two separate blobs. For more
information about connectivity,see Chapter 9, Binary Morphology,ofthe
IMAQ Vision Concepts Manual.
Note Use the same type of connectivity throughout your application.
Removing Unwanted Blobs
Use imaqRejectBorder()to remove blobs th at touch the border of the
image. Reject blobs on the border of the image when you suspect that the
information about those blobs is incomplete.
Use imaqSizeFilter()to remove large or small particles that do not
interest you. Youcan also use the IMAQ_ERODE,IMAQ_OPEN,and
IMAQ_POPENmethods i n imaqMorphology()to rem ovesmall particles.
UnlikeimaqSizeFilter(), these three ope rations alter the size and
shape of the remaining blobs.
Use the IMAQ_HITMISSmethod of imaqMorphology() to locate
particular configurationsof pixels, which you define with a structuring
element. Depending on the configuration of the structuring element, the
IMAQ_HITMISSmethod can locate single isolated pixels, cross-shape or
longitudinal patterns, right angles along the edges of particles, and other
user-specified shapes.For more information about structuring elements,
seeChap ter 9, BinaryMorphology,oftheIMAQVision Concepts Manual.