|
Re: Getting pixels of camera images in C++
The images are transmitted from the camera as a JPEG and you must decode it before you can actually do what you want to do. What you posted will not work. I don't think the Image class even has a "getWidth" or "getHeight". It does however have a pointer to the Image in memory, which is encoded in JPEG. I suggest making your own Image class that takes the WPILib's Image and converts it to a 2d arrays of bytes. Since it is C++, it would be uint_8 (GCC)
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
Last edited by davidthefat : 12-01-2012 at 20:09.
|