mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
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:
parent
c6571249a8
commit
a97c2c838c
@ -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…
Reference in New Issue
Block a user