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 available
    0
    1
    2
    Line (2-point designation)
    Windmake P
    Line (Length and angle)
    Windmake L
    Circle
    Windmake C
    Ellipse
    Windmake E
    Sector
    Windmake S
    ×
    Rectangle
    Windmake 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)
    n
    Item
    0
    Execution result 0= Normal, -1= Abnormal
    1
    unknown
    2
    Execution time

    VISGETNUM (a, b)
    b
    a = 0
    0
    Area
    1
    Center of gravity coordinate X value
    2
    Center of gravity coordinate Y value
    3
    Main axis angle
    4
    Accumulated brightness
    5
    Primary moment X
    6
    Primary moment Y
    7
    Secondary moment X
    8
    Secondary moment Y
    9
    Secondary 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


Top