Libmv: Solve some strict warnings in tests
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
namespace mv {
|
||||
|
||||
void AddMarker(int frame, float x, float y, Tracks* tracks) {
|
||||
static void AddMarker(int frame, float x, float y, Tracks* tracks) {
|
||||
Marker marker;
|
||||
marker.clip = marker.track = 0;
|
||||
marker.frame = frame;
|
||||
|
||||
@@ -28,15 +28,15 @@ using namespace libmv::euclidean_resection;
|
||||
using namespace libmv;
|
||||
|
||||
// Generates all necessary inputs and expected outputs for EuclideanResection.
|
||||
void CreateCameraSystem(const Mat3& KK,
|
||||
const Mat3X& x_image,
|
||||
const Vec& X_distances,
|
||||
const Mat3& R_input,
|
||||
const Vec3& T_input,
|
||||
Mat2X *x_camera,
|
||||
Mat3X *X_world,
|
||||
Mat3 *R_expected,
|
||||
Vec3 *T_expected) {
|
||||
static void CreateCameraSystem(const Mat3& KK,
|
||||
const Mat3X& x_image,
|
||||
const Vec& X_distances,
|
||||
const Mat3& R_input,
|
||||
const Vec3& T_input,
|
||||
Mat2X *x_camera,
|
||||
Mat3X *X_world,
|
||||
Mat3 *R_expected,
|
||||
Vec3 *T_expected) {
|
||||
int num_points = x_image.cols();
|
||||
|
||||
Mat3X x_unit_cam(3, num_points);
|
||||
|
||||
@@ -76,8 +76,8 @@ TEST(Projection, isInFrontOfCamera) {
|
||||
bool res_front = isInFrontOfCamera(P, X_front);
|
||||
bool res_back = isInFrontOfCamera(P, X_back);
|
||||
|
||||
EXPECT_EQ(true, res_front);
|
||||
EXPECT_EQ(false, res_back);
|
||||
EXPECT_TRUE(res_front);
|
||||
EXPECT_FALSE(res_back);
|
||||
}
|
||||
|
||||
TEST(AutoCalibration, ProjectionShiftPrincipalPoint) {
|
||||
|
||||
@@ -40,21 +40,6 @@ void CoeffsForCubicZeros(double a, double b, double c,
|
||||
*q = (a * b + (b + a) * c);
|
||||
*r = -a * b * c;
|
||||
}
|
||||
// Find the polynomial coefficients of x in the equation
|
||||
//
|
||||
// (x - a)(x - b)(x - c)(x - d) == 0
|
||||
//
|
||||
// by expanding to
|
||||
//
|
||||
// x^4 - (d+c+b+a) * x^3 + (d*(c+b+a) + a*b+(b+a)*c) * x^2
|
||||
// - (d*(a*b+(b+a)*c)+a*b*c) * x + a*b*c*d = 0.
|
||||
void CoeffsForQuarticZeros(double a, double b, double c, double d,
|
||||
double *p, double *q, double *r, double *s) {
|
||||
*p = -(d + c + b + a);
|
||||
*q = (d * (c + b + a) + a * b + (b + a) * c);
|
||||
*r = -(d * (a * b + (b + a) * c) + a * b * c);
|
||||
*s = a * b * c *d;
|
||||
}
|
||||
|
||||
TEST(Poly, SolveCubicPolynomial) {
|
||||
double a, b, c, aa, bb, cc;
|
||||
|
||||
@@ -46,6 +46,7 @@ void PreformSinglePointTest(const DetectOptions &options) {
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
void PreformCheckerBoardTest(const DetectOptions &options) {
|
||||
// Prepare the image.
|
||||
FloatImage image(30, 30);
|
||||
@@ -80,6 +81,7 @@ void PreformCheckerBoardTest(const DetectOptions &options) {
|
||||
EXPECT_LE(1, std::abs(feature.y - rounded_y));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CheckExpectedFeatures(const vector<Feature> &detected_features,
|
||||
const vector<Feature> &expected_features) {
|
||||
|
||||
Reference in New Issue
Block a user