Closed patri9ck closed 2 years ago
Hi! This is what SCREEN module is for: it compensates for screen-emitted brightness; it is highly simple but should work fine, at least it tries :)
Anyway, the suggestion is good! I can add a camera sensor specific parameter to let users specify the area used to compute ambient backlight, eg: something like: x: 0.4-0.6,y: 0.2,0.3
to only use X between 40% and 60% of image length, and Y between 20% and 30% (starting from top left), or something like that.
Thanks for your input!
Thank you! I will take a look at the module.
Is SCREEN module working fine?
It's kinda working but it's to be honest not that satisfying.
I will try to add the new feature in the next clightd release cycle!
Move to Clightd.
Latest master should have cropping in place; it is a new sensor settings that can be used like this:
busctl call org.clightd.clightd /org/clightd/clightd/Sensor org.clightd.clightd.Sensor Capture "sis" "" 5 "x=0.4-0.6"
busctl call org.clightd.clightd /org/clightd/clightd/Sensor org.clightd.clightd.Sensor Capture "sis" "" 5 "x=0.4-0.6,y=0.4-0.6"
In the first case, all image height will be considered, but only central columns will be used (columns from 40% of image width to 60%). In the second case Clightd will use central 30% of image (ie: rows from 40% of image height to 60% and columns from 40% of image width to 60%).
Clightd tries to use v4l2 APIs where supported (both "new" selection API and "old" crop API, see https://www.kernel.org/doc/html/v4.14/media/uapi/v4l/crop.html and https://www.kernel.org/doc/html/v4.12/media/uapi/v4l/vidioc-g-selection.html). Unfortunately i could not test because none of my webcams supported them. In these cases, Clightd fallbacks at manually skipping pixels.
I forgot to mention that (0,0) origin value is top left corner.
The feature is now implemented in master since a couple of months; no feedback provided. Closing for now! Please, feel free to reopen this!
Ps: wiki was updated too: https://github.com/FedeDP/Clightd/wiki/Sensors#camera-1
When the lights on my room are turned off and I open a window with dark colors (like my terminal, which has a grey background), my monitor does not light up my room as much as when I open a window with bright colors (like Google Chrome, when I am on a website with a white background). Therefore Clight detects a brightness of 0.1 when I open up my terminal and a brightness of 0.9 when I open Google Chrome on a website with a white background.
One solution could be that the user is able to specify a certain area on the camera which Clight should use to calibrate all the things. For example only a few pixels on the upper right corner which are not affected by the monitor.