Tablet Discoloration Inspection

NI Vision Assistant

Tablet Discoloration Inspection

Application Type Inspection
Image Characteristics Color
Image Processing Tool(s) Color Thresholding; Particle Analysis

The tablet discoloration inspection example determines the presence and quantity of discolored areas on tablets. This application performs a color threshold in HSL mode to detect any discoloration and uses the Particle Analysis function to count the number of defects.

Color Threshold: Manual—Thresholds the color image to separate the colored pills from the background. A color threshold in the HSL color space is applied to the image. For thresholding, appropriate threshold ranges for the Hue, Saturation, and Luminance planes are chosen so that all the areas in the image containing the color of the pill appear in the resulting binary image. All other areas, such as the background and the defects on the pills, do not show up in the binary image.

Image Buffer: Add Copy (1)—Stores a copy of the binary image into the image buffer for later use. The copy is stored in Buffer #1 of the image buffer.

Adv. Morphology: Fill Holes—Fills any holes that are present in the particles corresponding to the pills in the binary image. These holes are caused by regions on the pills that do not have the same color information as the pills. The resulting binary image contains entire particles, without holes, that correspond to the pills.

Operators: Subtract—Subtracts the original binary image stored in Buffer #1 of the image buffer from the binary image that contains the pill particles in their entirety. The resulting image contains the regions corresponding to the defects on the pills, as well as other noise particles.

Adv. Morphology—Removes the noise particles from the image.

Particle Analysis—Analyzes the remaining particles in the binary image to determine if they are significant enough to classify a pill as defective. Particle measurements such as area, length, and orientation are parameters that determine if a defect is significant or not.