Aurora Visio Studio TOP » Program Examples » Parallel Image Saving
Parallel Image Saving
目的
The task is to save the last image with drawn results.
Input
An image containing a gasket.
Output
Saved image with drawn results.
ヒント
Read more about the original Gasket Inspection example here. In order to reduce the execution time, draw and save results using a Worker Task Macrofilter.
接続のラベル付けについては こちらを参照ください。
Solution (AVS)
- Use the code from the Gasket Inspection example to prepare the inspection.
-
From the Project Explorer window create a new UserType named InspectionPacket. All the inputs, which need to be created, as well as their corresponding data types are shown in the image below.
-
From the Project explorer window create a new SavingQueue with the InspectionPacket data type.
-
From the Project explorer window create a new Worker Task called SaveLastImage.
-
Add the Queue_Push filter to the main program's PROCESSING section and assign it the SavingQueue queue.
-
Right click on the inValue of the Queue_Push filter and select "Expand Structure Fields".
-
Connect created inputs using the following scheme:
- Connect the outImage output of the EnumerateImages filter with the inValue.Image input of the Queue_Push filter,
- Connect the outMatch output of the LocateSingleObject_Edges1 filter with the inValue.Rectangle input of the Queue_Push filter,
- Connect the outCircle output of the first FitCircleToEdges filter with the inValue.Circle1 input of the Queue_Push filter,
- Connect the outCircle output of the the second FitCircleToEdges filter with the inValue.Circle2 input of the Queue_Push filter,
- Connect the outConnectingSegment output of the first PointToPointDistance filter with the inValue.Segment1 input of the Queue_Push filter,
- Connect the outArc output of the first FitArcToEdges filter with the inValue.Arc1 input of the Queue_Push filter,
- Connect the outArc output of the second FitArcToEdges filter with the inValue.Arc2 input of the Queue_Push filter,
- Connect the outConnectingSegment output of the the second PointToPointDistance filter with the inValue.Segment2 input of the Queue_Push filter.
-
Go to the SaveLastImage Worker Task macrofilter.
-
In the ACQUIRE section add the Queue_Pop and the Loop filters.
-
In the PROCESS section add following filters in specified order: the DrawRectangles_SingleColor, the DrawCircles_SingleColor, the DrawCircles_SingleColor, the DrawSegments_SingleColor, the DrawArcs_SingleColor, the DrawArcs_SingleColor, the DrawSegments_SingleColor and the SaveImage.
-
Right click on the outValues of the Queue_Pop filter, select the PropertyOutput and check all visible outputs.
-
Connect created outputs by following the scheme in the image below.
-
Set the inFile input of the SaveImage filter to LastResult.bmp.
-
Program is ready to use. In the current version, programs using worker tasks can be properly run only in the Run mode (F5).
マクロフィルタ メイン
使用したフィルタ
アイコン | 名前 | 説明 |
---|---|---|
DrawRectangles_SingleColor | 画像上に単色で四角形を描画します。 | |
DrawCircles_SingleColor | Draws circles on an image with a single color. | |
LocateSingleObject_Edges1 | 輪郭がシャープで硬い物体の検出。 多くの場合、プログラムの最初のフィルターの 1 つです。 | |
FitArcToEdges | Precise detection of an arciform edge, whose rough location is known beforehand. | |
Loop | このフィルターを、ループを持つ必要があるタスクに配置しますが、他のループ ジェネレーター (例: GrabImage) を持たないようにします。 | |
PointToPointDistance | Measures the distance between two points. | |
SaveImage | Saves an image to a file. | |
DrawSegments_SingleColor | Draws segments on an image with a single color. | |
DrawArcs_SingleColor | Draws arcs on an image with a single color. | |
EnumerateImages | ディスクに保存された画像を使用して画像取得をエミュレートします。 | |
FitCircleToEdges | Precise detection of a circular object or hole, whose rough location is known beforehand. |
その他の資料
- Shape Fitting - シェイプ フィッティング テクニックの使用法を紹介します。
- Template Matching - テンプレート マッチング テクニックの最も詳細な説明をしています。