23 #include "testing/testing.h"
29 const Vec& X_distances,
36 int num_points = x_image.cols();
38 Mat3X x_unit_cam(3, num_points);
39 x_unit_cam = KK.inverse() * x_image;
43 *x_camera = x_unit_cam.block(0, 0, 2, num_points);
44 for (
int i = 0; i < num_points; ++i) {
45 x_unit_cam.col(i).normalize();
49 Mat X_camera(3, num_points);
50 for (
int i = 0; i < num_points; ++i) {
51 X_camera.col(i) = X_distances(i) * x_unit_cam.col(i);
55 Mat translation_matrix(3, num_points);
56 translation_matrix.row(0).setConstant(T_input(0));
57 translation_matrix.row(1).setConstant(T_input(1));
58 translation_matrix.row(2).setConstant(T_input(2));
60 *X_world = R_input * X_camera + translation_matrix;
63 *R_expected = R_input.transpose();
64 *T_expected = *R_expected * (-T_input);
71 X = 100 * Mat::Random(3, num_points);
75 R_input = Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ())
76 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitY())
77 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ());
81 t_input = 100 * t_input;
83 Mat translation_matrix(3, num_points);
84 translation_matrix.row(0).setConstant(t_input(0));
85 translation_matrix.row(1).setConstant(t_input(1));
86 translation_matrix.row(2).setConstant(t_input(2));
89 Xp = R_input *
X + translation_matrix;
97 EXPECT_MATRIX_NEAR(
t, t_input, 1
e-6);
98 EXPECT_MATRIX_NEAR(
R, R_input, 1
e-8);
104 Vec2i image_dimensions;
105 image_dimensions << 1600, 1200;
114 Mat3X x_image(3, num_points);
115 x_image << 1164.06, 734.948, 749.599, 430.727,
116 681.386, 844.59, 496.315, 580.775,
121 Vec X_distances = 100 * Vec::Random(num_points).array().abs();
125 R_input = Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ())
126 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitY())
127 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ());
131 T_input = 100 * T_input;
140 &x_camera, &X_world, &R_expected, &T_expected);
146 &R_output, &T_output,
149 EXPECT_MATRIX_NEAR(T_output, T_expected, 1
e-5);
150 EXPECT_MATRIX_NEAR(R_output, R_expected, 1
e-7);
157 R_output.setIdentity();
161 &R_output, &T_output,
164 EXPECT_MATRIX_NEAR(T_output, T_expected, 1
e-5);
165 EXPECT_MATRIX_NEAR(R_output, R_expected, 1
e-7);*/
180 Mat3X x_image(3, num_points);
181 x_image.row(0) =
w * Vec::Random(num_points).array().abs();
182 x_image.row(1) = h * Vec::Random(num_points).array().abs();
183 x_image.row(2).setOnes();
187 Vec X_distances = 100 * Vec::Random(num_points).array().abs();
191 R_input = Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ())
192 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitY())
193 * Eigen::AngleAxisd(rand(), Eigen::Vector3d::UnitZ());
197 T_input = 100 * T_input;
204 &x_camera, &X_world, &R_expected, &T_expected);
211 &R_output, &T_output,
213 EXPECT_MATRIX_NEAR(T_output, T_expected, 1
e-5);
214 EXPECT_MATRIX_NEAR(R_output, R_expected, 1
e-7);
220 &R_output, &T_output,
222 EXPECT_MATRIX_NEAR(T_output, T_expected, 1
e-5);
223 EXPECT_MATRIX_NEAR(R_output, R_expected, 1
e-7);
229 &R_output, &T_output);
230 EXPECT_MATRIX_NEAR(T_output, T_expected, 1
e-5);
231 EXPECT_MATRIX_NEAR(R_output, R_expected, 1
e-7);
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space Combine Create a color from its and value channels Color Retrieve a color or the default fallback if none is specified Separate Split a vector into its X
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
static void CreateCameraSystem(const Mat3 &KK, const Mat3X &x_image, const Vec &X_distances, const Mat3 &R_input, const Vec3 &T_input, Mat2X *x_camera, Mat3X *X_world, Mat3 *R_expected, Vec3 *T_expected)
VecMat::Vec2< int > Vec2i
bool EuclideanResection(const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t, ResectionMethod method)
void AbsoluteOrientation(const Mat3X &X, const Mat3X &Xp, Mat3 *R, Vec3 *t)
@ RESECTION_ANSAR_DANIILIDIS
Eigen::Matrix< double, 3, Eigen::Dynamic > Mat3X
Eigen::Matrix< double, 2, Eigen::Dynamic > Mat2X