opencv: Refactor files structure

Remove internal folders and put all code inside the main plugin
folder. Also fixes some building warnings.
This commit is contained in:
Thiago Santos 2010-09-08 14:59:54 -03:00
parent cf86df2d00
commit 27fedbb352
35 changed files with 85 additions and 203 deletions

View File

@ -1,45 +1,45 @@
SUBDIRS = basicfilters edgedetect faceblur facedetect pyramidsegment templatematch textwrite
# plugindir is set in configure
plugin_LTLIBRARIES = libgstopencv.la
# sources used to compile this plug-in
libgstopencv_la_SOURCES = gstopencv.c gstopencvvideofilter.c gstopencvutils.c
libgstopencv_la_SOURCES = gstopencv.c \
gstopencvvideofilter.c \
gstopencvutils.c \
gstcvdilate.c \
gstcvdilateerode.c \
gstcvequalizehist.c \
gstcverode.c \
gstcvlaplace.c \
gstcvsmooth.c \
gstcvsobel.c \
gstedgedetect.c \
gstfaceblur.c \
gstfacedetect.c \
gstpyramidsegment.c \
gsttemplatematch.c \
gsttextwrite.c
# flags used to compile this facedetect
# add other _CFLAGS and _LIBS as needed
libgstopencv_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(OPENCV_CFLAGS) \
$(GSTPB_BASE_CFLAGS) \
-I${top_srcdir}/ext \
-I${top_srcdir}/ext/opencv/basicfilters \
-I${top_srcdir}/ext/opencv/edgedetect \
-I${top_srcdir}/ext/opencv/faceblur \
-I${top_srcdir}/ext/opencv/facedetect \
-I${top_srcdir}/ext/opencv/pyramidsegment \
-I${top_srcdir}/ext/opencv/templatematch \
-I${top_srcdir}/ext/opencv/textwrite
$(GST_PLUGINS_BASE_CFLAGS)
libgstopencv_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(OPENCV_LIBS) \
$(GSTPB_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \
$(top_builddir)/ext/opencv/basicfilters/libgstbasicfilters.la \
$(top_builddir)/ext/opencv/edgedetect/libgstedgedetect.la \
$(top_builddir)/ext/opencv/faceblur/libgstfaceblur.la \
$(top_builddir)/ext/opencv/facedetect/libgstfacedetect.la \
$(top_builddir)/ext/opencv/pyramidsegment/libgstpyramidsegment.la \
$(top_builddir)/ext/opencv/templatematch/libgsttemplatematch.la \
$(top_builddir)/ext/opencv/textwrite/libgsttextwrite.la
$(GSTPB_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR)
libgstopencv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstopencv_la_DEPENDENCIES = \
$(top_builddir)/ext/opencv/basicfilters/libgstbasicfilters.la \
$(top_builddir)/ext/opencv/edgedetect/libgstedgedetect.la \
$(top_builddir)/ext/opencv/faceblur/libgstfaceblur.la \
$(top_builddir)/ext/opencv/facedetect/libgstfacedetect.la \
$(top_builddir)/ext/opencv/pyramidsegment/libgstpyramidsegment.la \
$(top_builddir)/ext/opencv/templatematch/libgsttemplatematch.la \
$(top_builddir)/ext/opencv/textwrite/libgsttextwrite.la
# headers we need but don't want installed
noinst_HEADERS = gstopencvvideofilter.h gstopencvutils.h
noinst_HEADERS = gstopencvvideofilter.h gstopencvutils.h \
gstcvdilateerode.h \
gstcvdilate.h \
gstcvequalizehist.h \
gstcverode.h \
gstcvlaplace.h \
gstcvsmooth.h \
gstcvsobel.h \
gstedgedetect.h \
gstfaceblur.h \
gstfacedetect.h \
gstpyramidsegment.h \
gsttemplatematch.h \
gsttextwrite.h

View File

@ -1,28 +0,0 @@
noinst_LTLIBRARIES = libgstbasicfilters.la
# sources used to compile this plug-in
libgstbasicfilters_la_SOURCES = gstcvsmooth.c \
gstcvdilateerode.c \
gstcvdilate.c \
gstcvequalizehist.c \
gstcvlaplace.c \
gstcverode.c \
gstcvsobel.c
# flags used to compile this pyramidsegment
# add other _CFLAGS and _LIBS as needed
libgstbasicfilters_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS) -I.. \
$(GST_BASE_CFLAGS) $(GSTPB_BASE_CFLAGS)
libgstbasicfilters_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS) \
$(GST_BASE_LIBS) $(GSTPB_BASE_LIBS) \
-lgstvideo-$(GST_MAJORMINOR)
libgstbasicfilters_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstcvsmooth.h \
gstcvdilateerode.h \
gstcvdilate.h \
gstcvequalizehist.h \
gstcverode.h \
gstcvlaplace.h \
gstcvsobel.h

View File

@ -1,15 +0,0 @@
# plugindir is set in configure
noinst_LTLIBRARIES = libgstedgedetect.la
# sources used to compile this plug-in
libgstedgedetect_la_SOURCES = gstedgedetect.c
# flags used to compile this edgedetect
# add other _CFLAGS and _LIBS as needed
libgstedgedetect_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgstedgedetect_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS)
libgstedgedetect_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstedgedetect.h

View File

@ -1,15 +0,0 @@
# plugindir is set in configure
noinst_LTLIBRARIES = libgstfaceblur.la
# sources used to compile this plug-in
libgstfaceblur_la_SOURCES = gstfaceblur.c
# flags used to compile this faceblur
# add other _CFLAGS and _LIBS as needed
libgstfaceblur_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgstfaceblur_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS)
libgstfaceblur_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstfaceblur.h

View File

@ -1,17 +0,0 @@
# plugindir is set in configure
noinst_LTLIBRARIES = libgstfacedetect.la
# sources used to compile this plug-in
libgstfacedetect_la_SOURCES = gstfacedetect.c
# flags used to compile this facedetect
# add other _CFLAGS and _LIBS as needed
libgstfacedetect_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS) \
$(GSTPB_BASE_CFLAGS) -I..
libgstfacedetect_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS) $(GSTPB_BASE_LIBS) \
-lgstvideo-$(GST_MAJORMINOR)
libgstfacedetect_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstfacedetect.h

View File

@ -119,8 +119,7 @@ gst_cv_dilate_erode_get_type (void)
};
_type = g_type_register_static (GST_TYPE_OPENCV_VIDEO_FILTER,
"GstCvDilateErode", &opencv_dilate_erode_info,
G_TYPE_FLAG_ABSTRACT);
"GstCvDilateErode", &opencv_dilate_erode_info, G_TYPE_FLAG_ABSTRACT);
/*
GST_DEBUG_CATEGORY_INIT (gst_cv_dilate_erode_debug, "cvdilateerode", 0,
"cvdilateerode");

View File

@ -65,9 +65,9 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_BOILERPLATE (GstCvEqualizeHist, gst_cv_equalize_hist,
GstOpencvVideoFilter, GST_TYPE_OPENCV_VIDEO_FILTER);
static GstFlowReturn gst_cv_equalize_hist_transform (
GstOpencvVideoFilter * filter, GstBuffer * buf, IplImage * img,
GstBuffer * outbuf, IplImage * outimg);
static GstFlowReturn gst_cv_equalize_hist_transform (GstOpencvVideoFilter *
filter, GstBuffer * buf, IplImage * img, GstBuffer * outbuf,
IplImage * outimg);
/* Clean up */
static void

View File

@ -21,7 +21,7 @@
#include "gstopencvutils.h"
gboolean
static gboolean
gst_opencv_get_ipl_depth_and_channels (GstStructure * structure,
gint * ipldepth, gint * channels, GError ** err)
{

View File

@ -329,18 +329,20 @@ gst_templatematch_chain (GstPad * pad, GstBuffer * buf)
}
}
if (filter->cvTemplateImage) {
GstStructure *s;
GstMessage *m;
gst_templatematch_match (filter->cvImage, filter->cvTemplateImage,
filter->cvDistImage, &best_res, &best_pos, filter->method);
GstStructure *s = gst_structure_new ("template_match",
s = gst_structure_new ("template_match",
"x", G_TYPE_UINT, best_pos.x,
"y", G_TYPE_UINT, best_pos.y,
"width", G_TYPE_UINT, filter->cvTemplateImage->width,
"height", G_TYPE_UINT, filter->cvTemplateImage->height,
"result", G_TYPE_DOUBLE, best_res,
NULL);
"result", G_TYPE_DOUBLE, best_res, NULL);
GstMessage *m = gst_message_new_element (GST_OBJECT (filter), s);
m = gst_message_new_element (GST_OBJECT (filter), s);
gst_element_post_message (GST_ELEMENT (filter), m);
if (filter->display) {

View File

@ -150,8 +150,7 @@ gst_textwrite_base_init (gpointer gclass)
gst_element_class_set_details_simple (element_class,
"textwrite",
"Filter/Effect/Video",
"Performs text writing to the video",
"sreerenj<bsreerenj@gmail.com>");
"Performs text writing to the video", "sreerenj<bsreerenj@gmail.com>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory));
@ -231,8 +230,7 @@ gst_textwrite_class_init (GsttextwriteClass * klass)
* initialize instance structure
*/
static void
gst_textwrite_init (Gsttextwrite * filter,
GsttextwriteClass * gclass)
gst_textwrite_init (Gsttextwrite * filter, GsttextwriteClass * gclass)
{
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
gst_pad_set_setcaps_function (filter->sinkpad,
@ -382,10 +380,13 @@ gst_textwrite_chain (GstPad * pad, GstBuffer * buf)
filter->cvImage->imageData = (char *) GST_BUFFER_DATA (buf);
cvInitFont(&(filter->font),CV_FONT_VECTOR0, filter->width,filter->height,0,filter->thickness,0);
cvInitFont (&(filter->font), CV_FONT_VECTOR0, filter->width, filter->height,
0, filter->thickness, 0);
buf = gst_buffer_make_writable (buf);
cvPutText (filter->cvImage,filter->textbuf,cvPoint(filter->xpos,filter->ypos), &(filter->font), cvScalar(filter->colorR,filter->colorG,filter->colorB,0));
cvPutText (filter->cvImage, filter->textbuf, cvPoint (filter->xpos,
filter->ypos), &(filter->font), cvScalar (filter->colorR,
filter->colorG, filter->colorB, 0));
return gst_pad_push (filter->srcpad, buf);
}
@ -408,5 +409,3 @@ gst_textwrite_plugin_init (GstPlugin * plugin)
return gst_element_register (plugin, "textwrite", GST_RANK_NONE,
GST_TYPE_textwrite);
}

View File

@ -1,13 +0,0 @@
noinst_LTLIBRARIES = libgstpyramidsegment.la
# sources used to compile this plug-in
libgstpyramidsegment_la_SOURCES = gstpyramidsegment.c
# flags used to compile this pyramidsegment
# add other _CFLAGS and _LIBS as needed
libgstpyramidsegment_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgstpyramidsegment_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS)
libgstpyramidsegment_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gstpyramidsegment.h

View File

@ -1,15 +0,0 @@
# plugindir is set in configure
noinst_LTLIBRARIES = libgsttemplatematch.la
# sources used to compile this plug-in
libgsttemplatematch_la_SOURCES = gsttemplatematch.c
# flags used to compile this templatematch
# add other _CFLAGS and _LIBS as needed
libgsttemplatematch_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgsttemplatematch_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS)
libgsttemplatematch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gsttemplatematch.h

View File

@ -1,15 +0,0 @@
# plugindir is set in configure
noinst_LTLIBRARIES = libgsttextwrite.la
# sources used to compile this plug-in
libgsttextwrite_la_SOURCES = gsttextwrite.c
# flags used to compile this textwrite
# add other _CFLAGS and _LIBS as needed
libgsttextwrite_la_CFLAGS = $(GST_CFLAGS) $(OPENCV_CFLAGS)
libgsttextwrite_la_LIBADD = $(GST_LIBS) $(OPENCV_LIBS)
libgsttextwrite_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
# headers we need but don't want installed
noinst_HEADERS = gsttextwrite.h