Motion - Feature Request 2006x 04x 19x 082734

Feature Request: Improvement to hardware autobrightness


The present autobrightness function (in v4l_picture_controls) merely changes the device brightness to ensure that the average pixel brightness lies within a certain range. Better results can be obtained if both brightness and contrast are altered.

I have prototype code built on motion 3.1.16 under freebsd 4.9 running a cheap cctv connected to an old wintv card, which incrementally adjusts the brightness to set the black level, and the contrast to set the white level, ensuring the picture takes up most of the available output range. This is done by defining a range of values at each brightness extreme and adjusting the controls so that the number of pixels within each such zone falls within defined ranges. This allows improved picture quality over a fairly wide range of scene illumination, and allows the user latitude in choosing whether highlights are overexposed or dark parts underexposed, either of which may give improved quality for the rest of the image.

If this is thought an appropriate change, I'll provide the prototype code segment.

-- MikeScott - 19 Apr 2006

Follow up

Sounds very interesting.

If you decide to work on this there are a few things to consider.

  • Make a Patch topic for your patch. There is a form at the bottom of MotionPatches.
  • Read KennethsNerdoMeter. It is a fun way to remind us all that with a little care a feature can be made simple on the surface and complex below the surface enabling users to understand what the feature is about.
  • MotionCodingStandard makes your code more readable and creates less work for me to maintain.
  • MotionDailySourceSnap contains the latest source code automatically built from SVN very night.
  • Even better use a checkout from SVN. See MotionSubversion. That makes making patches extremely easy.


Thanks for the info. I'll install svn and see if I can get to grips with it. However, it'll take a while before I can look at the newer motion code - my current edit has hard-wired constants, which would need adding to the config file stuff for any production version, and I think the video routines have changed rather since 3.1.

-- MikeScott - 25 Apr 2006

FeatureRequestForm edit

TopicTitle Improvement to hardware autobrightness
FeatureRequestStatus Discussion
SubmittedBy Mike Scott
Topic revision: r3 - 25 Apr 2006, MikeScott
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.