Commit 29a92c01 authored by Paul B Mahol's avatar Paul B Mahol

histogram filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent e5212354
......@@ -13,6 +13,7 @@ version <next>:
- allpass, bass, bandpass, bandreject, biquad, equalizer, highpass, lowpass
and treble audio filter
- improved showspectrum filter, with multichannel support and sox-like colors
- histogram filter
version 1.1:
......
......@@ -3098,6 +3098,89 @@ the histogram. Possible values are @code{none}, @code{weak} or
@code{strong}. It defaults to @code{none}.
@end table
@section histogram
Compute and draw a color distribution histogram for the input video.
The computed histogram is a representation of distribution of color components
in an image.
The filter accepts the following named parameters:
@table @option
@item mode
Set histogram mode.
It accepts the following values:
@table @samp
@item levels
standard histogram that display color components distribution in an image.
Displays color graph for each color component. Shows distribution
of the Y, U, V, A or G, B, R components, depending on input format,
in current frame. Bellow each graph is color component scale meter.
@item color
chroma values in vectorscope, if brighter more such chroma values are
distributed in an image.
Displays chroma values (U/V color placement) in two dimensional graph
(which is called a vectorscope). It can be used to read of the hue and
saturation of the current frame. At a same time it is a histogram.
The whiter a pixel in the vectorscope, the more pixels of the input frame
correspond to that pixel (that is the more pixels have this chroma value).
The V component is displayed on the horizontal (X) axis, with the leftmost
side being V = 0 and the rightmost side being V = 255.
The U component is displayed on the vertical (Y) axis, with the top
representing U = 0 and the bottom representing U = 255.
The position of a white pixel in the graph corresponds to the chroma value
of a pixel of the input clip. So the graph can be used to read of the
hue (color flavor) and the saturation (the dominance of the hue in the color).
As the hue of a color changes, it moves around the square. At the center of
the square, the saturation is zero, which means that the corresponding pixel
has no color. If you increase the amount of a specific color, while leaving
the other colors unchanged, the saturation increases, and you move towards
the edge of the square.
@item color2
chroma values in vectorscope, similar as @code{color} but actual chroma values
are displayed.
@item waveform
per row/column luminance graph. In row mode the left side represents luma = 0
and right side represents luma = 255. In column mode top side represends
luma = 0 and bottom side represents luma = 255.
@end table
Default value is @code{levels}.
@item level_height
Set height of level in @code{levels}. Default value is @code{200}.
Allowed range is [50, 2048].
@item scale_height
Set height of color scale in @code{levels}. Default value is @code{12}.
Allowed range is [0, 40].
@item step
Set step for @code{waveform} mode. Smaller values are useful to find out how much
of same luminance values across input rows/columns are distributed.
Default value is @code{10}. Allowed range is [1, 255].
@item waveform_mode
Set mode for @code{waveform}. Can be either @code{row}, or @code{column}.
Default is @code{row}.
@subsection Examples
@itemize
@item
Calculate and draw histogram:
@example
ffplay -i input -vf histogram
@end example
@end itemize
@section hqdn3d
High precision/quality 3d denoise filter. This filter aims to reduce
......
......@@ -122,6 +122,7 @@ OBJS-$(CONFIG_GEQ_FILTER) += vf_geq.o
OBJS-$(CONFIG_GRADFUN_FILTER) += vf_gradfun.o
OBJS-$(CONFIG_HFLIP_FILTER) += vf_hflip.o
OBJS-$(CONFIG_HISTEQ_FILTER) += vf_histeq.o
OBJS-$(CONFIG_HISTOGRAM_FILTER) += vf_histogram.o
OBJS-$(CONFIG_HQDN3D_FILTER) += vf_hqdn3d.o
OBJS-$(CONFIG_HUE_FILTER) += vf_hue.o
OBJS-$(CONFIG_IDET_FILTER) += vf_idet.o
......
......@@ -116,6 +116,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(GRADFUN, gradfun, vf);
REGISTER_FILTER(HFLIP, hflip, vf);
REGISTER_FILTER(HISTEQ, histeq, vf);
REGISTER_FILTER(HISTOGRAM, histogram, vf);
REGISTER_FILTER(HQDN3D, hqdn3d, vf);
REGISTER_FILTER(HUE, hue, vf);
REGISTER_FILTER(IDET, idet, vf);
......
......@@ -29,8 +29,8 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 35
#define LIBAVFILTER_VERSION_MICRO 101
#define LIBAVFILTER_VERSION_MINOR 36
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment