VISHIST
(Statement)

Obtain the histogram (brightness distribution) of the screen.

VISHIST <window number>, <coordinate X>, <coordinate Y>

<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).

-
Specifies the process area with a window.
-
If the designated window position is out of screen, the execution will result in an error.
-
The only possible window shape that you may designate is a rectangle with 0 degrees. If another window shape is designated, an error will result.
-
The processing object is the screen designated with VISWORKPLN.
-
It is possible to read the processing result with the VISREFHIST instruction.
-
The memory stores the processing result. It will be kept until this instruction is executed again.
-
For this instruction, a µVision board (option) is required.

WINDMAKE R,1,100,100,0,2
|
'Set window 1 to rectangle
|
CAMIN 1
|
'Obtain a camera image from the storage memory
|
VISWORKPLN 0
|
'Set the processing object screen for storage memory 0
|
VISHIST 1,100,100
|
'Execute the histogram for window 1 with the coordinates
'(100, 100) as the home position
|
FOR I1 = 0 TO 255
|
|
I2 = VISREFHIST(I1)
|
'Assign the distribution data of
'the brightness value I1 to I2
|
VISLOC 10, 10
|
'Set the display position
|
VISDEFCHAR 1,1,3
|
'Designate the display character size
'and the display mode
|
VISPRINT "Distribution data=";I2
|
|
NEXT I1
|
|