Originally committed as revision 26097 to svn://svn.ffmpeg.org/ffmpeg/trunk
Follows the list of supported libopencv filters.
Follows the list of supported libopencv filters.
@subsection dilate
Dilate an image by using a specific structuring element.
@subsection dilate
Dilate an image by using a specific structuring element.
ocv=0x0+2x2/custom=diamond.shape:2
@end example
ocv=0x0+2x2/custom=diamond.shape:2
@end example
+@subsection erode
+
+Erode an image by using a specific structuring element.
+This filter corresponds to the libopencv function @code{cvErode}.
+
+The filter accepts the parameters: @var{struct_el}:@var{nb_iterations},
+with the same meaning and use of those of the dilate filter
+(@pxref{dilate}).
+
@subsection smooth
Smooth the input video.
@subsection smooth
Smooth the input video.
#define LIBAVFILTER_VERSION_MAJOR 1
#define LIBAVFILTER_VERSION_MINOR 70
#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, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
cvDilate(inimg, outimg, dilate->kernel, dilate->nb_iterations);
}
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;
typedef struct {
const char *name;
size_t priv_size;
static OCVFilterEntry ocv_filter_entries[] = {
{ "dilate", sizeof(DilateContext), dilate_init, dilate_uninit, dilate_end_frame_filter },
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 },
};
{ "smooth", sizeof(SmoothContext), smooth_init, NULL, smooth_end_frame_filter },
};