Aurora Visio Studio TOP » Tutorial Exercises » Edge-based Template Matching: Gasket (ebtm_gasket_expert)
Edge-based Template Matching: Gasket (ebtm_gasket_expert)
Aim
Your task is to create a program which will be able to detect the position of a gasket.
Input
The images of a gasket with variable location and rotation.
The input images are stored in
gasket_inspection
directory.
Output
The location of the object.
Hints
This exercise shows a way to find an object in an image using Edge-based Template Matching. To use EbTM please use LocateSingleObject_Edges1 filter.
Labeling connections is explained in this article.
Solution (AVS)
-
Add EnumerateImages filter to ACQUIRE section to load consecutive images from a disk directory.
-
Add LocateSingleObject_Edges1 filter to PROCESS section and connect it with the input image.
-
Open a template matching editor on inEdgeModel and make sure to select Expert complexity mode in the top right corner. Select the template region as shown in the picture below. Please note that you can select multiple smaller, separate regions for better rotation detection.
-
Set the range of possible rotations from -20 to +20.
-
In the next tab mark a reference rectangle as shown in the image below.
-
Add the outImage and outObject.Match outputs to a data preview.
-
Perform several iterations of the program and verify if the results are correct.
-
You may add AlignRectangle filter, connect outObject.Alignment with inAlignment to get a view of an aligned rectangle to the object.
その他の資料
- Template Matching - Most detailed description of the Template Matching technique.