diff --git a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp index 79b9ea3f0..986c4f6d8 100644 --- a/modules/objdetect/include/opencv2/objdetect/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect/objdetect.hpp @@ -561,7 +561,7 @@ public: virtual void detect(InputArray image, InputArray rois, std::vector& objects) const; // Param rects is an output array of bounding rectangles for detected objects. // Param confs is an output array of confidence for detected objects. i-th bounding rectangle corresponds i-th configence. - CV_WRAP virtual void detect(InputArray image, InputArray rois, OutputArray rects, OutputArray confs) const; + CV_WRAP virtual void detect(InputArray image, InputArray rois, CV_OUT OutputArray rects, CV_OUT OutputArray confs) const; private: void detectNoRoi(const Mat& image, std::vector& objects) const; diff --git a/modules/objdetect/src/softcascade.cpp b/modules/objdetect/src/softcascade.cpp index 2a6ed8d6e..8ce247c93 100644 --- a/modules/objdetect/src/softcascade.cpp +++ b/modules/objdetect/src/softcascade.cpp @@ -525,7 +525,7 @@ void cv::SCascade::detect(cv::InputArray _image, cv::InputArray _rois, std::vect objects.clear(); - if (_rois.kind() == cv::_InputArray::NONE) + if (_rois.empty()) return detectNoRoi(image, objects); int shr = fld.shrinkage; @@ -577,7 +577,7 @@ void cv::SCascade::detect(InputArray _image, InputArray _rois, OutputArray _rec _confs.create(1, objects.size(), CV_32F); cv::Mat confs = _confs.getMat(); - float* confPtr = rects.ptr(0); + float* confPtr = confs.ptr(0); typedef std::vector::const_iterator IDet;