Set calibration parameter via external reference data
Overview
Set calibration parameter via external reference data.
Specification of this example
Behavior
Get calibration parameter from another scene, and set it.
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.If Measurement the Scene 0, register the set calibration parameter in global data.
After that, measurement the Scene 1, set the calibration parameter which get from global data to the unit 3.
The detail result of unit no.1 and 4 is different, because the parameter of unit no.3 is changed.
How to implement
Scene data (Scene 0)
Unit No.
|
Processing Item
|
0.
|
Camera Image Input
|
1.
|
Macro
|
The Macro Program below segment is to be set in '1.Macro'.
Macro Program
*MCRINIT
CAMUNITNO& = 0
GLOBALCALPARAM$ = "CALIBPARAM"
AddGlobalData GLOBALCALPARAM$, "1,0,0,0,1,0"
Return
*MEASUREPROC
GetUnitData CAMUNITNO&,"calibparameter0",CARIBPARAM$ '(1)
SetGlobalData GLOBALCALPARAM$, CARIBPARAM$
Return
Scene data (Scene 1)
Unit No.
|
Processing Item
|
0.
|
Camera Image Input
|
1.
|
Search
|
2.
|
Macro
|
3.
|
Camera Image Input
|
4.
|
Search
|
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MCRINIT
CAMUNITNO&& = 3
GLOBALCALPARAM$ = "CALIBPARAM"
Return
*MEASUREPROC
GetGlobalData GLOBALCALPARAM$, CARIBPARAM$ '(2)
SetUnitData CAMUNITNO&&,"calibparameter0",CARIBPARAM$
Return
The macro program is in
this(Scene0) and
this(Scene1) link.
Explanation
(1)Set the calibration parameter in global data.
(2)Get the calibration parameter from global data, and set it to the unit 0.