mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 13:06:23 +00:00
templatematch: Produce a warning message if we can't load a template image
This commit is contained in:
parent
88cb33a1dc
commit
1b5483eef9
1 changed files with 8 additions and 2 deletions
|
@ -63,6 +63,7 @@
|
|||
|
||||
#include <gst/gst.h>
|
||||
|
||||
#include "../../gst-libs/gst/gst-i18n-plugin.h"
|
||||
#include "gstopencvutils.h"
|
||||
#include "gsttemplatematch.h"
|
||||
|
||||
|
@ -432,8 +433,13 @@ gst_template_match_load_template (GstTemplateMatch * filter, gchar * template)
|
|||
if (template) {
|
||||
newTemplateImage = cvLoadImage (template, CV_LOAD_IMAGE_COLOR);
|
||||
if (!newTemplateImage) {
|
||||
GST_WARNING ("Couldn't load template image: %s. error: %s",
|
||||
template, g_strerror (errno));
|
||||
/* Unfortunately OpenCV doesn't seem to provide any way of finding out
|
||||
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…
Reference in a new issue