Subscribe by Email

Your email:

Custom-Tailored Solutions

Current Articles | RSS Feed RSS Feed

Image Thresholding

  
  
  
  
  

The backbone of any machine vision image processing is image thresholding. For locating or gauging; feature detection with blob, template, or pattern find tools; or reading with barcode, data-matrix, or OCR tools; the heart of the operation is thresholding and/or gradient analysis. This article reviews some of the common thresholding methods used in PPT VISION IMPACT software.

Fixed Thresholding

Initially, fixed thresholding might seem like the ideal method since you are setting the threshold level exactly where you want it. The drawback is, while this might be ideal for a particular image, when lighting and object variations occur in the manufacturing environment a fixed threshold setting might not adapt and analyze images as desired in a process. As this example shows, a fixed threshold of 90-100% shows the white areas in the image, but when the overall intensity of the images dims this threshold setting no longer extracts useful features for analysis.

brian blog resized 600

Auto Thresholding

Auto Thresholding is used most commonly in the IMPACT software suite. With this method, the threshold setting is automatically adjusted on every image, based on the current grey level histogram in the ROI (Region of Interest). This dynamic thresholding capability is very robust when it comes to compensating for those lighting and object variations. Using the same sample images, the Auto Threshold calculation yields threshold settings from 54-100 & 18.4-100, respectively, for the good image and the “darker image.”

describe the image

The Auto Threshold algorithm works well when the histogram is a Bi-Modal distribution (having two distinct data groupings) as seen here.

brian histogram resized 600

When the grey levels are more single mode, or grouped together around one common average, one of the following two methods should be used.


Center Range on Average Thresholding

The Center Range on Average threshold method calculates the average grey level of the ROI, and then sets the min and max threshold range with the average at the center. In the example below, the left image uses Auto Thresholding Dark Pixels. It fails to set the threshold optimally because it calculates the two Bi-Modal peaks to be at 78% and 100% and sets a threshold range of 0-90, which incorrectly includes the entire region of interest.

The right image uses Center Range on Average thresholding which, along with the Blob tool property to “Find Blobs that Are Outside Threshold Range,” correctly calculates the threshold range of 0-48% and finds only blobs that are truly “dark blobs.”

brian 3 resized 600

Calculate Your Own Threshold

The last, and potentially the most flexible thresholding method, is to calculate your own threshold, using such tools as the Average Intensity, Line Profile, and BASIC tools. From these tools, grey level average, minimum, maximum, and other values can used in a user-written BASIC formula to dynamically calculate a threshold range for each image.

brian 4 resized 600

Summary

IMPACT software provides many methods to calculate and set threshold levels, each with its advantages and disadvantages. The end value is that IMPACT software is very flexible and adaptable when it comes to thresholding images for analysis.

If you’d like to try this flexible software with dynamic auto-thresholding capabilities, click on this link to download the IMPACT Software.

Comments

Currently, there are no comments. Be the first to post one!
Post Comment
Name
 *
Email
 *
Website (optional)
Comment
 *

Allowed tags: <a> link, <b> bold, <i> italics