Aurora Visio Studio TOP » Tutorial Exercises » Gray-based Template Matching: Missing Chip (gbtm_missing_chip)
Gray-based Template Matching: Missing Chip (gbtm_missing_chip)
Aim
Your task is to create a simple algorithm which detects empty pads on a printed circuit board.
Input
A set of images with a grid of prepared pads ready for soldering process.
The input image is stored in
gbtm_missing_chip
directory.
Output
An algorithm that finds the number of missing elements and the center of each missing element.
Hints
This exercise shows a way to find an object in an image using Gray-based Template Matching.
In this problem, a missing element should be treated as a template matching model. Find a missing element using LocateMultipleObjects_NCC filter.
In this case, the background inside a missing chip is irregular. Creating an edge based template model using boundary points will result in creation of a model which will find all objects in the image.
The image below shows the irregularities in the background of missing elements.
Labeling connections is explained in this article.
Solution (AVS)
-
Add EnumerateImages filter to Main macrofilter to load images from the input directory.
-
Add LocateMultipleObjects_NCC filter.
-
Open the model editor for inGrayModel and mark a template as in the image below. Set the Rotation Tolerance parameter to 2 degrees.
-
To reliably detect all missing chips, set inMaxPyramidLevel to:
-
1 and keep inMinScore at 0.7, or
-
2 and reduce inMinScore to 0.5
-
-
To get the count of matched missing objects expand field Count of outObjects.
-
To get the center points of found objects, use the outObjects.Point output of LocateMultipleObjects_NCC filter.
Main Macrofilter finds positions of missing elements using Gray-based Template Matching technique.
その他の資料
- Template Matching - Most detailed description of the Template Matching technique.