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.

pull/13383/head
Leonid Beynenson 13 years ago
parent c6571249a8
commit a97c2c838c
  1. 7
      modules/features2d/src/orb.cpp

@ -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];

Loading…
Cancel
Save