FFmpeg
|
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "avfilter.h"
#include "filters.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | ThreadData |
Used for passing data between threads. More... | |
struct | GrayWorldContext |
Functions | |
static void | apply_matrix (const float matrix[3][3], const float input[3], float output[3]) |
static void | rgb2lab (const float rgb[3], float lab[3]) |
Convert from Linear RGB to logspace LAB. More... | |
static void | lab2rgb (const float lab[3], float rgb[3]) |
Convert from Logspace LAB to Linear RGB. More... | |
static int | convert_frame (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
Convert a frame from linear RGB to logspace LAB, and accumulate channel totals for each row Convert from RGB -> lms using equation 4 in color transfer paper. More... | |
static void | compute_correction (GrayWorldContext *s, ThreadData *td) |
Sum the channel totals and compute the mean for each channel. More... | |
static int | correct_frame (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
Subtract the mean logspace AB values from each pixel. More... | |
static int | config_input (AVFilterLink *inlink) |
static av_cold void | uninit (AVFilterContext *ctx) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
Variables | |
static const float | lms2lab [3][3] |
static const float | lab2lms [3][3] |
static const float | rgb2lms [3][3] |
static const float | lms2rgb [3][3] |
static const AVFilterPad | grayworld_inputs [] |
const AVFilter | ff_vf_grayworld |
Color correction filter based on https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging
Definition in file vf_grayworld.c.
Definition at line 48 of file vf_grayworld.c.
Convert from Linear RGB to logspace LAB.
rgb | Input array of rgb components |
lab | output array of lab components |
Definition at line 85 of file vf_grayworld.c.
Referenced by convert_frame().
Convert from Logspace LAB to Linear RGB.
lab | input array of lab components |
rgb | output array of rgb components |
Definition at line 102 of file vf_grayworld.c.
Referenced by correct_frame().
|
static |
Convert a frame from linear RGB to logspace LAB, and accumulate channel totals for each row Convert from RGB -> lms using equation 4 in color transfer paper.
ctx | Filter context |
arg | Thread data pointer |
jobnr | job number |
nb_jobs | number of jobs |
Definition at line 122 of file vf_grayworld.c.
Referenced by filter_frame().
|
static |
Sum the channel totals and compute the mean for each channel.
s | Frame context |
td | thread data |
Definition at line 167 of file vf_grayworld.c.
Referenced by filter_frame().
|
static |
Subtract the mean logspace AB values from each pixel.
ctx | Filter context |
arg | Thread data pointer |
jobnr | job number |
nb_jobs | number of jobs |
Definition at line 190 of file vf_grayworld.c.
Referenced by filter_frame().
|
static |
Definition at line 227 of file vf_grayworld.c.
|
static |
Definition at line 240 of file vf_grayworld.c.
|
static |
Definition at line 249 of file vf_grayworld.c.
|
static |
Definition at line 55 of file vf_grayworld.c.
Referenced by rgb2lab().
|
static |
Definition at line 61 of file vf_grayworld.c.
Referenced by lab2rgb().
|
static |
Definition at line 67 of file vf_grayworld.c.
Referenced by rgb2lab().
|
static |
Definition at line 73 of file vf_grayworld.c.
Referenced by lab2rgb().
|
static |
Definition at line 291 of file vf_grayworld.c.
const AVFilter ff_vf_grayworld |
Definition at line 300 of file vf_grayworld.c.