Improve the binary image, Removing unwanted blobs, Improve the binary image -3 – National Instruments IMAQ Vision for Measurement Studio User Manual

Page 42: Removing unwanted blobs -3

Advertising
background image

Chapter 4

Blob Analysis

© National Instruments Corporation

4-3

IMAQ Vision for LabWindows/CVI User Manual

Improve the Binary Image

After 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. Advanced 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 advanced morphology functions that improve binary images require
that you specify the type of connectivity to use. Connectivity specifies how
IMAQ Vision determines whether two adjacent pixels belong to the same
particle. If you have a blob that contains narrow areas, use connectivity-8
to ensure that the software recognizes the connected pixels as one blob.
If you have two blobs that touch at one point, use connectivity-4 to ensure
that the software recognizes the pixels as two separate blobs. For more
information about connectivity, see Chapter 9, Binary Morphology, of the
IMAQ Vision Concepts Manual.

Note

Use the same type of connectivity throughout your application.

Removing Unwanted Blobs

Use

imaqRejectBorder()

to remove blobs that 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. You can also use the

IMAQ_ERODE

,

IMAQ_OPEN

, and

IMAQ_POPEN

methods in

imaqMorphology()

to remove small particles.

Unlike

imaqSizeFilter()

, these three operations alter the size and

shape of the remaining blobs.

Use the

IMAQ_HITMISS

method of

imaqMorphology()

to locate

particular configurations of pixels, which you define with a structuring
element. Depending on the configuration of the structuring element, the

IMAQ_HITMISS

method 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,
see Chapter 9, Binary Morphology, of the IMAQ Vision Concepts Manual.

Advertising