View Single Post
  #2   Spotlight this post!  
Unread 20-03-2006, 12:32
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: Using Send Frame Command

The CMUCam sends RGB data as binary values, a series of bytes.
Look at the documentation for "F packets". However don't look too closely.
I have found several versions that are different, and none match what I see
the camera doing. (To be sure of what your camera is doing, dump the
first few bytes out with a printf, or dump it all to a file and use a hex viewer.)

This is what I found to work, the camera outputs:

- a byte of 0x01
- a byte with the x size (number of pixels in a row)
- a byte with the y size (number of rows)
- bytes of pixels data, 3 bytes per pixel,
--- a byte with the red value of this pixel
--- a byte with the green value of this pixel
--- a byte with the blue value of this pixel
The number of these bytes is xsize * ysize * 3
- a byte of 0x02
- a byte of 0x03

If you count bytes, you can ignore these last two, but they can help you
tell when you have dropped data. None of the pixel data bytes will be less
the 16. The older your computer, the more likely that the serial link will be unable to keep up at high baud rates, try running at a slower baud rate.
__________________
Don Reid