Aurora Visio Studio TOP » Program Examples » Pattern Cutting
Pattern Cutting
目的
The task is to detect the gaps in the grid pattern and fill them.
Input
An image with the grid pattern.
Output
Region representing the gaps in the input pattern.
ヒント
To detect the gaps, at the beginning fill them using the OpenImage and the CloseImage filters. Then use the ThresholdToRegion_Relative filter to identifies pixels representing the gaps.
Solution (AVS)
-
In Workspace Explorer open workspace Examples and in Film strip window select PatternCutting dataset. Drag the Image channel to the ACQUIRE section.
-
To detect horizontal lines add the CloseImage filter and set its input inRadiusY to 0.
-
Add the OpenImage filter and connect its input to the outImage. Set its input inRadiusY to 0.
-
To obtain an image with continuous horizontal lines, create a global parameter MaxGapLength of type Integer by clicking Create New Global Parameter... Set its value to 20.
-
Connect the created global parameter to the inRadiusX inputs of both CloseImage and OpenImage filters.
-
Add another CloseImage filter and connect its input with the loaded image. Set the inRadiusX to 0.
-
Add the OpenImage filter and connect its input to the outImage. Set the inRadiusX to 0.
-
Connect the global parameter MaxGapLength to the inRadiusY input ports of both CloseImage and OpenImage filters.
-
To compose horizontal and vertical lines add the MinimumImage filter.
-
The last step is to extract a region representing the gaps. This can be achieved using ThresholdToRegion_Relative filter.
-
Connect the inImage to the output of the ReadFilmstrip filter.
-
Connect the inBaseImage to the output of the MinimumImage.
-
Set the inMinRelativeValue to 30. Drag the outRegion output and put it to the Data Preview Window to display the result.
マクロフィルタ メイン
使用したフィルタ
アイコン | 名前 | 説明 |
---|---|---|
ThresholdToRegion_Relative | Thresholds an image with a different threshold value for each pixel (inBaseImage(x, y) + inValue). | |
MinimumImage | Creates an image from the lower pixel values of each corresponding pair. | |
OpenImage | E.g. removal of the "salt" component of salt-and-pepper noise. | |
CloseImage | E.g. removal of the "pepper" component of salt-and-pepper noise. |
その他の資料
- Image Processing - A comprehensive introduction to Image Processing.