BLOB
(Statement)
Execute labeling.
BLOB <window number>, <coordinate X>, <coordinate Y>, <processing object>, <binary lower limit>[, <binary upper limit>[, <link>[, <area lower limit> [, <sort>]]]]
<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).
<processing object>
Designates the object to obtain with labeling (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)
<binary lower limit>
Designates the lower limit for binarization (0 to 254 lower limit < upper limit).
<binary upper limit>
Designates the upper limit for binarization (1 to 255 lower limit < upper limit).
If ignored, 255 is set.
<link>
Designates the condition of the link (0 or 1).
0: Neighbor 4 link (Neighbor pixels at right and left, and top and bottom are checked.)
1: Neighbor 8 link (Neighbor pixels at slant, as well as right and left, and top and bottom are checked.)
<area lower limit>
Designates a lower limit of an area value to be ignored in labeling. (0 to 245760)
<sort>
Designates sorting of numbers obtained with labeling (0 to 2).
0: Obtained order
1: Area value descending
2: Area value ascending
Example of labeling
-
Designate the process range with a window.
-
If the designated window position is out of screen, the execution will result in an error.
-
The only window shape you are able to designate is a rectangle with 0 degrees. If another window shape is designated, an error will result.
-
The processing object is a screen designated with VISWORKPLN.
-
The following data can be obtained with the process result obtaining function.
-
If labeling does not finish within the specified time, a timeout error occurs.VISSTATUS (n)nItem0Execution result 0= Normal, -1= Abnormal1Number of labels2Execution time
VISGETNUM (a, b)ba = 0~ max5110Area1Center of gravity a coordinate X value2Center of gravity a coordinate Y value3unknown4Filet dia. reference point coordinate Y5Filet dia. reference point coordinate X6Filet dia. width7Filet dia. height8unknown9unknown
-
For this instruction, a µVision board (option) is required.
VISSCREEN 1,0,1
|
'Instantaneously draw on drawing screen 0
|
VISCLS 0
|
|
WINDMAKE R,1,512,480,0,2
|
'Set window 1 to rectangle
|
CAMIN 1
|
'Obtain a camera image to storage memory 0
|
VISPLNOUT 0
|
|
VISWORKPLN 0
|
'Designate the object to storage memory 0
|
BLOB 1,0,0,0,128
|
'Execute labeling
|
I1 = VISSTATUS(0)
|
|
IF I1 = 0 THEN
|
|
I2 = VISSTATUS(1)
|
|
VISDEFCHAR 1,1,2
|
|
VISLOC 10,10
|
|
VISPRINT I1,I2
|
|
IF I2 <> 0 THEN
|
|
FOR I1 = 0 TO I2 -1
|
|
VISLOC 10,11
|
|
VISPRINT VISGETNUM(I1,1), VISGETNUM(I1,2)
|
|
VISCROSS VISGETNUM(I1,1), VISGETNUM(I1,2)
|
|
NEXT I1
|
|
END IF
|
|
END IF
|
|
VISCAMOUT 1
|
|