This chapter explains how to use the IntensityChecker step to determine whether pixels in a test region satisfy an intensity condition, such as having a value below a specified maximum. If the pixels in the test region adhere to the condition, the step's Status result returns Pass; otherwise it returns Fail. This is typically done to determine the general presence or absence of an object or markings.
In this example:
The IntensityChecker step considers all the pixels in the rectangular Test Region. In this case, the test region can either have or not have the cap of a water bottle.
The specified condition checks whether the Average intensity of the pixels is LessThan 82. In this case, pixels darker than 82 indicate that the bottle cap is there. Values can range from 0 (black) to 255 (white).
The Status of the IntensityChecker step returns Pass if the condition is satisfied; otherwise it returns Fail. In this case, Pass means that the bottle cap is present; Fail means it is absent.
In addition to Status, the IntensityChecker step also returns the following results for the specified pixels in the test region: the maximum pixel value, the minimum pixel value, the average pixel value, the contrast value, the number of pixels, and the standard deviation. You can use any of these statistics as the condition with which to check the pixels.
Filtering operations are available with the IntensityChecker step, allowing you to work on a copy of the image with some noise removed. If you are using color images, you must select a specific band with which to work. For more information, see the Dealing with color images section in Chapter 2: Building a project.
The condition that you specify with the IntensityChecker step applies to one test region at a time. When the IntensityChecker step returns Pass, you would then typically perform some other processing on that image. For example, you can use the Metrology step to specify features and tolerances to determine whether the cap is properly sealed onto the bottle.