VISMEASURE
(Statement)
Measure features in the window (area, center of gravity, main axis angle).
VISMEASURE <window number>, <coordinate X>, <coordinate Y>,
<processing object>, <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).
<processing object>
Specifies the object to measure (0 or 1).
0: Black (brightness value < binary lower limit, binary upper limit < brightness value)
1: White (binary lower limit ≤ brightness value ≤ binary upper limit)
<mode>
Specifies the feature to measure.
0: Accumulated brightness, area
1: Accumulated brightness, area, center of gravity (primary moment)
2: Accumulated brightness, area, center of gravity (primary moment), main axis angle (secondary moment)
-
The more the features are, the longer the time process takes.
-
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.
-
For this instruction, a µVision board (option) is required.
<binary lower limit>
Specifies the lower level for binarization (0 to 254 lower limit < upper limit).
<binary upper limit>
Specifies the upper level for binarization (1 to 255 lower limit < upper limit).
If this is ignored, 255 will be the default setting.
-
Specify the process area with a window. (Only the sector window cannot measure the main axis angle.)Mode: Available×: not available012Line (2-point designation)Windmake PLine (Length and angle)Windmake LCircleWindmake CEllipseWindmake ESectorWindmake S×RectangleWindmake R
-
If the designated window position is out of screen, the execution will result in an error.
-
The following data can be obtained with the processing result obtaining function.VISSTATUS (n)nItem0Execution result 0= Normal, -1= Abnormal1unknown2Execution time
VISGETNUM (a, b)ba = 00Area1Center of gravity coordinate X value2Center of gravity coordinate Y value3Main axis angle4Accumulated brightness5Primary moment X6Primary moment Y7Secondary moment X8Secondary moment Y9Secondary moment XY
-
For this instruction, a µVision board (option) is required.
VISSCREEN 0,0,1
|
'Instantaneously draw on storage memory 0
|
WINDMAKE R,1,512,480,0,2
|
'Set window 1 to rectangle
|
CAMIN 1
|
'Obtain a camera image from the storage memory
|
VISWORKPLN 0
|
'Designate the object from storage memory 0
|
VISPLNOUT 0
|
|
VISMEASURE 1,0,0,1,2,128
|
'Obtain the accumulated brightness, area,
'center of gravity and main axis angle
|
IF VISSTATUS(0) = 0.0 THEN
|
|
FOR I1 = 0 TO 9
|
|
VISLOC 0,I1
|
|
VISPRINT "Result";I1;"=";VISGETNUM(0,I1)
|
|
NEXT I1
|
|
END IF
|
|