Merge pull request #1652 from fallenlord:master

Bug fixes: using mask with BinaryDescriptor  (#1652)

* Bug fixes: erasing an element from std::vector should not move iterator forward

* Bug fixes: add a NULL checking

* Remove the appoggio matrix generation, which is useless
pull/1656/head^2
Colin 7 years ago committed by Alexander Alekhin
parent db1d5e153c
commit 25a01dc4ef
  1. 15
      modules/line_descriptor/src/binary_descriptor.cpp

@ -504,7 +504,7 @@ void BinaryDescriptor::detectImpl( const Mat& imageSrc, std::vector<KeyLine>& ke
/* delete undesired KeyLines, according to input mask */
if( !mask.empty() )
{
for ( size_t keyCounter = 0; keyCounter < keylines.size(); keyCounter++ )
for ( size_t keyCounter = 0; keyCounter < keylines.size(); )
{
KeyLine& kl = keylines[keyCounter];
@ -517,6 +517,8 @@ void BinaryDescriptor::detectImpl( const Mat& imageSrc, std::vector<KeyLine>& ke
if( mask.at < uchar > ( (int) kl.startPointY, (int) kl.startPointX ) == 0 && mask.at < uchar > ( (int) kl.endPointY, (int) kl.endPointX ) == 0 )
keylines.erase( keylines.begin() + keyCounter );
else
keyCounter++;
}
}
@ -1342,17 +1344,6 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines, bool useDetectionData )
}/* end for(short lineIDInSameLine = 0; lineIDInSameLine<sameLineSize;
lineIDInSameLine++) */
cv::Mat appoggio = cv::Mat( 1, 32, CV_32FC1 );
float* pointerToRow = appoggio.ptr<float>( 0 );
for ( int g = 0; g < 32; g++ )
{
/* get LBD data */
float* des_Vec = &keyLines[lineIDInScaleVec][0].descriptor.front();
*pointerToRow = des_Vec[g];
pointerToRow++;
}
}/* end for(short lineIDInScaleVec = 0;
lineIDInScaleVec<numOfFinalLine; lineIDInScaleVec++) */

Loading…
Cancel
Save