Fixed error in case corners not found

This commit is contained in:
Alexander Karsakov 2014-04-02 17:10:10 +04:00
parent 2aab7b2926
commit 2cf3a6e26c

View File

@ -164,6 +164,12 @@ static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners,
return false;
total = std::min<size_t>(counter.getMat(ACCESS_READ).at<int>(0, 0), possibleCornersCount);
if (total == 0)
{
_corners.release();
return true;
}
tmpCorners.resize(total);
Mat mcorners(1, (int)total, CV_32FC2, &tmpCorners[0]);