[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60476] trunk/blender/extern/libmv/libmv/ multiview: Fix issues according to codereview page
Sergey Sharybin
sergey.vfx at gmail.com
Tue Oct 1 13:15:24 CEST 2013
Revision: 60476
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60476
Author: nazgul
Date: 2013-10-01 11:15:24 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
Fix issues according to codereview page
Mainly just a comment cleanups.
Modified Paths:
--------------
trunk/blender/extern/libmv/libmv/multiview/fundamental.cc
trunk/blender/extern/libmv/libmv/multiview/fundamental.h
trunk/blender/extern/libmv/libmv/multiview/homography.cc
trunk/blender/extern/libmv/libmv/multiview/homography.h
Modified: trunk/blender/extern/libmv/libmv/multiview/fundamental.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/fundamental.cc 2013-10-01 09:29:56 UTC (rev 60475)
+++ trunk/blender/extern/libmv/libmv/multiview/fundamental.cc 2013-10-01 11:15:24 UTC (rev 60476)
@@ -470,7 +470,7 @@
problem.AddResidualBlock(
new ceres::AutoDiffCostFunction<
FundamentalSymmetricEpipolarCostFunctor,
- 2, /* num_residuals */
+ 2, // num_residuals
9>(fundamental_symmetric_epipolar_cost_function),
NULL,
F->data());
Modified: trunk/blender/extern/libmv/libmv/multiview/fundamental.h
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/fundamental.h 2013-10-01 09:29:56 UTC (rev 60475)
+++ trunk/blender/extern/libmv/libmv/multiview/fundamental.h 2013-10-01 11:15:24 UTC (rev 60476)
@@ -151,20 +151,20 @@
* 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;
Modified: trunk/blender/extern/libmv/libmv/multiview/homography.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/homography.cc 2013-10-01 09:29:56 UTC (rev 60475)
+++ trunk/blender/extern/libmv/libmv/multiview/homography.cc 2013-10-01 11:15:24 UTC (rev 60476)
@@ -185,9 +185,11 @@
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 @@
/** 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 @@
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 @@
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);
}
Modified: trunk/blender/extern/libmv/libmv/multiview/homography.h
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/homography.h 2013-10-01 09:29:56 UTC (rev 60475)
+++ trunk/blender/extern/libmv/libmv/multiview/homography.h 2013-10-01 11:15:24 UTC (rev 60476)
@@ -60,25 +60,25 @@
* 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.
More information about the Bf-blender-cvs
mailing list