You are here:
Start »
Program Examples »
Tablets
Tablets
Aim:
The aim of the program is to detect missing or damaged tablets on a conveyor belt.
Input:
A series of images from the conveyor of a production line.

Output:
Detected missing or damaged tablets:

Hints:
To detect damaged tablets, it is recommended to consider using the DetectMultipleCircles filter together with the CheckPresence_Intensity filter to verify object presence
by analyzing pixel intensities. To ensure that the inspection is performed once for each batch of tablets, you can specify a Region Of Interest, where the inspection should be performed,
as an input of the CheckPresence_EdgeAmount filter.
Labeling connections is explained in this article.
Solution (FIS):
►Click here to show the solution.
▼Click here to hide the solution.
-
In Workspace Explorer, open the workspace Examples, and in the Filmstrip window, select the Tablets dataset. Drag the Image channel to the ACQUIRE section.
-
Add the CheckPresence_EdgeAmount filter.
- Label the outIsPresent as IsKeyFrame.
- Connect the ReadFilmstrip output to the inImage input of the current one.
- In Properties window, in the bottom left corner, set the inEdgeScale to 2.
- Set the inMinAmount to 0.27 to determine the minimum amount of the pixels that should be detected.
- Click on the CheckPresence_EdgeAmount filter and select the inRoi parameter in the Properties window to mark the region as shown on image below:

-
Add a formula that converts an input image into Nil when no tablets are found:
KeyFrame = if IsKeyFrame then Image else Nil
-
Add the DetectMultipleCircles filter.

-
Add the CircleBoundingRectangle and connect its inCircle with the DetectMultipleCircles's outCircles
-
Add the CheckPresence_Intensity filter.
-
Now create HMI by clicking on HMI Designer in the upper toolbar.
- Add the View2dBox control and connect the ReadFilmstrip output to its inImage input. It is going to display the images from the production line.
- Connect the IsPresent with the View2dBox.InStatus1.
- Connect the TabletCircles with the View2dBox.InData1.
Macrofilter Main

Used Filters
►Click here to show the filters list.
▼Click here to hide the filters list.
Icon |
Name |
Description |
 |
CheckPresence_EdgeAmount |
Quick and easy presence verification, e.g. for missing caps, screws, labels. |
 |
CheckPresence_Intensity |
Quick and easy presence verification, e.g. for missing caps, screws, labels. |
 |
CircleBoundingRectangle |
Computes the smallest rectangle containing a circle. |
 |
DelayByPeriod |
Suspends the program workflow for inTime milliseconds relative to the end of the filter's last invoke time. |
 |
DetectMultipleCircles |
Detection of circular or close-to-circular objects like holes, pins, pills, particles. |
Further Readings