Blender V4.3
libmv/multiview/homography.h
Go to the documentation of this file.
1// Copyright (c) 2011 libmv authors.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to
5// deal in the Software without restriction, including without limitation the
6// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7// sell copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19// IN THE SOFTWARE.
20
21#ifndef LIBMV_MULTIVIEW_HOMOGRAPHY_H_
22#define LIBMV_MULTIVIEW_HOMOGRAPHY_H_
23
25
26namespace libmv {
27
53 const Mat& x1,
54 const Mat& x2,
55 Mat3* H,
56 double expected_precision = EigenDouble::dummy_precision());
57
66 // Default constructor which sets up a options for generic usage.
68
69 // Normalize correspondencies before estimating the homography
70 // in order to increase estimation stability.
71 //
72 // Normaliztion will make it so centroid od correspondences
73 // is the coordinate origin and their average distance from
74 // the origin is sqrt(2).
75 //
76 // See:
77 // - R. Hartley and A. Zisserman. Multiple View Geometry in Computer
78 // Vision. Cambridge University Press, second edition, 2003.
79 // - https://www.cs.ubc.ca/grads/resources/thesis/May09/Dubrofsky_Elan.pdf
81
82 // Maximal number of iterations for the refinement step.
84
85 // Expected average of symmetric geometric distance between
86 // actual destination points and original ones transformed by
87 // estimated homography matrix.
88 //
89 // Refinement will finish as soon as average of symmetric
90 // geometric distance is less or equal to this value.
91 //
92 // This distance is measured in the same units as input points are.
94};
95
104 const Mat& x1,
105 const Mat& x2,
107 Mat3* H);
108
133 const Mat& x1,
134 const Mat& x2,
135 Mat4* H,
136 double expected_precision = EigenDouble::dummy_precision());
137
143double SymmetricGeometricDistance(const Mat3& H,
144 const Vec2& x1,
145 const Vec2& x2);
146
147} // namespace libmv
148
149#endif // LIBMV_MULTIVIEW_HOMOGRAPHY_H_
CCL_NAMESPACE_BEGIN struct Options options
float[3][3] Mat3
Definition gpu_matrix.cc:28
#define H(x, y, z)
Eigen::Matrix< double, 3, 3 > Mat3
Definition numeric.h:72
Eigen::Vector2d Vec2
Definition numeric.h:105
Eigen::MatrixXd Mat
Definition numeric.h:60
bool Homography2DFromCorrespondencesLinear(const Mat &x1, const Mat &x2, Mat3 *H, double expected_precision)
bool EstimateHomography2DFromCorrespondences(const Mat &x1, const Mat &x2, const EstimateHomographyOptions &options, Mat3 *H)
bool Homography3DFromCorrespondencesLinear(const Mat &x1, const Mat &x2, Mat4 *H, double expected_precision)
double SymmetricGeometricDistance(const Mat3 &H, const Vec2 &x1, const Vec2 &x2)