SHCIRCLE
(Statement)
Searches for a circle.
SHCIRCLE <Window number>, <Coordinate X>, <Coordinate Y>, <Radius>, <Level difference>, <Mode>
<Window number>
Designates the window number (0 to 511).
<Coordinate X>
Designates the X coordinate (0 to 511).
<Coordinate Y>
Designates the Y coordinate (0 to 479).
<Radius>
Designates the radius of the circle to search for (3 to 240).
<Level difference>
Designates the detection level for the circle search (0 to 255).
<Mode>
Designates the object for the circle search (0 or 1).
-
Designate the process range with the window.
-
If the position of the designated window is not on the screen, an execution error will result.
-
The shape of the window available to designate is a rectangle with 0 degrees. If you designate any shape other than this, an error occurs.
-
The processing object is the screen designated with VISWORKPLN.
-
When this command is executed, the process screen 3 (VISWORKPLN 3) is used as a work area and data on the process screen 3 are not guaranteed. Also, you cannot use the process screen 3 for processing.
-
The following data can be obtained with the processing result obtaining function.VISSTATUS (n)nItem0Execution result 0= Normal, -1= Abnormal1Number2Execution time
VISGETNUM (a, b)ba = 0~5110Number1X Coordinate Value2Y Coordinate Value3unknown4Level5unknown6unknown7unknown8unknown9unknown
-
For this instruction, a µVision board (option) is required.
-
If the search range of a designated window is wide and the radius is small, the processing time increases and a timeout error may occur.
VISSCREEN 1,0,1
|
'Instantaneously draws on drawing screen 0.
|
VISCLS 0
|
|
WINDMAKE R,1,512,480,0,2
|
'Sets window 1 to rectangle.
|
CAMIN 1
|
'Obtains a camera image from the storage memory.
|
VISWORKPLN 0
|
'Designates an object to storage memory 0.
|
SHCIRCLE 1,0,0,30,128,1
|
'Searches for a black circle.
|
I1 = VISSTATUS(0)
|
|
VISLOC 10,10
|
|
VISPRINT I1
|
|
IF I1 = 0 THEN
|
|
I2 = VISSTATUS(1)
|
|
IF I2 <> 0 THEN
|
|
FOR I1 = 0 TO I2-1
|
|
VISCROSS VISGETNUM(I1,1), VISGETNUM(I1,2)
|
|
NEXT I1
|
|
END IF
|
|
END IF
|
|