meh / dux

DUX MEA LUX
GNU General Public License v3.0
88 stars 2 forks source link

Ambient light based adaptive brightness mode? #1

Open Celti opened 8 years ago

Celti commented 8 years ago

It'd be nice to have a mode to adjust the brightness based on a light sensor (which some devices have) or webcam (which many devices have), a la yawls or calise.

meh commented 8 years ago

I was thinking about it, the problem is I don't have a webcam nor a light sensors :panda_face:

meh commented 8 years ago

Actually I think I do have a light sensor, looking into it.

Celti commented 8 years ago

Well, I do have a webcam in my laptop (and technically also a light sensor on my phone, though I don't have a setup to cross-compile Rust for Android) — I just have too many projects on a very small plate right now. If you start a framework for the feature, though, I will happily bug-test and contribute to getting it working!

nxnfufunezn commented 8 years ago

Brightness adjustment based on webcam input would be a great addition.

meh commented 8 years ago

Yeah, I'm definitely going to add the webcam one.

I did some research and interacting with the light sensors seems to be hell on earth with inconsistent sysfs interfaces between different drivers, so I'll scrap that for now.

But webcam is coming!

brandonedens commented 8 years ago

I have an ALS accessible via /sys/bus/iio and already wrote software to read the sensor value and adjust the backlight via /sys but will now go and try to add that implementation to dux.

Excellent work btw. Brandon

On Aug 12, 2016 5:18 PM, "meh." notifications@github.com wrote:

Yeah, I'm definitely going to add the webcam one.

I did some research and interacting with the light sensors seems to be hell on earth with inconsistent sysfs interfaces between different drivers, so I'll scrap that for now.

But webcam is coming!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/meh/dux/issues/1#issuecomment-239588693, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYMoVLrKVvezTLeW4BozzPSA6RsPpKJks5qfQ1kgaJpZM4Jf6h0 .

meh commented 8 years ago

@brandonedens nice, if you have any questions about the code don't hesitate to ask.

Celti commented 7 years ago

So I had a bit of free time and sanity to revisit this, and found the rscam crate. It looks like it should be pretty easy to just grab a single camera frame and run the same code that dux already has to extract luminance and adapt the brightness — which means I'm probably missing some horrible blocker on this one.

meh commented 7 years ago

@Celti I think the algorithm used would be different to have decent enough results.

Celti commented 7 years ago

I wrote this whole big response to that and then I realised I'm an idiot when an actual thought came into my brain: Why not let the camera do the work? Each camera knows best what exactly its capturing in terms of light, after all — and I don't think I've seen a webcam made in the past fifteen years that didn't support capturing in YUV format. The Y channel being luminance data, can we just extract and average that?

meh commented 7 years ago

@Celti my doubt is mostly whether or not averaging the luminance of what the camera is seeing would map correctly or well to the luminance the person perceives around them.

marsjaninzmarsa commented 7 years ago

Any progress?