Commit 7083f0f8 authored by Maria Dimashova's avatar Maria Dimashova

fixed compile error when HAVE_EIGEN2 (#500)

parent 84f51332
...@@ -300,8 +300,7 @@ void BruteForceMatcher<L2<float> >::matchImpl( const Mat& query, const Mat& /*ma ...@@ -300,8 +300,7 @@ void BruteForceMatcher<L2<float> >::matchImpl( const Mat& query, const Mat& /*ma
{ {
matches.clear(); matches.clear();
matches.reserve( query.rows ); matches.reserve( query.rows );
//TODO: remove _DEBUG if bag 416 fixed #if (!defined HAVE_EIGEN2)
#if (defined _DEBUG || !defined HAVE_EIGEN2)
Mat norms; Mat norms;
cv::reduce( train.mul( train ), norms, 1, 0); cv::reduce( train.mul( train ), norms, 1, 0);
norms = norms.t(); norms = norms.t();
...@@ -318,12 +317,12 @@ void BruteForceMatcher<L2<float> >::matchImpl( const Mat& query, const Mat& /*ma ...@@ -318,12 +317,12 @@ void BruteForceMatcher<L2<float> >::matchImpl( const Mat& query, const Mat& /*ma
#else #else
Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> desc1t; Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> desc1t;
Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> desc2; Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic> desc2;
cv2eigen( descriptors_1.t(), desc1t); cv2eigen( query.t(), desc1t);
cv2eigen( descriptors_2, desc2 ); cv2eigen( train, desc2 );
//Eigen::Matrix<float, Eigen::Dynamic, 1> norms = desc2.rowwise().squaredNorm(); //Eigen::Matrix<float, Eigen::Dynamic, 1> norms = desc2.rowwise().squaredNorm();
Eigen::Matrix<float, Eigen::Dynamic, 1> norms = desc2.rowwise().squaredNorm() / 2; Eigen::Matrix<float, Eigen::Dynamic, 1> norms = desc2.rowwise().squaredNorm() / 2;
for( int i=0;i<descriptors_1.rows;i++ ) for( int i=0;i<query.rows;i++ )
{ {
//Eigen::Matrix<float, Eigen::Dynamic, 1> distances = (-2) * (desc2*desc1t.col(i)); //Eigen::Matrix<float, Eigen::Dynamic, 1> distances = (-2) * (desc2*desc1t.col(i));
Eigen::Matrix<float, Eigen::Dynamic, 1> distances = desc2*desc1t.col(i); Eigen::Matrix<float, Eigen::Dynamic, 1> distances = desc2*desc1t.col(i);
......
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