From 17fc94933b050c7b0917ee5a347b14d7b6f87580 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 26 Dec 2010 11:27:09 +0000 Subject: Add erode libopencv filter. Originally committed as revision 26097 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavfilter/avfilter.h | 2 +- libavfilter/vf_libopencv.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libavfilter') diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 177e1ab29a..6d5d8787c7 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -28,7 +28,7 @@ #define LIBAVFILTER_VERSION_MAJOR 1 #define LIBAVFILTER_VERSION_MINOR 70 -#define LIBAVFILTER_VERSION_MICRO 1 +#define LIBAVFILTER_VERSION_MICRO 2 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index 497d4cab85..8401b4dcb7 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -291,6 +291,13 @@ static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIm cvDilate(inimg, outimg, dilate->kernel, dilate->nb_iterations); } +static void erode_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplImage *outimg) +{ + OCVContext *ocv = ctx->priv; + DilateContext *dilate = ocv->priv; + cvErode(inimg, outimg, dilate->kernel, dilate->nb_iterations); +} + typedef struct { const char *name; size_t priv_size; @@ -301,6 +308,7 @@ typedef struct { static OCVFilterEntry ocv_filter_entries[] = { { "dilate", sizeof(DilateContext), dilate_init, dilate_uninit, dilate_end_frame_filter }, + { "erode", sizeof(DilateContext), dilate_init, dilate_uninit, erode_end_frame_filter }, { "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter }, }; -- cgit v1.2.3