Adapt [Filtering] to images multiply


Overview

Adapt [Filtering] to images multiply.

Specification of this example


Behavior
This Sample adapts filtering to images multiply.
It can performs many various filtering to images.

Screenshot


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 adapts 5 times dilate filtering and 5 times erosion filtering to them.

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
Macro
2.
End
3.
Filtering
The Macro Program below segment is to be set in '1.Macro'.
Macro Program
*MCRINIT
    'Initialize                                       '(1)
    UNITNO& = 3
    FILTERKIND& = 121
    DILATE& = 3
    EROSION& = 4
Return

*MEASUREPROC

    SetUnitData UNITNO&, FILTERKIND&, DILATE&        '(2)
    Gosub *MULTIFILTER

    SetUnitData UNITNO&, FILTERKIND&, EROSION&       '(3) 
    Gosub *MULTIFILTER

Return

*MEASUREDISPG
    MeasureDispG UNITNO&, 0                          '(4)
    DrawUnitImage UNITNO&, 0
Return

*MULTIFILTER
    MeasureProc UNITNO&
    SetMeasureImage 0, UNITNO&, 0
    MeasureProc UNITNO&
    SetMeasureImage 0, UNITNO&, 0
    MeasureProc UNITNO&
    SetMeasureImage 0, UNITNO&, 0
    MeasureProc UNITNO&
    SetMeasureImage 0, UNITNO&, 0
    MeasureProc UNITNO&
    SetMeasureImage 0, UNITNO&, 0
Return

The macro program is in refthis link.
Explanation
(1)Initialize parameters(ex.parameter of filtering) when initialize measurement.
(2)Adapt dilate filtering 5 times.
(3)Adapt erosion filtering 5 times.
(4)display the result of filtering in Image Window.