26#include "testing/testing.h"
31TEST(Panography, PrintSomeSharedFocalEstimationValues) {
32 Mat x1(2, 2), x2(2, 2);
33 x1 << 158, 78, 124, 113;
34 x2 << 300, 214, 125, 114;
37 x1.block<1, 2>(0, 0) /= 320;
38 x1.block<1, 2>(1, 0) /= 240;
39 x2.block<1, 2>(0, 0) /= 320;
40 x2.block<1, 2>(1, 0) /= 240;
41 x1 += Mat2::Constant(0.5);
42 x2 += Mat2::Constant(0.5);
49 EXPECT_NEAR(3.47194, fs[0], 1
e-3);
52TEST(Panography, GetR_FixedCameraCenterWithIdentity) {
63 EXPECT_MATRIX_NEAR(Mat3::Identity(),
R, 1
e-8);
64 LOG(INFO) <<
"R \n" <<
R;
67TEST(Panography, Homography_GetR_Test_PitchY30) {
78 const double alpha = 30.0 *
M_PI / 180.0;
81 rotY <<
cos(alpha), 0, -
sin(alpha),
86 for (
int i = 0; i < n; ++i) {
87 x2.block<3, 1>(0, i) = rotY * x1.col(i);
94 for (
int i = 0; i < n; ++i) {
95 Vec residuals = (
R * x1.col(i)) - x2.col(i);
96 EXPECT_NEAR(0, residuals.norm(), 1
e-6);
101 double pitch_y =
asin(
R(2, 0)) * 180.0 /
M_PI;
102 EXPECT_NEAR(30, pitch_y, 1
e-4);
105TEST(MinimalPanoramic, Real_Case_Kernel) {
119 Mat3 Ground_TruthHomography;
121 Ground_TruthHomography<< 1, 0.02, 129.83,
122 -0.02, 1.012, 0.07823,
130 LOG(INFO) <<
"Got " << Hs.size() <<
" solutions.";
131 for (
int j = 0; j < Hs.size(); ++j) {
134 EXPECT_MATRIX_NEAR(
H, Ground_TruthHomography, 1
e-1);
141 for (
int i = 0; i < n; ++i) {
142 Vec x1p =
H * x1h.col(i);
143 Vec residuals = x1p / x1p(2) - x2h.col(i);
144 EXPECT_MATRIX_NEAR_ZERO(residuals, 1
e-5);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ccl_device_inline float3 cos(float3 v)
T sin(const AngleRadianBase< T > &a)
void EuclideanToHomogeneous(const Mat &X, Mat *H)
TEST(PolynomialCameraIntrinsics2, ApplyOnFocalCenter)
void F_FromCorrespondance_2points(const Mat &x1, const Mat &x2, vector< double > *fs)
void GetR_FixedCameraCenter(const Mat &x1, const Mat &x2, const double focal, Mat3 *R)
static void Solve(const Mat &x1, const Mat &x2, vector< Mat3 > *Hs)