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
|
// Compute the descriptors
|
||||||
if (do_descriptors)
|
if (do_descriptors)
|
||||||
{
|
{
|
||||||
Mat desc = descriptors.rowRange(offset, offset + nkeypoints);
|
Mat desc;
|
||||||
|
if (!descriptors.empty())
|
||||||
|
{
|
||||||
|
desc = descriptors.rowRange(offset, offset + nkeypoints);
|
||||||
|
}
|
||||||
|
|
||||||
offset += nkeypoints;
|
offset += nkeypoints;
|
||||||
// preprocess the resized image
|
// preprocess the resized image
|
||||||
Mat& workingMat = imagePyramid[level];
|
Mat& workingMat = imagePyramid[level];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user