ESP32 motion
deflicker.c File Reference
#include "convolution.h"
#include "deflicker.h"
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>

Functions

float calc_brightness (uint8_t *img, int size)
 calculate brightness as the average pixel val More...
 
float get_factor ()
 calculate brightness ratio related to previous brightness More...
 
bool deflicker (uint8_t *img, int w, int h)
 perform deflickering More...
 

Detailed Description

Deflickering algorithm

Author
Thomas Pegot

Function Documentation

◆ calc_brightness()

float calc_brightness ( uint8_t img,
int  size 
)

calculate brightness as the average pixel val

Parameters
imgpointer to img
sizesize of the image
Returns
average (float)

◆ deflicker()

bool deflicker ( uint8_t img,
int  w,
int  h 
)

perform deflickering

Parameters
imguint8 pointer to image
wwidth
hheight
Returns
true if deflickering else return false (not enough image queued)

◆ get_factor()

float get_factor ( )

calculate brightness ratio related to previous brightness

Returns
ratio (float)