Discussion:
[linux-uvc-devel] Understanding brightness when capturing yuv
Lars O. Grobe
2014-09-20 20:06:54 UTC
Permalink
Dear all,

I have to admit that I am still new to image capturing. What I am trying
to do is to get sensor data from a simple webcam with as little
auto-"correction" done on the device as possible. The reason is that I
want to get close to a linear relation pixel-value / illuminance on ccd
pixel.

I am using an uvc-webcam from Logitech, and I can switch off
auto-exposure. However, when changing exposure, I get an unexpected
result. I have a scene where everything is dark except a light source,
which is directly visible to the camera. The bright pixels of the source
get darker with shorter exposure times. However, when these bright
pixels get darker, the "black" background becomes lighter. In the end,
all I get is a uniform grey.

I am suspecting the conceptness of brightness (which is said to be the
black-level in the v4l2 documentation) to be the culprit. Is it correct,
that this setting determines the amount of black in the output, so that
the average pixel values in the image do not fall below a given value?
That would explain my observation. If so, is there a way to switch it
off? I am already capturing yuv.

Thanks in advance for any help, cheers,

Lars.
Oleksij Rempel
2014-09-21 07:25:12 UTC
Permalink
Post by Lars O. Grobe
Dear all,
I have to admit that I am still new to image capturing. What I am trying
to do is to get sensor data from a simple webcam with as little
auto-"correction" done on the device as possible. The reason is that I
want to get close to a linear relation pixel-value / illuminance on ccd
pixel.
I am using an uvc-webcam from Logitech, and I can switch off
auto-exposure. However, when changing exposure, I get an unexpected
result. I have a scene where everything is dark except a light source,
which is directly visible to the camera. The bright pixels of the source
get darker with shorter exposure times. However, when these bright
pixels get darker, the "black" background becomes lighter. In the end,
all I get is a uniform grey.
I am suspecting the conceptness of brightness (which is said to be the
black-level in the v4l2 documentation) to be the culprit. Is it correct,
that this setting determines the amount of black in the output, so that
the average pixel values in the image do not fall below a given value?
That would explain my observation. If so, is there a way to switch it
off? I am already capturing yuv.
Thanks in advance for any help, cheers,
All you need is to disable complete image preprocessor and grab RAW
Bayer format directly from sensor. Some Logitech webcams can do it. I
don't remember if all needed patches are already upstream.
--
Regards,
Oleksij
Lars O. Grobe
2014-09-21 10:50:09 UTC
Permalink
Hi Oleksij,

thank you for the reply!
Post by Oleksij Rempel
All you need is to disable complete image preprocessor and grab RAW
Bayer format directly from sensor. Some Logitech webcams can do it. I
don't remember if all needed patches are already upstream.
Yes that would be perfect. However, I do not know how to achieve that. I
am currently using the v4l2 api to set properties and capture frames. I
could not find a documented way to access raw sensor data there. It must
be possible somehow, as I remember guvcview being able to output raw
pixel data before the Bayer processing.

Cheers, Lars.
Paulo Assis
2014-09-22 09:03:02 UTC
Permalink
Hi,
Post by Lars O. Grobe
Hi Oleksij,
thank you for the reply!
Post by Oleksij Rempel
All you need is to disable complete image preprocessor and grab RAW
Bayer format directly from sensor. Some Logitech webcams can do it. I
don't remember if all needed patches are already upstream.
Yes that would be perfect. However, I do not know how to achieve that. I
am currently using the v4l2 api to set properties and capture frames. I
could not find a documented way to access raw sensor data there. It must
be possible somehow, as I remember guvcview being able to output raw
pixel data before the Bayer processing.
this is side effect of logitech firmware, not every camera supports
it, even the same model may or may not have support for raw bayer,
depending on the firmware version.
In any case if your camera has suport for this, you can use guvcview
to enable it, just remember to set the camera format to yuyv, also you
must set the nodrop option for the uvcvideo driver, otherwise uvcvideo
will drop the bayer frames since it considers them malformed yuyv
frames.

Regards,
Paulo
Post by Lars O. Grobe
Cheers, Lars.
------------------------------------------------------------------------------
Slashdot TV. Video for Nerds. Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Linux-uvc-devel mailing list
https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
Loading...