FFmpeg
Macros | Enumerations | Functions
edge_common.h File Reference
#include "avfilter.h"

Go to the source code of this file.

Macros

#define PROTO_SOBEL(depth)
 Simple sobel operator to get rounded gradients. More...
 
#define PROTO_GAUSSIAN_BLUR(depth)
 Applies gaussian blur. More...
 

Enumerations

enum  AVRoundedDirection { DIRECTION_45UP, DIRECTION_45DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL }
 Rounded directions used in av_image_sobel() More...
 

Functions

void ff_non_maximum_suppression (int w, int h, uint8_t *dst, int dst_linesize, const int8_t *dir, int dir_linesize, const uint16_t *src, int src_linesize)
 Filters rounded gradients to drop all non-maxima pixels in the magnitude image Expects gradients generated by av_image_sobel() Expects zero's in the destination buffer dst. More...
 
void ff_double_threshold (int low, int high, int w, int h, uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize)
 Filters all pixels in src to keep all pixels > high, and keep all pixels > low where all surrounding pixels > high. More...
 

Detailed Description

common functions for edge detection

Definition in file edge_common.h.

Macro Definition Documentation

◆ PROTO_SOBEL

#define PROTO_SOBEL (   depth)
Value:
void ff_sobel_##depth(int w, int h, \
uint16_t *dst, int dst_linesize, \
int8_t *dir, int dir_linesize, \
const uint8_t *src, int src_linesize, int src_stride);

Simple sobel operator to get rounded gradients.

Parameters
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to magnitude image
dst_linesizelinesizes for the magnitude image
dirdata pointers to direction image
dir_linesizelinesizes for the direction image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 51 of file edge_common.h.

◆ PROTO_GAUSSIAN_BLUR

#define PROTO_GAUSSIAN_BLUR (   depth)
Value:
void ff_gaussian_blur_##depth(int w, int h, \
uint8_t *dst, int dst_linesize, \
const uint8_t *src, int src_linesize, int src_stride);

Applies gaussian blur.

5x5 kernels, sigma = 1.4

Parameters
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to destination image
dst_linesizelinesizes for the destination image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 107 of file edge_common.h.

Enumeration Type Documentation

◆ AVRoundedDirection

Rounded directions used in av_image_sobel()

Enumerator
DIRECTION_45UP 
DIRECTION_45DOWN 
DIRECTION_HORIZONTAL 
DIRECTION_VERTICAL 

Definition at line 32 of file edge_common.h.

Function Documentation

◆ ff_non_maximum_suppression()

void ff_non_maximum_suppression ( int  w,
int  h,
uint8_t *  dst,
int  dst_linesize,
const int8_t *  dir,
int  dir_linesize,
const uint16_t *  src,
int  src_linesize 
)

Filters rounded gradients to drop all non-maxima pixels in the magnitude image Expects gradients generated by av_image_sobel() Expects zero's in the destination buffer dst.

Parameters
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to magnitude image
dst_linesizelinesizes for the magnitude image
dirdata pointers to direction image
dir_linesizelinesizes for the direction image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 60 of file edge_common.c.

Referenced by blurdetect_filter_frame(), and filter_frame().

◆ ff_double_threshold()

void ff_double_threshold ( int  low,
int  high,
int  w,
int  h,
uint8_t *  dst,
int  dst_linesize,
const uint8_t *  src,
int  src_linesize 
)

Filters all pixels in src to keep all pixels > high, and keep all pixels > low where all surrounding pixels > high.

Parameters
lowthe low threshold value
highthe hegh threshold value
wthe width of the image in pixels
hthe height of the image in pixels
dstdata pointers to destination image
dst_linesizelinesizes for the destination image
srcdata pointers to source image
src_linesizelinesizes for the source image

Definition at line 89 of file edge_common.c.

Referenced by blurdetect_filter_frame(), and filter_frame().

w
uint8_t w
Definition: llviddspenc.c:38
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
h
h
Definition: vp9dsp_template.c:2070
src
#define src
Definition: vp8dsp.c:248