what would 1 mean here ? (please use enum values, not magic numbers)
also, some things are unclear in your post:
opencv uses bgr pixel ordering, not rgb. you really wanted rgb order ?
cameras usually don’t send bgr images over the wire, more like yuv or jpg compressed ones, so there is already an internal conversion involved. did you want to shortcut that ?
IF you are using opencv’s dnn, i’d also suggest to leave the images as is
(in BGR), and use the swapRB param in blobFromImage , as you get the (internal) conversion basically for free (it’s just swapping a few channel pointers)
CAP_PROP_CONVERT_RGB controls whether conversion to OpenCV’s standard color order (BGR) is happening, or the image data is returned raw as is (which can be YUV, or jpeg-compressed data).
it’s already true by default because OpenCV always converts whatever pixel format to BGR (color)
you can’t use this to force RGB order color.
setting or unsetting that property will not help you. Ignore it.
is anyone even reading what I wrote in this thread?
console command: v4l2-ctl --list-formats
most Pixel Format: is 'YUYV'
cap.set(CV_CAP_PROP_MODE, CV_CAP_MODE_YUYV);
then send to opencv color convert
libv4l using c to convert color is slow
v4l2_ioctl
v4l2_dequeue_and_convert
v4lconvert_convert
v4lconvert_convert_pixfmt
https://github.com/philips/libv4l/blob/master/libv4lconvert/libv4lconvert.c
but opencv using this
inline void cvtYUV422toRGB(uchar * dst_data, size_t dst_step, const uchar * src_data, size_t src_step,
int width, int height)
{
YUV422toRGB8Invoker<bIdx, uIdx, yIdx, dcn> converter(dst_data, dst_step, src_data, src_step, width);
if (width * height >= MIN_SIZE_FOR_PARALLEL_YUV422_CONVERSION)
parallel_for_(Range(0, height), converter);
else
converter(Range(0, height));
}