[PATCH 3/3] Add erode libopencv filter.
Stefano Sabatini
stefano.sabatini-lala
Sat Oct 2 17:06:46 CEST 2010
---
libavfilter/vf_libopencv.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index 4f787ad..f3c683c 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -257,6 +257,13 @@ static void dilate_end_frame_filter(AVFilterContext *ctx, IplImage *inimg, IplIm
cvDilate(inimg, outimg, dilate->kernel, dilate->iterations_nb);
}
+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->iterations_nb);
+}
+
typedef struct {
const char *name;
size_t priv_size;
@@ -268,6 +275,7 @@ typedef struct {
static OCVFilterEntry ocv_filter_entries[] = {
{ "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter },
{ "dilate", sizeof(DilateContext), dilate_init, NULL, dilate_end_frame_filter },
+ { "erode", sizeof(DilateContext), dilate_init, NULL, erode_end_frame_filter },
};
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
--
1.7.1
--eAbsdosE1cNLO4uF--
More information about the ffmpeg-devel
mailing list