CameraBoardAPI
CameraBoardAPI copied to clipboard
Get camera picture in colour
I'm terribly sorry for a probably extremely easy question, but how does one get colour pictures with this API?
In the FindContour example I've tried to naively replace UV_8U1
with UV_8U3
and to my surprise it compiled, but then it throws a segfault, so currently I'm stuck with grayscale images and I would like to detect specific colours.
I have the same question. I saw on code the default format to image in v4l capture is set to YUV420, but on OpenCV we need give to constructor from Mat a RBG ordened vector.
It has taken me forever to get to this, and it was not an easy question at all. I have spent a great deal of time researching this and trying to figure it out. Finally this file will help do that, you just create a char array with size [width_height_3] as the output and you can stick the RGB format into that array by calling the function like this: yuv420p_to_rgb24(width, height, yuv, rgb) http://goo.gl/0ALFJw
I am not in a great position to integrate it into the library, so if someone else can beat me to it I would be very appreciative.