Blender
V4.5
intern
libmv
libmv
multiview
triangulation_test.cc
Go to the documentation of this file.
1
// Copyright (c) 2007, 2008 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
#include <iostream>
22
23
#include "
libmv/multiview/fundamental.h
"
24
#include "
libmv/multiview/projection.h
"
25
#include "
libmv/multiview/test_data_sets.h
"
26
#include "
libmv/multiview/triangulation.h
"
27
#include "
libmv/numeric/numeric.h
"
28
#include "testing/testing.h"
29
30
namespace
{
31
using namespace
libmv
;
32
33
TEST
(Triangulation,
TriangulateDLT
) {
34
TwoViewDataSet
d =
TwoRealisticCameras
();
35
36
for
(
int
i
= 0;
i
< d.
X
.cols(); ++
i
) {
37
Vec2
x1, x2;
38
MatrixColumn
(d.
x1
,
i
, &x1);
39
MatrixColumn
(d.
x2
,
i
, &x2);
40
Vec3
X_estimated, X_gt;
41
MatrixColumn
(d.
X
,
i
, &X_gt);
42
TriangulateDLT
(d.
P1
, x1, d.
P2
, x2, &X_estimated);
43
EXPECT_NEAR(0,
DistanceLInfinity
(X_estimated, X_gt), 1
e
-8);
44
}
45
}
46
47
}
// namespace
TEST
TEST(array_store, Nop)
Definition
BLI_array_store_test.cc:305
e
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
Definition
bmesh_query_inline.hh:42
fundamental.h
projection.h
libmv
Definition
libmv/autotrack/autotrack.h:30
libmv::DistanceLInfinity
double DistanceLInfinity(const TVec &x, const TVec &y)
Definition
numeric.h:219
libmv::TwoRealisticCameras
TwoViewDataSet TwoRealisticCameras(bool same_K)
Definition
test_data_sets.cc:31
libmv::TriangulateDLT
void TriangulateDLT(const Mat34 &P1, const Vec2 &x1, const Mat34 &P2, const Vec2 &x2, Vec4 *X_homogeneous)
Definition
triangulation.cc:29
libmv::MatrixColumn
void MatrixColumn(const Mat &A, int i, Vec2 *v)
Definition
numeric.cc:127
libmv::Vec3
Eigen::Vector3d Vec3
Definition
numeric.h:109
numeric.h
libmv::TwoViewDataSet
Definition
test_data_sets.h:31
libmv::TwoViewDataSet::X
Mat3X X
Definition
test_data_sets.h:37
libmv::TwoViewDataSet::P1
Mat34 P1
Definition
test_data_sets.h:35
libmv::TwoViewDataSet::x1
Mat2X x1
Definition
test_data_sets.h:38
libmv::TwoViewDataSet::P2
Mat34 P2
Definition
test_data_sets.h:35
libmv::TwoViewDataSet::x2
Mat2X x2
Definition
test_data_sets.h:38
test_data_sets.h
i
i
Definition
text_draw.cc:230
Vec2
double Vec2[2]
Definition
tracking_plane_tracker.cc:22
triangulation.h
Generated on
for Blender by
doxygen
1.18.0