Execute measurement with different edge level


Overview

This sample executes measurement with different edge level, and displays it in Text Window.

Specification of this example


Behavior
This Sample executes the measurement of [ECM Search] with different edge levelon each measurement, and displays it in Text Window.

Output Image


How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
refFile

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 executes the measurement of [ECM Search] with different edge level on each measurement, and displays it in Text Window.

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
ECM Search
2.
Macro
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MCRINIT
    Dim EDGELEVEL&(2)         '(1)
    EDGELEVEL&(0) = 50
    EDGELEVEL&(1) = 100
    EDGELEVEL&(2) = 200
    COUNT& = 0
    UNIT& = 1
Return

*MEASUREPROC
    '(2)
    NOWLEVEL& = EDGELEVEL&(COUNT&)
    If COUNT& < 2 Then
        COUNT& = COUNT& + 1
    Else
        COUNT& = 0
    EndIf
    SetUnitData UNIT&, "edgeLowerLevel", EDGELEVEL&(COUNT&)

Return

*MEASUREDISPT
    '(3)
    MESSAGE$ = "Edge Level = " + Str$(NOWLEVEL&)
    DrawText MESSAGE$, 1, 1

Return

The macro program is in refthis link.
Explanation
(1)Initialize parameters(ex.edge level) when initialize measurement.
(2)Change the edge level for [ECM Search]. It is used in the next measurement.
(3)Display the edge level when measureing in Text Window.