Surveyor Robotics Journal
   



email: support@surveyor.com

Surveyor Corporation home page

Subscribe to a syndicated RSS feed.

Subscribe with Bloglines

Archives
November 2008
October 2008
September 2008
August 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
Februray 2006
January 2006

       
Wed, 29 Nov 2006

image processing extensions to BASIC now in SRV-1 firmware (112906 test version)

The following BASIC language functions have been added to the firmware as described below:
  • COMMENT - just to make code more readable
  • COLORCAP 0-15 - sets a color based on samples from a region
  • COLORSET 0-15 - allows program to set the colors
  • COLORGET 0-15 - retrieves the stored colors
  • SCAN 0-15 - looks for blockage based on a given color
  • BLOB 0-15 - looks for blob matching a given color
There's a lot of new capability, but all of this needs to be tested more completely. The Scan and Blob functions are somewhat simpler that the "vs" and "vb" functions in the SRV-1 command protocol, but they should be adequate to do some interesting things. I hope to post some code samples tomorrow demonstrating the "wander" mode and some simple soccerbot commands all coded in BASIC with this set of functions. In the mean time, if anyone has a chance to test this update to make certain we haven't broken any core functionality, that would be appreciated.

Here are the download links -

CommandResponseDescription
BASIC Commands
IMGCAPcapture image at 160x128 resolution (stored as 80x64 YUV)
COLORCAPcaptures colors from latest image in box bounded by x1 x2 y1 y2, and stores to designated color bin, e.g.
COLORCAP 0 20 40 1 5 captures to color bin #0 from x=20 to x=40, y=1 to y=5
COLORSETsets the colors in a color bin - format is somewhat different from the "vs" command, as data is Y, U, V, Y-range, U-range, V-range, rather than min/max values
COLORGETlists the colors in a specified color bin using same format at COLORSET. to view values, PRINT Y, U, V
to view ranges (for Y U V), PRINT R, S, T e.g.

COLORSET 0 128 89 95 15 10 10
COLORGET 0
PRINT Y, U, V
PRINT R, S, T

output will be
   128   89   95
   15   10   10
SCANsimilar to the "vs" Scan function above, but divides the image into 3 overlapping areas, saved into X = front left, Y = front, Z = front right. if a region is blocked, the value will be zero. if it's not blocked, the value will be positive, with a higher number indicating more open space in that region, e.g.

IMGCAP
SCAN 0
PRINT X,Y,Z

might output
   7   12   0
indicating that the right is blocked, but forward and left are both open
BLOBsimilar to the "vb" Blob function above, but only returns the largest blob matching the specified color, with results saved into X = centroid x coordinate, Y = centroid y coordinate, Z = blob width. e.g.

IMGCAP
BLOB 0
PRINT X,Y,Z

might output
   40   30   15
for a blob centered at (40,30) with a width of 15 pixels

a width of 0 would indicate that no matching blob was found

Posted Wed, 29 Nov 2006 18:35 | HTML Link | see additional stories ...