templatematch: Produce a warning message if we can't load a template image
This commit is contained in:
parent
88cb33a1dc
commit
1b5483eef9
@ -63,6 +63,7 @@
|
|||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#include "../../gst-libs/gst/gst-i18n-plugin.h"
|
||||||
#include "gstopencvutils.h"
|
#include "gstopencvutils.h"
|
||||||
#include "gsttemplatematch.h"
|
#include "gsttemplatematch.h"
|
||||||
|
|
||||||
@ -432,8 +433,13 @@ gst_template_match_load_template (GstTemplateMatch * filter, gchar * template)
|
|||||||
if (template) {
|
if (template) {
|
||||||
newTemplateImage = cvLoadImage (template, CV_LOAD_IMAGE_COLOR);
|
newTemplateImage = cvLoadImage (template, CV_LOAD_IMAGE_COLOR);
|
||||||
if (!newTemplateImage) {
|
if (!newTemplateImage) {
|
||||||
GST_WARNING ("Couldn't load template image: %s. error: %s",
|
/* Unfortunately OpenCV doesn't seem to provide any way of finding out
|
||||||
template, g_strerror (errno));
|
why the image load failed, so we can't be more specific than FAILED: */
|
||||||
|
GST_ELEMENT_WARNING (filter, RESOURCE, FAILED,
|
||||||
|
(_("OpenCV failed to load template image")),
|
||||||
|
("While attempting to load template '%s'", template));
|
||||||
|
g_free (template);
|
||||||
|
template = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user