Merge pull request #586 from Bleach665:vs2010_samples

pull/454/head
Alexander Alekhin 9 years ago
commit 6cd8e9f556
  1. 2
      modules/line_descriptor/samples/knn_matching.cpp
  2. 5
      modules/optflow/samples/optical_flow_evaluation.cpp

@ -111,7 +111,7 @@ uchar invertSingleBits( uchar dividend_char, int numBits )
/* reconvert to decimal */
uchar result = 0;
for ( int i = (int) bin_vector.size() - 1; i >= 0; i-- )
result += (uchar) ( bin_vector[i] * pow( 2, i ) );
result += (uchar) ( bin_vector[i] * (1 << i) );
return result;
}

@ -2,6 +2,7 @@
#include "opencv2/video.hpp"
#include "opencv2/optflow.hpp"
#include <fstream>
#include <limits>
using namespace std;
using namespace cv;
@ -40,7 +41,7 @@ static Mat endpointError( const Mat_<Point2f>& flow1, const Mat_<Point2f>& flow2
const Point2f diff = u1 - u2;
result.at<float>(i, j) = sqrt((float)diff.ddot(diff)); //distance
} else
result.at<float>(i, j) = NAN;
result.at<float>(i, j) = std::numeric_limits<float>::quiet_NaN();
}
}
return result;
@ -61,7 +62,7 @@ static Mat angularError( const Mat_<Point2f>& flow1, const Mat_<Point2f>& flow2
if ( isFlowCorrect(u1) && isFlowCorrect(u2) )
result.at<float>(i, j) = acos((float)(u1.ddot(u2) / norm(u1) * norm(u2)));
else
result.at<float>(i, j) = NAN;
result.at<float>(i, j) = std::numeric_limits<float>::quiet_NaN();
}
}
return result;

Loading…
Cancel
Save