Commit 25a01dc4 authored by Colin's avatar Colin Committed by Alexander Alekhin

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
parent db1d5e15
......@@ -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++) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment