mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 19:44:14 +08:00
fix vs2010 samples build
This commit is contained in:
@@ -111,7 +111,7 @@ uchar invertSingleBits( uchar dividend_char, int numBits )
|
|||||||
/* reconvert to decimal */
|
/* reconvert to decimal */
|
||||||
uchar result = 0;
|
uchar result = 0;
|
||||||
for ( int i = (int) bin_vector.size() - 1; i >= 0; i-- )
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
#include "opencv2/video.hpp"
|
#include "opencv2/video.hpp"
|
||||||
#include "opencv2/optflow.hpp"
|
#include "opencv2/optflow.hpp"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
@@ -40,7 +41,7 @@ static Mat endpointError( const Mat_<Point2f>& flow1, const Mat_<Point2f>& flow2
|
|||||||
const Point2f diff = u1 - u2;
|
const Point2f diff = u1 - u2;
|
||||||
result.at<float>(i, j) = sqrt((float)diff.ddot(diff)); //distance
|
result.at<float>(i, j) = sqrt((float)diff.ddot(diff)); //distance
|
||||||
} else
|
} else
|
||||||
result.at<float>(i, j) = NAN;
|
result.at<float>(i, j) = std::numeric_limits<float>::quiet_NaN();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -61,7 +62,7 @@ static Mat angularError( const Mat_<Point2f>& flow1, const Mat_<Point2f>& flow2
|
|||||||
if ( isFlowCorrect(u1) && isFlowCorrect(u2) )
|
if ( isFlowCorrect(u1) && isFlowCorrect(u2) )
|
||||||
result.at<float>(i, j) = acos((float)(u1.ddot(u2) / norm(u1) * norm(u2)));
|
result.at<float>(i, j) = acos((float)(u1.ddot(u2) / norm(u1) * norm(u2)));
|
||||||
else
|
else
|
||||||
result.at<float>(i, j) = NAN;
|
result.at<float>(i, j) = std::numeric_limits<float>::quiet_NaN();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user