Commit 12036fd6 authored by biagio montesano's avatar biagio montesano

Error on Mac corrected

parent 43f3eb9f
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#define popcntll __builtin_popcountll #define popcntll __builtin_popcountll
#define popcnt __builtin_popcount #define popcnt __builtin_popcount
#include "precomp.hpp"
/* LUT */ /* LUT */
const int lookup[] = const int lookup[] =
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "sparse_hashtable.hpp" #include "sparse_hashtable.hpp"
#include "types.hpp" #include "types.hpp"
#include "ed_line_detector.hpp" #include "ed_line_detector.hpp"
#include <map>
namespace cv namespace cv
{ {
......
...@@ -63,6 +63,8 @@ static void help() ...@@ -63,6 +63,8 @@ static void help()
} }
uchar invertSingleBits( uchar dividend_char, int numBits );
/* invert numBits bits in input char */ /* invert numBits bits in input char */
uchar invertSingleBits( uchar dividend_char, int numBits ) uchar invertSingleBits( uchar dividend_char, int numBits )
{ {
......
...@@ -158,7 +158,7 @@ BinaryDescriptor::BinaryDescriptor( const BinaryDescriptor::Params &parameters ) ...@@ -158,7 +158,7 @@ BinaryDescriptor::BinaryDescriptor( const BinaryDescriptor::Params &parameters )
edLineVec_.resize( params.numOfOctave_ ); edLineVec_.resize( params.numOfOctave_ );
images_sizes.resize( params.numOfOctave_ ); images_sizes.resize( params.numOfOctave_ );
for ( unsigned int i = 0; i < params.numOfOctave_; i++ ) for ( int i = 0; i < params.numOfOctave_; i++ )
edLineVec_[i] = new EDLineDetector; edLineVec_[i] = new EDLineDetector;
/* prepare a vector to host local weights F_l*/ /* prepare a vector to host local weights F_l*/
...@@ -888,7 +888,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines ) ...@@ -888,7 +888,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
float *dL = new float[2]; //line direction cos(dir), sin(dir) float *dL = new float[2]; //line direction cos(dir), sin(dir)
float *dO = new float[2]; //the clockwise orthogonal vector of line direction. float *dO = new float[2]; //the clockwise orthogonal vector of line direction.
short heightOfLSP = params.widthOfBand_ * NUM_OF_BANDS; //the height of line support region; short heightOfLSP = params.widthOfBand_ * NUM_OF_BANDS; //the height of line support region;
short descriptorSize = NUM_OF_BANDS * 8; //each band, we compute the m( pgdL, ngdL, pgdO, ngdO) and std( pgdL, ngdL, pgdO, ngdO); short descriptor_size = NUM_OF_BANDS * 8; //each band, we compute the m( pgdL, ngdL, pgdO, ngdO) and std( pgdL, ngdL, pgdO, ngdO);
float pgdLRowSum; //the summation of {g_dL |g_dL>0 } for each row of the region; float pgdLRowSum; //the summation of {g_dL |g_dL>0 } for each row of the region;
float ngdLRowSum; //the summation of {g_dL |g_dL<0 } for each row of the region; float ngdLRowSum; //the summation of {g_dL |g_dL<0 } for each row of the region;
float pgdL2RowSum; //the summation of {g_dL^2 |g_dL>0 } for each row of the region; float pgdL2RowSum; //the summation of {g_dL^2 |g_dL>0 } for each row of the region;
...@@ -1086,7 +1086,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines ) ...@@ -1086,7 +1086,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
return 0; */ return 0; */
/* construct line descriptor */ /* construct line descriptor */
pSingleLine->descriptor.resize( descriptorSize ); pSingleLine->descriptor.resize( descriptor_size );
desVec = pSingleLine->descriptor.data(); desVec = pSingleLine->descriptor.data();
short desID; short desID;
...@@ -1162,7 +1162,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines ) ...@@ -1162,7 +1162,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
* vector no larger than this threshold. In Z.Wang's work, a value of 0.4 is found * vector no larger than this threshold. In Z.Wang's work, a value of 0.4 is found
* empirically to be a proper threshold.*/ * empirically to be a proper threshold.*/
desVec = pSingleLine->descriptor.data(); desVec = pSingleLine->descriptor.data();
for ( short i = 0; i < descriptorSize; i++ ) for ( short i = 0; i < descriptor_size; i++ )
{ {
if( desVec[i] > 0.4 ) if( desVec[i] > 0.4 )
{ {
...@@ -1172,13 +1172,13 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines ) ...@@ -1172,13 +1172,13 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
//re-normalize desVec; //re-normalize desVec;
temp = 0; temp = 0;
for ( short i = 0; i < descriptorSize; i++ ) for ( short i = 0; i < descriptor_size; i++ )
{ {
temp += desVec[i] * desVec[i]; temp += desVec[i] * desVec[i];
} }
temp = 1 / sqrt( temp ); temp = 1 / sqrt( temp );
for ( short i = 0; i < descriptorSize; i++ ) for ( short i = 0; i < descriptor_size; i++ )
{ {
desVec[i] = desVec[i] * temp; desVec[i] = desVec[i] * temp;
} }
...@@ -1190,8 +1190,8 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines ) ...@@ -1190,8 +1190,8 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
for ( int g = 0; g < 32; g++ ) for ( int g = 0; g < 32; g++ )
{ {
/* get LBD data */ /* get LBD data */
float* desVec = keyLines[lineIDInScaleVec][0].descriptor.data(); float* des_Vec = keyLines[lineIDInScaleVec][0].descriptor.data();
*pointerToRow = desVec[g]; *pointerToRow = des_Vec[g];
pointerToRow++; pointerToRow++;
} }
......
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