<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Pixel-Operation > ANA.GetPixelColor_5V |
MiniRobotLanguage (MRL)
ANA.GetPixelColor_5V
Get the Color of 5 successive vertical Pixels from an Image-Register (IR)
Intention
This command will read the color of 5 successive vertical Pixels in an IR. Its an Option to Speed up Image-Processing.
With this command, the returned value is the 24-bit color of the Pixels.
You do not need to worry, if the resolution is not a multiple of 5, illegal Coordinates will just be ignored.
Due to the use of a nested Loop going "Line by Line" through all Pixels, it is recommended to start the script in the Editor using "Freerun Mode".
Free-Run Button
You will not see the Robot Painting unless the Show command is been called which leads to an Update in the Show-Window.
' This code will invert the left half of a Picture.
'
VAF.$$PIA=?exeloc\Pics\Sarah_HS.png
NEF.$$PIA
MBX.File not found.
EIF.
VAN.$$BMA=0
ANA.Load|$$BMA|$$PIA
ANA.GetRes|$$BMA|$$XRA|$$YRA
ANA.Show|$$BMA!
FOR.$$YPO|0|$$YRA|5
PRT.Line: $$YPO/$$YRA
FOR.$$XPO|0|($$XRA/2)
' Bild mit Kanten
ANA.GetPixelColor_5V|$$BMA|$$XPO|$$YPO|$$COA|$$COB|$$COC|$$COD|$$COE
CAL.$$COA=&HFFFFFF-$$COA
CAL.$$COB=&HFFFFFF-$$COB
CAL.$$COC=&HFFFFFF-$$COC
CAL.$$COD=&HFFFFFF-$$COD
CAL.$$COE=&HFFFFFF-$$COE
ANA.SetPixelColor|$$BMA|$$XPO|$$YPO|$$COA
ANA.SetPixelColor|$$BMA|$$XPO|($$YPO+1)|$$COB
ANA.SetPixelColor|$$BMA|$$XPO|($$YPO+2)|$$COC
ANA.SetPixelColor|$$BMA|$$XPO|($$YPO+3)|$$COD
ANA.SetPixelColor|$$BMA|$$XPO|($$YPO+4)|$$COE
NEX.
NEX.
VAN.$$TMC=#dsince#
DBP.$$TMC used
ANA.Show|$$BMA!
ENR.
The Script used 6 Seconds to complete process the picture.
Here is the Speed-Dump:
Syntax
ANA.GetPixelColor_5V|P1|P2|P3|P4|P5|P6|P7|P8
Parameter Explanation
P1 - Source Image-Register number
P2 - X1 - Upper Left Coordinat X-Value
P3 - Y1 - Upper Left Coordinat Y-Value
P4 - Variable for returned Color-Value of Pixel 1 at (X1,Y1)
P5 - Variable for returned Color-Value of Pixel 2 at (X1,Y1+1)
P6 - Variable for returned Color-Value of Pixel 3 at (X1,Y1+2)
P7 - Variable for returned Color-Value of Pixel 4 at (X1,Y1+3)
P8 - Variable for returned Color-Value of Pixel 5 at (X1,Y1+4)
Example
See above.
Remarks
The ANA.GetPixelColor_5V is optimized for Speed. It will use only about 580 Ticks. Therefore the Robot could read more then 27500*5 Pixels per Second.
Limitations:
-
See also: