|
Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Calibrated camera for augmented reality. More...
#include <CalibratedCamera.hpp>
Inheritance diagram for vl::CalibratedCamera:Public Member Functions | |
| CalibratedCamera () | |
| void | setCalibratedImageSize (int width, int height, float pixelaspect=1.0) |
| Set the size of the image in pixels that was used while calibrating the camera model. More... | |
| void | setIntrinsicParameters (float fx, float fy, float cx, float cy) |
| Set the intrinsic parameters as determined from camera calibration. More... | |
| void | setScreenSize (int width, int height) |
| Usually you don't need to call this as the renderer takes care of keeping it up to date with whatever the current framebuffer size is. More... | |
| int | imageWidth () const |
| Image width in pixels. More... | |
| int | imageHeight () const |
| Image height in pixels. More... | |
| int | screenWidth () const |
| Image width in pixels. More... | |
| int | screenHeight () const |
| Screen height in pixels. More... | |
| float | pixelAspectRatio () const |
| The width of a single pixel divided by its height. More... | |
| void | updateCalibration () |
| Recomputes the projection matrix and viewport based on the calibration data specified by setCalibratedImageSize(), setScreenSize(), setIntrinsicParameters(), setNearPlane(), setFarPlane() More... | |
Public Member Functions inherited from vl::Camera | |
| Camera () | |
| Constructs a perspective projecting camera with FOV = 60.0, Near Plane = 0.05, Far Plane = 10000.0. More... | |
| void | computeNearFarOptimizedProjMatrix (const Sphere &scene_bounding_sphere) |
The near and far clipping planes are adjusted to fit the provided scene_bounding_sphere. More... | |
| void | computeFrustumPlanes () |
| Computes the Camera's frustum planes in world space. More... | |
| void | applyModelViewMatrix (const mat4 &model_matrix) const |
| Loads the GL_MODELVIEW matrix with the Camera's view matrix multiplied by the specified model matrix. More... | |
| void | applyViewMatrix () const |
| Loads the GL_MODELVIEW matrix with the Camera's view matrix. More... | |
| void | applyProjMatrix () const |
| Loads the GL_PROJECTION matrix with the Camera's projection matrix. More... | |
| real | aspectRatio () const |
| Returns the aspect ratio computed as viewport()->width()/viewport()->height(). More... | |
| void | setFOV (real fov) |
| The field of view of the camera. More... | |
| real | fov () const |
| The field of view of the camera. More... | |
| void | setNearPlane (real nearplane) |
| The near clipping plane. More... | |
| real | nearPlane () const |
| The near clipping plane. More... | |
| void | setFarPlane (real farplane) |
| The far clipping plane. More... | |
| real | farPlane () const |
| The far clipping plane. More... | |
| real | left () const |
| 'left' parameter as passed to the last setProjectionFrustum() or setProjectionOrtho*() More... | |
| void | setLeft (real v) |
| real | right () const |
| 'right' parameter as passed to the last setProjectionFrustum() or setProjectionOrtho*() More... | |
| void | setRight (real v) |
| real | bottom () const |
| 'bottom' parameter as passed to the last setProjectionFrustum() or setProjectionOrtho*() More... | |
| void | setBottom (real v) |
| real | top () const |
| 'top' parameter as passed to the last setProjectionFrustum() or setProjectionOrtho*() More... | |
| void | setTop (real v) |
| void | setFrustum (const Frustum &frustum) |
| The view frustum of the camera used to perform frustum culling. More... | |
| const Frustum & | frustum () const |
| The view frustum of the camera used to perform frustum culling. More... | |
| Frustum & | frustum () |
| The view frustum of the camera used to perform frustum culling. More... | |
| void | setViewport (Viewport *viewport) |
| The viewport bound to a camera. More... | |
| Viewport * | viewport () |
| The viewport bound to a camera. More... | |
| const Viewport * | viewport () const |
| The viewport bound to a camera. More... | |
| void | bindTransform (Transform *transform) |
| Bind the camera to a Transform. More... | |
| const Transform * | boundTransform () const |
| Returns the Transform bound to a camera. More... | |
| Transform * | boundTransform () |
| Returns the Transform bound to a camera. More... | |
| void | setViewMatrix (const mat4 &mat) |
| Sets the Camera's view matrix (inverse of the modeling matrix). More... | |
| const mat4 & | viewMatrix () const |
| Returns the Camera's view matrix (inverse of the modeling matrix). More... | |
| void | setModelingMatrix (const mat4 &mat) |
| Sets the Camera's modelingMatrix() (inverse of the view matrix). More... | |
| const mat4 & | modelingMatrix () const |
| Returns the Camera's modelingMatrix() (inverse of the view matrix). More... | |
| void | setProjectionMatrix (const mat4 &mat, EProjectionMatrixType proj_type) |
| The Camera's projection matrix. More... | |
| const mat4 & | projectionMatrix () const |
| The Camera's projection matrix. More... | |
| EProjectionMatrixType | projectionMatrixType () const |
| The Camera's projection matrix type. More... | |
| void | setProjectionPerspective () |
| Builds a perspective projection matrix for the Camera based on the Camera's and Viewport's settings. More... | |
| void | setProjectionPerspective (real fov, real near, real far) |
| Builds a perspective projection matrix for the Camera based on the Camera's and Viewport's settings. More... | |
| void | setProjectionFrustum (real left, real right, real bottom, real top, real znear, real zfar) |
| Produces a perspective projection matrix. More... | |
| void | setProjectionOrtho (real left, real right, real bottom, real top, real znear, real zfar) |
| Builds an orthographic projection matrix for the Camera based on the Camera's near/far planes and its Viewport's settings. More... | |
| void | setProjectionOrtho () |
| Builds an orthographic projection matrix for the Camera based on the Camera's near/far planes and its Viewport's settings. More... | |
| void | setProjectionOrtho (real offset) |
| Builds an orthographic projection matrix for the Camera based on the Camera's near/far planes and its Viewport's settings. More... | |
| void | setViewMatrixLookAt (const vec3 &eye, const vec3 &at, const vec3 &up) |
| Setup the modelview transform of the camera based on look-at parameters. More... | |
| void | getViewMatrixAsLookAt (vec3 &eye, vec3 &at, vec3 &up, vec3 &right) const |
| Returns the look-at parameters of the modelview transform. More... | |
| bool | project (const vec4 &in_world, vec4 &out_viewp) const |
| Projects a vector from world coordinates to viewport coordinates. More... | |
| bool | unproject (const vec3 &in_viewp, vec4 &out_world) const |
| Unprojects a vector from viewport coordinates to world coordinates. More... | |
| bool | unproject (std::vector< vec3 > &points) const |
| Unprojects a set of points. More... | |
| Ray | computeRay (int viewp_x, int viewp_y) |
| Computes the ray passing through the point <viewp_x,viewp_y>. More... | |
| Frustum | computeRayFrustum (int viewp_x, int viewp_y) |
| Computes a 1 pixel wide frustum suitable to cull objects during ray intersection detection. More... | |
| void | adjustView (const AABB &aabb, const vec3 &dir, const vec3 &up, real bias=1.0f) |
| Adjusts the camera position so that the given aabb can be properly viewed. More... | |
Public Member Functions inherited from vl::Object | |
| Object () | |
| Constructor. More... | |
| Object (const Object &other) | |
| Copy constructor: copies the name, ref count mutex and user data. More... | |
| Object & | operator= (const Object &other) |
| Copy operator: copies the object's name, ref count mutex and user data. More... | |
| const std::string & | objectName () const |
| The name of the object, by default set to the object's class name. More... | |
| void | setObjectName (const char *name) |
| The name of the object, by default set to the object's class name in debug builds. More... | |
| void | setObjectName (const std::string &name) |
| The name of the object, by default set to the object's class name in debug builds. More... | |
| void | setRefCountMutex (IMutex *mutex) |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| IMutex * | refCountMutex () |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| const IMutex * | refCountMutex () const |
| The mutex used to protect the reference counting of an Object across multiple threads. More... | |
| int | referenceCount () const |
| Returns the number of references of an object. More... | |
| void | incReference () const |
| Increments the reference count of an object. More... | |
| void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
| void | setAutomaticDelete (bool autodel_on) |
| If set to true the Object is deleted when its reference count reaches 0. More... | |
| bool | automaticDelete () const |
| If set to true the Object is deleted when its reference count reaches 0. More... | |
| template<class T > | |
| T * | as () |
| Casts an Object to the specified class. More... | |
| template<class T > | |
| const T * | as () const |
| Casts an Object to the specified class. More... | |
Protected Attributes | |
| int | mImageWidth |
| int | mImageHeight |
| int | mScreenWidth |
| int | mScreenHeight |
| float | mPixelAspectRatio |
| float | mFx |
| float | mFy |
| float | mCx |
| float | mCy |
Protected Attributes inherited from vl::Camera | |
| mat4 | mViewMatrix |
| mat4 | mModelingMatrix |
| mat4 | mProjectionMatrix |
| ref< Viewport > | mViewport |
| Frustum | mFrustum |
| ref< Transform > | mBoundTransform |
| real | mFOV |
| real | mLeft |
| real | mRight |
| real | mBottom |
| real | mTop |
| real | mNearPlane |
| real | mFarPlane |
| EProjectionMatrixType | mProjectionType |
Protected Attributes inherited from vl::Object | |
| std::string | mObjectName |
| IMutex * | mRefCountMutex |
| int | mReferenceCount |
| bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
| virtual | ~Object () |
Calibrated camera for augmented reality.
To use the CalibratedCamera keep the following in mind:
Definition at line 28 of file CalibratedCamera.hpp.
| CalibratedCamera::CalibratedCamera | ( | ) |
Definition at line 11 of file CalibratedCamera.cpp.
|
inline |
Image height in pixels.
Definition at line 75 of file CalibratedCamera.hpp.
|
inline |
Image width in pixels.
Definition at line 72 of file CalibratedCamera.hpp.
|
inline |
The width of a single pixel divided by its height.
Definition at line 84 of file CalibratedCamera.hpp.
|
inline |
Screen height in pixels.
Definition at line 81 of file CalibratedCamera.hpp.
|
inline |
Image width in pixels.
Definition at line 78 of file CalibratedCamera.hpp.
| void CalibratedCamera::setCalibratedImageSize | ( | int | width, |
| int | height, | ||
| float | pixelaspect = 1.0 |
||
| ) |
Set the size of the image in pixels that was used while calibrating the camera model.
Call updateCalibration() to apply the changes to the projection matrix.
| width | in pixels. |
| height | in pixels. |
| pixelaspect | is the width of a single pixel divided by its height. |
Definition at line 25 of file CalibratedCamera.cpp.
References mImageHeight, mImageWidth, and mPixelAspectRatio.
| void CalibratedCamera::setIntrinsicParameters | ( | float | fx, |
| float | fy, | ||
| float | cx, | ||
| float | cy | ||
| ) |
Set the intrinsic parameters as determined from camera calibration.
Call updateCalibration() to apply the changes to the projection matrix.
| fx | scale factor of combined focal length * effective pixel size in horizontal direction. |
| fy | scale factor of combined focal length * effective pixel size in vertical direction. |
| cx | centre of projection in x axis. |
| cy | centre of projection in y axis. |
Definition at line 38 of file CalibratedCamera.cpp.
| void CalibratedCamera::setScreenSize | ( | int | width, |
| int | height | ||
| ) |
Usually you don't need to call this as the renderer takes care of keeping it up to date with whatever the current framebuffer size is.
Set the screen/widget size currently used.
Call updateCalibration() to apply the changes to the projection matrix.
| width | in pixels. |
| height | in pixels. |
Definition at line 32 of file CalibratedCamera.cpp.
References mScreenHeight, and mScreenWidth.
| void CalibratedCamera::updateCalibration | ( | ) |
Recomputes the projection matrix and viewport based on the calibration data specified by setCalibratedImageSize(), setScreenSize(), setIntrinsicParameters(), setNearPlane(), setFarPlane()
Definition at line 46 of file CalibratedCamera.cpp.
References vl::Matrix4< T_Scalar >::e(), mCx, mCy, vl::Camera::mFarPlane, mFx, mFy, mImageHeight, mImageWidth, vl::Camera::mNearPlane, mPixelAspectRatio, mScreenHeight, mScreenWidth, vl::PMT_UserProjection, vl::Matrix4< T_Scalar >::ptr(), vl::Viewport::set(), vl::Matrix4< T_Scalar >::setNull(), vl::Camera::setProjectionMatrix(), and vl::Camera::viewport().
|
protected |
Definition at line 100 of file CalibratedCamera.hpp.
Referenced by setIntrinsicParameters(), and updateCalibration().
|
protected |
Definition at line 101 of file CalibratedCamera.hpp.
Referenced by setIntrinsicParameters(), and updateCalibration().
|
protected |
Definition at line 98 of file CalibratedCamera.hpp.
Referenced by setIntrinsicParameters(), and updateCalibration().
|
protected |
Definition at line 99 of file CalibratedCamera.hpp.
Referenced by setIntrinsicParameters(), and updateCalibration().
|
protected |
Definition at line 94 of file CalibratedCamera.hpp.
Referenced by setCalibratedImageSize(), and updateCalibration().
|
protected |
Definition at line 93 of file CalibratedCamera.hpp.
Referenced by setCalibratedImageSize(), and updateCalibration().
|
protected |
Definition at line 97 of file CalibratedCamera.hpp.
Referenced by setCalibratedImageSize(), and updateCalibration().
|
protected |
Definition at line 96 of file CalibratedCamera.hpp.
Referenced by setScreenSize(), and updateCalibration().
|
protected |
Definition at line 95 of file CalibratedCamera.hpp.
Referenced by setScreenSize(), and updateCalibration().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:48.
© Copyright Michele Bosi. All rights reserved.