Show the measurement result with classification
Overview
Classify the measurement result into three level, and display it in ImageWindow.
Specification of this example
Behavior
Get the correlation value from [Search] and make classification as below.
Rank
|
Correlation
|
A
|
80-100
|
B
|
50- 80
|
C
|
0- 50
|
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 result (ABC) in Image Window.
How to implement
Scene data
Unit No.
|
Processing Item
|
0.
|
Camera Image Input
|
1.
|
Search
|
2.
|
Macro
|
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MEASUREPROC
Return
*MEASUREDISPG
MYUNIT& = UnitNo
WRKCR# = UnitData(MYUNIT& - 1,"CR") '(1)
If WRKCR# < 50 Then '(2)
RANK$ = "C"
COLOR& = JUDGE_NG
Elseif WRKCR# < 80 Then
RANK$ = "B"
COLOR& = JUDGE_NC
Else
RANK$ = "A"
COLOR& = JUDGE_OK
EndIf
SetTextStyle 40, TA_TOP, COLOR&, 0, FONTSTYLE_BOLD + FONTSTYLE_UNDERLINE '(3)
DrawTextG RANK$ + "(" + Str$(WRKCR#) + ")", 10, 10, 0
Return
The macro program is in
this link.
Explanation
(1)Get judgement result (correlation value) of forward unit via external reference data.
(2)Make classification by threshold value.
(3)Display ranks.