Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to force opencv 3.0 to read BA81 image using libv4l2 ?

image description(/upfiles/14759252821837422.png)

image description

v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index       : 0
Type        : Video Capture
Pixel Format: 'BA81'
Name        : 8-bit Bayer BGBG/GRGR

Index       : 1
Type        : Video Capture
Pixel Format: 'GREY'
Name        : 8-bit Greyscale

Index       : 2
Type        : Video Capture
Pixel Format: 'Y16 '
Name        : 16-bit Greyscale

My system is ubuntu 14.04, kernel 4.4.0-41-lowlatency. Because I read the new use of v4l2 lib in opencv 3.0 instead of v4l I update my old project from opencv 2.4.9 to opencv 3.0.0 (I test 3.1 too)... but if use v4l2 utils or fswebcam it is all ok my (bad camera only gain and abs_esposure is possible to change ... and grab in bayern format ...) grab perfect ... if use hello world opencv program (/opencv-3.0.0/samples/cpp/example_cmake) I have the same old issue that into 4.9 ... i solve it using some c function insert into my cpp code to manage and tranform the wrong image (demosaic bayer code...).

I think with opencv3.0 is really possible not use that piece of code and force v4l2 to make it work .... but in what file of videocapture is possible to make tha magic trik??

Regards Giorgio

[Solved] How to force opencv 3.0 to read BA81 image using libv4l2 ?

image description(/upfiles/14759252821837422.png)

image description

v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index       : 0
Type        : Video Capture
Pixel Format: 'BA81'
Name        : 8-bit Bayer BGBG/GRGR

Index       : 1
Type        : Video Capture
Pixel Format: 'GREY'
Name        : 8-bit Greyscale

Index       : 2
Type        : Video Capture
Pixel Format: 'Y16 '
Name        : 16-bit Greyscale

My system is ubuntu 14.04, kernel 4.4.0-41-lowlatency. Because I read the new use of v4l2 lib in opencv 3.0 instead of v4l I update my old project from opencv 2.4.9 to opencv 3.0.0 (I test 3.1 too)... but if use v4l2 utils or fswebcam it is all ok my (bad camera only gain and abs_esposure is possible to change ... and grab in bayern format ...) grab perfect ... if use hello world opencv program (/opencv-3.0.0/samples/cpp/example_cmake) I have the same old issue that into 4.9 ... i solve it using some c function insert into my cpp code to manage and tranform the wrong image (demosaic bayer code...).

I think with opencv3.0 is really possible not use that piece of code and force v4l2 to make it work .... but in what file of videocapture is possible to make tha magic trik??

Regards Giorgio