bazar
1.3.1
|
#include <camera.h>
Public Member Functions | |
PerspectiveCamera () | |
void | worldToImage (const double p[3], double uvw[3]) const |
void | worldToImage (const Vec3 &p, Vec3 &uvw) const |
void | worldToEye (const Vec3 &src, Vec3 &dst) const |
void | worldToEye (const double src[3], double dst[3]) const |
void | eyeToWorld (const Vec3 &uvw, Vec3 &w) const |
void | imageToWorld (double u, double v, Vec3 &w, double z=0) const |
void | setGlModelView () const |
void | setByTarget (const Vec3 pos, const Vec3 target, double roll) |
void | loadTdir (const double tdir[3][4], int w, int h) |
bool | loadTdir (const char *tdir, int w, int h) |
bool | loadTdir (const char *tdir) |
void | clearExternalParams () |
void | translate (double dx, double dy, double dz) |
translate the camera relative to eye coordinates (z means "move forward"). | |
void | setWorldToEyeMat (const Mat3x4 &m) |
const Mat3x4 & | getWorldToEyeMat () const |
const Mat3x4 & | getEyeToWorldMat () const |
const Mat3x4 & | getWorldToImageMat () const |
void | cmpWorldToImageMat () |
bool | saveTdir (const char *file) |
Save the camera in a tdir file. Returns true on success, false on failure. | |
Public Member Functions inherited from PerspectiveProjection | |
PerspectiveProjection () | |
PerspectiveProjection (int w, int h, double f, double g, double cx, double, double s=0) | |
void | set (int w, int h, double f, double g, double cx, double cy, double s=0) |
void | eyeToImage (const double eye[3], double uv[2]) const |
void | imageToEye (const double uv[2], double eye[3], double w=0) const |
void | imageToEye (double u, double v, double eye[3], double w=0) const |
void | setGlProjection () const |
bool | setPlanes (double near, double far) |
bool | getUndistortMap (CvMat *xmap, CvMat *ymap) |
void | cmpEyeToImageMat () |
void | flip () |
Protected Attributes | |
Mat3x4 | worldToEyeMat |
Mat3x4 | eyeToWorldMat |
Mat3x4 | worldToImageMat |
Additional Inherited Members | |
Public Attributes inherited from PerspectiveProjection | |
double | f |
double | g |
double | cx |
double | cy |
double | s |
double | distortion |
Mat3x3 | eyeToImageMat |
int | width |
int | height |
double | farPlane |
double | nearPlane |
Perspective camera: a projection located in space.
PerspectiveCamera::PerspectiveCamera | ( | ) |
Definition at line 191 of file camera.cpp.
void PerspectiveCamera::clearExternalParams | ( | ) |
Definition at line 484 of file camera.cpp.
void PerspectiveCamera::cmpWorldToImageMat | ( | ) |
Definition at line 490 of file camera.cpp.
Definition at line 496 of file camera.cpp.
References Vec3::setMul().
|
inline |
Definition at line 78 of file camera.h.
References eyeToWorldMat.
|
inline |
Definition at line 77 of file camera.h.
References worldToEyeMat.
Referenced by operator<<(), and photo_draw().
|
inline |
Definition at line 79 of file camera.h.
References worldToImageMat.
void PerspectiveCamera::imageToWorld | ( | double | u, |
double | v, | ||
Vec3 & | w, | ||
double | z = 0 |
||
) | const |
Definition at line 501 of file camera.cpp.
References Vec3::v.
void PerspectiveCamera::loadTdir | ( | const double | _tdir[3][4], |
int | w, | ||
int | h | ||
) |
This function separate intrinsic and extrinsic parameters from a single projection matrix. The resulting rotation matrix (worldToEyeMat) determinant is always positive.
Definition at line 295 of file camera.cpp.
References get3x3MulWithTransposed().
Referenced by photo_draw().
bool PerspectiveCamera::loadTdir | ( | const char * | tdirFile, |
int | w, | ||
int | h | ||
) |
Load external and internal parameters from a tdir file. The w and h specify the size of the projection rectangle.
Definition at line 356 of file camera.cpp.
bool PerspectiveCamera::loadTdir | ( | const char * | tdirFile | ) |
Load external and internal parameters from a tdir file, estimating image width and height.
THE WIDTH AND HEIGHT ESTIMATION MIGHT BE WRONG!
Definition at line 450 of file camera.cpp.
References diagDiff(), GuessMode::h, and GuessMode::w.
bool PerspectiveCamera::saveTdir | ( | const char * | file | ) |
Save the camera in a tdir file. Returns true on success, false on failure.
Definition at line 522 of file camera.cpp.
Definition at line 238 of file camera.cpp.
References Vec3::normalize(), Vec3::setCross(), and Vec3::setSub().
void PerspectiveCamera::setGlModelView | ( | ) | const |
void PerspectiveCamera::setWorldToEyeMat | ( | const Mat3x4 & | m | ) |
void PerspectiveCamera::translate | ( | double | dx, |
double | dy, | ||
double | dz | ||
) |
translate the camera relative to eye coordinates (z means "move forward").
Definition at line 508 of file camera.cpp.
Definition at line 209 of file camera.cpp.
References Vec3::setMul().
void PerspectiveCamera::worldToEye | ( | const double | src[3], |
double | dst[3] | ||
) | const |
Definition at line 214 of file camera.cpp.
void PerspectiveCamera::worldToImage | ( | const double | p[3], |
double | uvw[3] | ||
) | const |
Definition at line 204 of file camera.cpp.
Definition at line 197 of file camera.cpp.
References Vec3::setMul(), and Vec3::v.
|
protected |
Definition at line 89 of file camera.h.
Referenced by getEyeToWorldMat().
|
protected |
Definition at line 88 of file camera.h.
Referenced by getWorldToEyeMat().
|
protected |
Definition at line 90 of file camera.h.
Referenced by getWorldToImageMat().