VISEDGE
(Statement)

Measure the edge in a window.

VISEDGE<window number>,<coordinate X>,<coordinate Y>, <step>, <processing object>, <level>[,<mode>[, <binary lower limit>
[,<binary upper limit>]]]

<window number>
Specifies the window number (0 to 511).
<coordinate X>
Specifies the X coordinate (0 to 511).
<coordinate Y>
Specifies the Y coordinate (0 to 479).
<step>
Specifies the scanning direction and the sampling rate (-511 to 511).

<processing object>
Specifies the objects to be measured (0 to 2)
0: Turning point from black to white (edge)
1: Turning point from white to black
2: Turning point (both edges 0 and 1)

<level>
Designates the level to detect the edge (0 to 512).
<mode>
Designates the method for detecting the edge. If this is ignored, 0 will be the default setting.
0: Absolute value of average brightness
1: Difference value of the average brightness
2: Absolute value of the area
3: Difference value of the area

<binary lower limit>
Designates the lower level for binarization (0 to 254 lower limit < upper limit). The default is 0.
<binary upper limit>
Designates the upper level for binarization (1 to 255 lower limit < upper limit) The default is 255.

-
Specifies the processing range with a window.
: Available ×: not available
Line (2-point designation)Windmake PLine (Length and angle)Windmake LCircleWindmake C×EllipseWindmake E×SectorWindmake SRectangleWindmake R
-
If the specified window is larger than the screen, an error will result.
-
The following data can be obtained with the processing result obtaining function.VISSTATUS (n)nItem0Execution result 0= Normal, -1= Abnormal1Number of edges detected2Execution time
VISGETNUM (a, b)ba = 0~5110Unknown1Coordinate X value2Coordinate Y value3Angle(Note)4Unknown5Unknown6Unknown7Unknown8Unknown9Unknown
NoteGauging results (angle) can be obtained only when the processing range is specified in the sector window (mode=0).
-
The processing screen is the one defined by VISWORKPLN.
-
For this instruction, a µVision board (option) is required.
-
Increasing the number of steps reduces the detection time but lowers the resolving power for detection.
-
If the specified processing range exceeds 360 degrees in the sector window, edge finding applies to the range exceeding 360 degrees.

VISSCREEN 1,0,1
|
'Instantaneously draw on drawing screen 0
|
VISPLNOUT 0
|
|
VISCLS 0
|
|
WINDMAKE R,1,300,20,0,0
|
'Set window 1 to rectangle
|
CAMIN 2
|
'Obtain a camera image from the storage memory
|
VISWORKPLN 0
|
'Designate the object to storage memory 0
|
VISPLNOUT 0
|
|
VISEDGE 1,100,100,1,0,128
|
'Measure an edge
|
WINDDISP 1
|
|
I1 = VISSTATUS(0)
|
|
IF I1 = 0 THEN
|
|
FOR I1 = 0 TO VISSTATUS(1)-1
|
|
VISCROSS VISPOSX(I1), VISPOSY(I1)
|
|
|
|
NEXT I1
|
|
I1 = VISSTATUS(1)
|
|
IF I1 = 0 THEN
|
|
VISLOC 10,10
|
|
VISPRINT "An edge cannot be found."
|
|
END IF
|
|
ELSEIF I1 <> 0 THEN
|
|
VISLOC 10,10
|
|
VISPRINT "Measurement cannot be done."
|
|
END IF
|
|