Aurora Visio Studio TOP » Tutorial Exercises » Finding Razor Head Defects (razor)
Finding Razor Head Defects (razor)
Aim
Develop an application that finds two types of product defects:
- Check if both razor arms are not broken,
- Check if smaller arms are not connected.
Show the inspection results on the HMI.
Input
Images of razor heads with defects. Objects are lit using backlight. Example defects are marked in red.
Images are stored in
razor
directory.
Output
The application should show proper information if any of the defects were identified. Design simple HMI which shows the result of each inspection.
Hints
This exercise presents one of the typical vision problems. This task uses a common algorithm schema:
- Find element using Template Matching technique,
- Check defects presence using high-level tools.
You can label outputs by clicking on them twice.
Solution (AVS)
-
Load images from the directory using EnumerateImages filter. Place it in the ACQUIRE section.
-
Add LocateSingleObject_Edges1 filter to the PROCESS section and connect to it an output of EnumerateImages filter.
-
Create a template model using Model Definition Window. To access it, go to the Properties window and click "..." button next to the inEdgeModel. Create the model as shown in the image below:
NOTE: To get more information on how to create Template Matching models, please refer to Creating Models for Template Matching article.
-
Add the CheckPresence_PixelAmount filter to check if the distance between inner arms is filled with white pixels.
- Set inRoi to the purple rectangle presented below,
- Set inMinBrightness to 250 because we want to find only a very bright region,
- Set inMinAmount to 0.4.
This filter checks if a white color covers more than 40% of the selected ROI.
-
Add two other CheckPresence_PixelAmount filters to check presence of arms.
- Set inRoi to orange and green rectangles presented in the image above,
- Set inMinBrightness to 0,
- Set inMaxBrightness to 100,
- Set inMinAmount to 0.5.
-
Connect outObject.Alignment with the input inRoiAlignment of each CheckPresence_PixelAmount filter. Thanks to this even if object moves or rotates, the alignment will automatically set correct ROIs in the right places.
-
Open the HMI Designer by clicking its icon in the Application Toolbar. Add View2DBox and connect it with the output of EnumerateImages.
-
Add three PassFailIndicator HMI controls and connect them with outIsPresent outputs of the CheckPresence_PixelAmount filter.
-
Add Label with "Razor inspection" text.
Macrofilter Main
その他の資料
- Template Matching - Most detailed description of the Template Matching technique.