diff --git a/modules/gapi/include/opencv2/gapi/own/mat.hpp b/modules/gapi/include/opencv2/gapi/own/mat.hpp index 191eaa156245f3a1f2f3d6d45eca04323bbfbab5..964261bdf0770de972d75b9c8f9d8babd4ba976b 100644 --- a/modules/gapi/include/opencv2/gapi/own/mat.hpp +++ b/modules/gapi/include/opencv2/gapi/own/mat.hpp @@ -284,7 +284,10 @@ namespace cv { namespace gapi { namespace own { The method returns true if Mat::total() is 0 or if Mat::data is NULL. Because of pop_back() and resize() methods `M.total() == 0` does not imply that `M.data == NULL`. */ - bool empty() const; + bool empty() const + { + return data == 0 || total() == 0 || dims.empty(); + } /** @brief Returns the total number of array elements.