Commit 9677bd7f authored by Bleach666's avatar Bleach666

fix vs2010 samples build

parent fb55f29f
......@@ -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;
......
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