Ocean
Loading...
Searching...
No Matches
TestMultipleViewGeometry.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_TEST_TESTGEOMETRY_TEST_MULTIPLE_VIEW_GEOMETRY_H
9#define META_OCEAN_TEST_TESTGEOMETRY_TEST_MULTIPLE_VIEW_GEOMETRY_H
10
12
14
16
17namespace Ocean
18{
19
20namespace Test
21{
22
23namespace TestGeometry
24{
25
26/**
27 * This class implements an epipolar geometry test.
28 * @ingroup testgeometry
29 */
30class OCEAN_TEST_GEOMETRY_EXPORT TestMultipleViewGeometry
31{
32 public:
33
34 /**
35 * Tests all multiple view geometry functions.
36 * @param testDuration Number of seconds for each test, with range (0, infinity)
37 * @param selector Selector for sub-tests
38 * @return True, if succeeded
39 */
40 static bool testMultipleViewGeometry(const double testDuration, const TestSelector& selector);
41
42 private:
43
44 /**
45 * Tests the calculation of the trifocal tensor matrices.
46 * @param addGaussianNoise Gaussian noise will be added
47 * @param testDuration Number of seconds for each test, with range (0, infinity)
48 * @return True, if succeeded
49 */
50 static bool testTrifocalTensorMatrix(bool addGaussianNoise, const double testDuration);
51
52 /**
53 * Tests the 3-views case of projective reconstruction algorithm.
54 * @param addGaussianNoise Gaussian noise will be added
55 * @param testDuration Number of seconds for each test, with range (0, infinity)
56 * @return True, if succeeded
57 */
58 static bool testProjectiveReconstructionFrom3Views(bool addGaussianNoise, const double testDuration);
59
60 /**
61 * Tests the multiple views case of projective reconstruction algorithm.
62 * @param views Number of views, with range [3, infinity)
63 * @param addGaussianNoise If set, Gaussian noise is added
64 * @param testDuration Number of seconds for each test, with range (0, infinity)
65 * @return True, if succeeded
66 */
67 static bool testProjectiveReconstruction(const unsigned int views, bool addGaussianNoise, const double testDuration);
68
69 /**
70 * Tests the multiple views case of projective reconstruction algorithm.
71 * Faulty image point correspondences are used.
72 * @param views Number of views, with range [3, infinity)
73 * @param testDuration Number of seconds for each test, with range (0, infinity)
74 * @return True, if succeeded
75 */
76 static bool testFaultyProjectiveReconstruction(const unsigned int views, const double testDuration);
77
78 /**
79 * Generate groups of corresponding image points for individual camera poses.
80 * @param pinholeCamera The pinhole camera profile to be used, must be valid
81 * @param points Number of point correspondences, with range [1, infinity)
82 * @param views Number of views, with range [2, infinity)
83 * @param imagePointsPerPose Resulting groups of corresponding image points, one group for each camera pose
84 * @param gaussSigma Additional Gaussian noise will be added [0, infinity), 0 disable noise
85 * @param objectPoints Optional resulting 3d object points
86 * @return True, if succeeded
87 */
88 static bool generatedImagePointGroups(const PinholeCamera& pinholeCamera, const size_t points, const unsigned int views, std::vector<Vectors2>& imagePointsPerPose, Scalar gaussSigma = Scalar(0), Vectors3* objectPoints = nullptr);
89
90 /**
91 * Evaluates the (squared) re-projection error for given camera intrinsics and camera poses.<br>
92 * Therefore, 3d objects point are determined from camera poses and then projected to image plane.
93 * @param imagePointsPerPose Group of corresponding image points, one group for each camera pose
94 * @param pinholeCamera The pinhole camera profile to be used, must be valid
95 * @param posesIF The camera poses (inverted flipped)
96 * @return The squared re-projection error between image points given and estimated image points.
97 */
98 static Scalar evaluateReprojectionError(const std::vector<Vectors2>& imagePointsPerPose, const PinholeCamera& pinholeCamera, const HomogenousMatrices4& posesIF);
99};
100
101}
102
103}
104
105}
106
107#endif // META_OCEAN_TEST_TESTGEOMETRY_TEST_MULTIPLE_VIEW_GEOMETRY_H
This class implements an epipolar geometry test.
Definition TestMultipleViewGeometry.h:31
static bool testProjectiveReconstruction(const unsigned int views, bool addGaussianNoise, const double testDuration)
Tests the multiple views case of projective reconstruction algorithm.
static bool testMultipleViewGeometry(const double testDuration, const TestSelector &selector)
Tests all multiple view geometry functions.
static bool testFaultyProjectiveReconstruction(const unsigned int views, const double testDuration)
Tests the multiple views case of projective reconstruction algorithm.
static bool testProjectiveReconstructionFrom3Views(bool addGaussianNoise, const double testDuration)
Tests the 3-views case of projective reconstruction algorithm.
static Scalar evaluateReprojectionError(const std::vector< Vectors2 > &imagePointsPerPose, const PinholeCamera &pinholeCamera, const HomogenousMatrices4 &posesIF)
Evaluates the (squared) re-projection error for given camera intrinsics and camera poses.
static bool generatedImagePointGroups(const PinholeCamera &pinholeCamera, const size_t points, const unsigned int views, std::vector< Vectors2 > &imagePointsPerPose, Scalar gaussSigma=Scalar(0), Vectors3 *objectPoints=nullptr)
Generate groups of corresponding image points for individual camera poses.
static bool testTrifocalTensorMatrix(bool addGaussianNoise, const double testDuration)
Tests the calculation of the trifocal tensor matrices.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
float Scalar
Definition of a scalar type.
Definition Math.h:129
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition HomogenousMatrix4.h:73
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition Vector3.h:65
The namespace covering the entire Ocean framework.
Definition Accessor.h:15