Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-10-01 15:15:24 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-10-01 15:15:24 +0400
commit404274040b48d8898154b8733edbc1f77a78e36e (patch)
treec8c5926e7b98e2331e2a5dc5873e532f1a6bd3d9 /extern/libmv/libmv/multiview/homography.cc
parentff9f799d8b7f2141f09d87d8c494229f3a378911 (diff)
Fix issues according to codereview page
Mainly just a comment cleanups.
Diffstat (limited to 'extern/libmv/libmv/multiview/homography.cc')
-rw-r--r--extern/libmv/libmv/multiview/homography.cc16
1 files changed, 9 insertions, 7 deletions
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);
}