Added ASSERT before detecting features to make sure that an image exist and is CV_8UC1 type

This commit is contained in:
matlabbe 2016-01-17 14:16:19 -05:00
parent 52387f27b3
commit 706f83ffd4

View File

@ -630,6 +630,9 @@ public:
timeSubPix_(0) timeSubPix_(0)
{ {
UASSERT(detector && extractor); 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_;} int objectId() const {return objectId_;}
const cv::Mat & image() const {return image_;} const cv::Mat & image() const {return image_;}