Add brightness temporal smoothing to reduce oscillation from moving objects

- Added brightness-smoothing parameter (0-1, default 0.1)
- Implements exponential moving average to filter transient brightness changes
- Samples brightness every frame but smooths before adjusting exposure
- Reduces oscillation from people/cars/birds moving through scene
- Updated DEBUG.md with complete implementation details

Recommended settings for dawn/dusk time-lapse:
  ramp-rate=vslow update-interval=1000 brightness-smoothing=0.1
This commit is contained in:
yair
2025-11-17 13:57:55 +02:00
parent 9330477e16
commit 2281d8a5ac
3 changed files with 139 additions and 3 deletions

View File

@@ -74,6 +74,7 @@ struct _GstIntervalometer
gchar *log_file; /* CSV log file path */
gchar *camera_element_name; /* Name of upstream idsueyesrc element */
guint update_interval; /* Update interval in milliseconds */
gdouble brightness_smoothing; /* Brightness smoothing factor (0-1, 0=no smoothing) */
/* Internal state */
GstElement *camera_src; /* Reference to upstream camera element */
@@ -94,6 +95,10 @@ struct _GstIntervalometer
GstVideoInfo video_info;
gboolean video_info_valid;
/* Brightness smoothing */
gdouble smoothed_brightness; /* Exponentially smoothed brightness value */
gboolean brightness_initialized; /* Whether smoothed_brightness has been initialized */
/* Ramping parameters */
gdouble ramp_step; /* Current ramping step size */
};