Made small change which fixes the situation, when ORB does not find any descriptors on an image. Earlier ORB::operator() crashed in this case, since rowRange method was called for an empty matrix.

This commit is contained in:
Leonid Beynenson 2012-03-23 12:06:49 +00:00
parent c6571249a8
commit a97c2c838c

View File

@ -932,7 +932,12 @@ void ORB::operator()( InputArray _image, InputArray _mask, vector<KeyPoint>& _ke
// Compute the descriptors
if (do_descriptors)
{
Mat desc = descriptors.rowRange(offset, offset + nkeypoints);
Mat desc;
if (!descriptors.empty())
{
desc = descriptors.rowRange(offset, offset + nkeypoints);
}
offset += nkeypoints;
// preprocess the resized image
Mat& workingMat = imagePyramid[level];