diff options
-rw-r--r-- | extern/libmv/libmv/multiview/fundamental.cc | 3 | ||||
-rw-r--r-- | extern/libmv/libmv/multiview/fundamental.h | 14 | ||||
-rw-r--r-- | extern/libmv/libmv/multiview/homography.cc | 16 | ||||
-rw-r--r-- | extern/libmv/libmv/multiview/homography.h | 16 |
4 files changed, 25 insertions, 24 deletions
diff --git a/extern/libmv/libmv/multiview/fundamental.cc b/extern/libmv/libmv/multiview/fundamental.cc index 876e3d07db5..2b7515d7810 100644 --- a/extern/libmv/libmv/multiview/fundamental.cc +++ b/extern/libmv/libmv/multiview/fundamental.cc @@ -470,7 +470,7 @@ bool FundamentalFromCorrespondencesEuc(const Mat &x1, problem.AddResidualBlock( new ceres::AutoDiffCostFunction< FundamentalSymmetricEpipolarCostFunctor, - 2, /* num_residuals */ + 2, // num_residuals 9>(fundamental_symmetric_epipolar_cost_function), NULL, F->data()); @@ -493,7 +493,6 @@ bool FundamentalFromCorrespondencesEuc(const Mat &x1, LG << "Final refined matrix: " << F; return !(summary.termination_type == ceres::DID_NOT_RUN || - summary.termination_type == ceres::NO_CONVERGENCE || summary.termination_type == ceres::NUMERICAL_FAILURE); } diff --git a/extern/libmv/libmv/multiview/fundamental.h b/extern/libmv/libmv/multiview/fundamental.h index 45b564c27eb..e899fdd521c 100644 --- a/extern/libmv/libmv/multiview/fundamental.h +++ b/extern/libmv/libmv/multiview/fundamental.h @@ -151,22 +151,22 @@ void FundamentalToEssential(const Mat3 &F, Mat3 *E); * Defaults should be suitable for a wide range of use cases, but * better performance and accuracy might require tweaking/ */ -typedef struct FundamentalEstimationOptions { - /* Default constructor which sets up a options for generic usage. */ +struct FundamentalEstimationOptions { + // Default constructor which sets up a options for generic usage. FundamentalEstimationOptions(void); - /* Refine fundamental matrix even if algebraic estimation reported failure. */ + // Refine fundamental matrix even if algebraic estimation reported failure. bool use_refine_if_algebraic_fails; - /* Maximal number of iterations for refinement step. */ + // Maximal number of iterations for refinement step. int max_num_iterations; - /* Paramaneter tolerance used by minimizer termination criteria. */ + // Paramaneter tolerance used by minimizer termination criteria. float parameter_tolerance; - /* Function tolerance used by minimizer termination criteria. */ + // Function tolerance used by minimizer termination criteria. float function_tolerance; -} FundamentalEstimationOptions; +}; /** * Fundamental transformation estimation. diff --git a/extern/libmv/libmv/multiview/homography.cc b/extern/libmv/libmv/multiview/homography.cc index ef015f829c8..11e12abf455 100644 --- a/extern/libmv/libmv/multiview/homography.cc +++ b/extern/libmv/libmv/multiview/homography.cc @@ -185,9 +185,11 @@ class HomographySymmetricGeometricCostFunctor { H_x /= H_x(2); Hinv_y /= Hinv_y(2); + // This is a forward error. residuals[0] = H_x(0) - T(y_(0)); residuals[1] = H_x(1) - T(y_(1)); + // This is a backward error. residuals[2] = Hinv_y(0) - T(x_(0)); residuals[3] = Hinv_y(1) - T(x_(1)); @@ -201,11 +203,12 @@ class HomographySymmetricGeometricCostFunctor { /** 2D Homography transformation estimation in the case that points are in * euclidean coordinates. */ -bool Homography2DFromCorrespondencesEuc(const Mat &x1, - const Mat &x2, - const HomographyEstimationOptions &options, - Mat3 *H) { - /* TODO(sergey): Support homogenous coordinates, not just euclidean. */ +bool Homography2DFromCorrespondencesEuc( + const Mat &x1, + const Mat &x2, + const HomographyEstimationOptions &options, + Mat3 *H) { + // TODO(sergey): Support homogenous coordinates, not just euclidean. assert(2 == x1.rows()); assert(4 <= x1.cols()); @@ -234,7 +237,7 @@ bool Homography2DFromCorrespondencesEuc(const Mat &x1, problem.AddResidualBlock( new ceres::AutoDiffCostFunction< HomographySymmetricGeometricCostFunctor, - 4, /* num_residuals */ + 4, // num_residuals 9>(homography_symmetric_geometric_cost_function), NULL, H->data()); @@ -257,7 +260,6 @@ bool Homography2DFromCorrespondencesEuc(const Mat &x1, LG << "Final refined matrix: " << H; return !(summary.termination_type == ceres::DID_NOT_RUN || - summary.termination_type == ceres::NO_CONVERGENCE || summary.termination_type == ceres::NUMERICAL_FAILURE); } diff --git a/extern/libmv/libmv/multiview/homography.h b/extern/libmv/libmv/multiview/homography.h index abad4e0d963..1928e39dffb 100644 --- a/extern/libmv/libmv/multiview/homography.h +++ b/extern/libmv/libmv/multiview/homography.h @@ -60,25 +60,25 @@ bool Homography2DFromCorrespondencesLinear(const Mat &x1, * Defaults should be suitable for a wide range of use cases, but * better performance and accuracy might require tweaking/ */ -typedef struct HomographyEstimationOptions { - /* Default constructor which sets up a options for generic usage. */ +struct HomographyEstimationOptions { + // Default constructor which sets up a options for generic usage. HomographyEstimationOptions(void); - /* Expected precision of algebraic estimation. */ + // Expected precision of algebraic estimation. double expected_algebraic_precision; - /* Refine homography even if algebraic estimation reported failure. */ + // Refine homography even if algebraic estimation reported failure. bool use_refine_if_algebraic_fails; - /* Maximal number of iterations for refinement step. */ + // Maximal number of iterations for refinement step. int max_num_iterations; - /* Paramaneter tolerance used by minimizer termination criteria. */ + // Paramaneter tolerance used by minimizer termination criteria. float parameter_tolerance; - /* Function tolerance used by minimizer termination criteria. */ + // Function tolerance used by minimizer termination criteria. float function_tolerance; -} HomographyEstimationOptions; +}; /** * 2D homography transformation estimation. |