From 706f83ffd46b1c7ec552ac52b9d2bba2ddb6c6fd Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sun, 17 Jan 2016 14:16:19 -0500 Subject: [PATCH] Added ASSERT before detecting features to make sure that an image exist and is CV_8UC1 type --- src/FindObject.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FindObject.cpp b/src/FindObject.cpp index 962b501c..71c1c296 100644 --- a/src/FindObject.cpp +++ b/src/FindObject.cpp @@ -630,6 +630,9 @@ public: timeSubPix_(0) { UASSERT(detector && extractor); + UASSERT_MSG(!image.empty() && image.type() == CV_8UC1, + uFormat("Image of object %d is null or not type CV_8UC1!?!? (cols=%d, rows=%d, type=%d)", + objectId, image.cols, image.rows, image.type()).c_str()); } int objectId() const {return objectId_;} const cv::Mat & image() const {return image_;}