![]() |
Using Send Frame Command
Hi,
I recently purchased the CMUcam2+ and I'm trying to send a frame to a PIC to do further image processing. I'm using the SF command to send it and when I do I'm receiving a whole bunch of garbage (ASCII characters). This doesn't surprise me because that's what the manual says it suppose to do. However what I'd like is to have the RGB data (i.e. a array of integers). Can I have the CMUcam2+ send the PIC this information? Or, do I need the PIC to decode the the ASCII characters and produce my array of ints? If so, I haven't got the foggiest idea of how to do so. Any help will be greatly appreciated. Thanks, Bill |
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. |
| All times are GMT -5. The time now is 01:35. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi