Sort by the outline
Overview
Sort by the outline.
Specification of this example
Behavior
The outline of the bin is measured, and the kind is judged.
Screenshot
How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
File
2.Right-click and hold on the zip file, and drop it on working window of FJ system. The images and scene data in zip file are loaded on the program automatically.
3.Re-measure the image. Then System automatically displays the kind of the bin in Image Window.
How to implement
Scene data
Unit No.
|
Processing Item
|
0.
|
Camera Image Input
|
1.
|
Edge Position
|
2.
|
Edge Position
|
3.
|
Macro
|
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MCRINIT
UNITNO1& = 1
UNITNO2& = 2
Return
*MEASUREPROC
X1# = UnitData(UNITNO1&, "X") '(1)
X2# = UnitData(UNITNO2&, "X")
if X1# < 200 then '(2)
RESULT$ = "Thick Bin"
elseif X2# < 240 then
RESULT$ = "Tall Bin"
else
RESULT$ = "Small Bin"
endif
Return
*MEASUREDISPG
SetTextStyle 20, TA_TOP, JUDGE_OK, 0, FONTSTYLE_BOLD '(3)
DrawTextG RESULT$, 10, 10, 0
return
The macro program is in
this link.
Explanation
(1)Get the result of [Edge Position].
(2)Sort the kind of the bottle by the outline.
(3)Display the result in Image Window.