Vision Part:
Download the tutorial files here
- Aim - Find irregularities on tablets using following steps.
- 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 small noise particles from the image.
- Create LabVIEW VI – follow the guide and generate LabVIEW code from your script.
LabVIEW Part:
- Aim - Mark irregularities on image as ROI
- Save copy of original image using IMAQ tools
- Use IMAQ MaskToROI and IMAQ Overlay ROI
- Show ROI on original image