CameraBoardAPI icon indicating copy to clipboard operation
CameraBoardAPI copied to clipboard

Get camera picture in colour

Open Nurgak opened this issue 10 years ago • 3 comments

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.

Nurgak avatar Apr 01 '14 22:04 Nurgak

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.

gplreis avatar May 05 '14 18:05 gplreis

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

Josh-Larson avatar Jun 22 '14 02:06 Josh-Larson

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.

Josh-Larson avatar Jun 22 '14 02:06 Josh-Larson