diff --git a/openbr/openbr.cpp b/openbr/openbr.cpp index 54b0404..067334b 100644 --- a/openbr/openbr.cpp +++ b/openbr/openbr.cpp @@ -341,6 +341,12 @@ int br_img_channels(br_template tmpl) return t->m().channels(); } +bool br_img_is_empty(br_template tmpl) +{ + Template *t = reinterpret_cast(tmpl); + return t->m().empty(); +} + void br_set_filename(br_template tmpl, const char *filename) { Template *t = reinterpret_cast(tmpl); diff --git a/openbr/openbr.h b/openbr/openbr.h index 46bcb87..64d5be4 100644 --- a/openbr/openbr.h +++ b/openbr/openbr.h @@ -467,6 +467,10 @@ BR_EXPORT int br_img_cols(br_template tmpl); */ BR_EXPORT int br_img_channels(br_template tmpl); /*! + * \brief Returns if the image is empty. + */ +BR_EXPORT bool br_img_is_empty(br_template tmpl); +/*! * \brief Set the filename for a template. */ BR_EXPORT void br_set_filename(br_template tmpl, const char *filename);