Improve The Binary Image - National Instruments IMAQTM User Manual

Vision for visual basic
Table of Contents

Advertisement

Chapter 4
Performing Particle Analysis

Improve the Binary Image

Use the same type of connectivity throughout the application.
Note
IMAQ Vision for Visual Basic User Manual
If all the objects in the grayscale image are either brighter or darker than
the background, you can use
automatically determine the optimal threshold range and threshold the
image. Automatic thresholding techniques offer more flexibility than
simple thresholds based on fixed ranges. Because automatic thresholding
techniques determine the threshold level according to the image histogram,
the operation is more independent of changes in the overall brightness and
contrast of the image than a fixed threshold. These techniques are more
resistant to changes in lighting, which makes them well suited for
automated inspection tasks.
If the grayscale image contains objects that have multiple discontinuous
grayscale values, use
multiple threshold ranges.
If you need to threshold a color image, use
CWIMAQVision.ColorThreshold
ranges for each of the color planes—Red, Green, and Blue; or Hue,
Saturation, and Luminance. The binary image resulting from a color
threshold is an 8-bit binary image.
After you threshold the 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
particles, separate connected particles, or improve the shape of particles.
Primary morphology methods 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.
The advanced morphology methods that improve binary images require
that you specify the type of
IMAQ Vision determines if two adjacent pixels belong to the same particle.
If you have a particle that contains narrow areas, use
ensure that the software recognizes the connected pixels as one particle.
If you have two particles that touch at one point, use
ensure that the software recognizes the pixels as two separate particles.
For more information about connectivity, refer to Chapter 9, Binary
Morphology, of the IMAQ Vision Concepts Manual.
CWIMAQVision.AutoThreshold
CWIMAQVision.MultiThreshold2
. You must specify threshold
connectivity
to use. Connectivity specifies how
4-2
to
to specify
connectivity-8
to
connectivity-4
to
ni.com

Advertisement

Table of Contents
loading

This manual is also suitable for:

Imaq

Table of Contents