21 #ifndef LIBMV_MULTIVIEW_PROJECTION_H_
22 #define LIBMV_MULTIVIEW_PROJECTION_H_
34 const Vec2& principal_point,
35 const Vec2& principal_point_new,
43 const Vec2& principal_point,
45 double aspect_ratio_new,
54 return h.head<2>() / h(2);
57 return h.head<3>() / h(3);
61 e.row(0) = h.row(0).array() / h.row(2).array();
62 e.row(1) = h.row(1).array() / h.row(2).array();
69 h.block(0, 0, 2,
x.cols()) =
x;
74 h->resize(3,
x.cols());
75 h->block(0, 0, 2,
x.cols()) =
x;
80 h.block(0, 0, 3,
x.cols()) =
x;
85 h->resize(4,
x.cols());
86 h->block(0, 0, 3,
x.cols()) =
x;
92 return Vec3(
x(0),
x(1), 1);
95 return Vec4(
x(0),
x(1),
x(2), 1);
105 return hx.head<2>() / hx(2);
114 *
x = hx.head<2>() / hx(2);
126 *
x = hx.head<2>() / hx(2);
130 x->resize(2,
X.cols());
131 for (
int c = 0;
c <
X.cols(); ++
c) {
133 x->col(
c) = hx.head<2>() / hx(2);
144 x->resize(2,
X.cols());
145 for (
int c = 0;
c <
X.cols(); ++
c) {
149 x->col(
c) = hx.head<2>() / hx(2);
154 x->resize(2, ids.size());
157 for (
int c = 0;
c < ids.size(); ++
c) {
158 HX <<
X.col(ids[
c]), 1.0;
160 x->col(
c) = hx.head<2>() / hx(2);
184 double condition_1 =
P.row(2).dot(
X) *
X[3];
185 double condition_2 =
X[2] *
X[3];
186 if (condition_1 > 0 && condition_2 > 0)
194 X_homo.segment<3>(0) =
X;
210 const Mat4X& X_world,
212 size_t num_points = x_image.cols();
214 return dx.norm() / num_points;
219 const Mat3X& X_world,
225 size_t num_points = x_image.cols();
227 return dx.norm() / num_points;
_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
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void EuclideanToHomogeneous(const Mat &X, Mat *H)
Eigen::Matrix< double, 3, 3 > Mat3
void HomogeneousToEuclidean(const Mat &H, Mat *X)
void HomogeneousToNormalizedCamera(const Mat3X &x, const Mat3 &K, Mat2X *n)
void ProjectionShiftPrincipalPoint(const Mat34 &P, const Vec2 &principal_point, const Vec2 &principal_point_new, Mat34 *P_new)
double Depth(const Mat3 &R, const Vec3 &t, const Vec3 &X)
double RootMeanSquareError(const Mat2X &x_image, const Mat4X &X_world, const Mat34 &P)
Estimates the root mean square error (2D)
Vec2 Project(const Mat34 &P, const Vec3 &X)
void KRt_From_P(const Mat34 &P, Mat3 *Kp, Mat3 *Rp, Vec3 *tp)
Eigen::Matrix< double, 3, 4 > Mat34
Eigen::Matrix< unsigned int, Eigen::Dynamic, 1 > Vecu
Eigen::Matrix< double, 4, Eigen::Dynamic > Mat4X
Eigen::Matrix< double, 3, Eigen::Dynamic > Mat3X
void ProjectionChangeAspectRatio(const Mat34 &P, const Vec2 &principal_point, double aspect_ratio, double aspect_ratio_new, Mat34 *P_new)
Vec2 ImageToNormImageCoordinates(Mat3 &Kinverse, Vec2 &x)
Eigen::Matrix< double, 2, Eigen::Dynamic > Mat2X
void P_From_KRt(const Mat3 &K, const Mat3 &R, const Vec3 &t, Mat34 *P)
bool isInFrontOfCamera(const Mat34 &P, const Vec4 &X)
void EuclideanToNormalizedCamera(const Mat2X &x, const Mat3 &K, Mat2X *n)