Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Member Functions | Public Attributes
pcl::visualization::Camera Class Reference

Camera class holds a set of camera parameters together with the window pos/size. More...

#include <pcl/visualization/common/common.h>

Public Member Functions

void computeViewMatrix (Eigen::Matrix4d &view_mat) const
 Computes View matrix for Camera (Based on gluLookAt) More...
 
void computeProjectionMatrix (Eigen::Matrix4d &proj) const
 Computes Projection Matrix for Camera. More...
 
template<typename PointT >
void cvtWindowCoordinates (const PointT &pt, Eigen::Vector4d &window_cord) const
 converts point to window coordiantes More...
 
template<typename PointT >
void cvtWindowCoordinates (const PointT &pt, Eigen::Vector4d &window_cord, const Eigen::Matrix4d &composite_mat) const
 converts point to window coordiantes More...
 

Public Attributes

double focal [3]
 Focal point or lookAt. More...
 
double pos [3]
 Position of the camera. More...
 
double view [3]
 Up vector of the camera. More...
 
double clip [2]
 Clipping planes depths. More...
 
double fovy
 Field of view angle in y direction (radians). More...
 
double window_size [2]
 
double window_pos [2]
 

Detailed Description

Camera class holds a set of camera parameters together with the window pos/size.

Definition at line 148 of file common.h.

Member Function Documentation

void pcl::visualization::Camera::computeProjectionMatrix ( Eigen::Matrix4d &  proj) const

Computes Projection Matrix for Camera.

Parameters
[out]projthe resultant matrix

Referenced by cvtWindowCoordinates().

void pcl::visualization::Camera::computeViewMatrix ( Eigen::Matrix4d &  view_mat) const

Computes View matrix for Camera (Based on gluLookAt)

Parameters
[out]view_matthe resultant matrix

Referenced by cvtWindowCoordinates().

template<typename PointT >
void Camera::cvtWindowCoordinates ( const PointT pt,
Eigen::Vector4d &  window_cord 
) const

converts point to window coordiantes

Converts point to window coordinates.

Parameters
[in]ptxyz point to be converted
[out]window_cordvector containing the pts' window X,Y, Z and 1

This function computes the projection and view matrix every time. It is very inefficient to use this for every point in the point cloud!

Parameters
[in]ptxyz point to be converted
[out]window_cordvector containing the pts' window X,Y, Z and 1
Note
This function computes the projection and view matrix every time. It is very inefficient to use this for every point in the point cloud!

Definition at line 49 of file common.hpp.

References computeProjectionMatrix(), computeViewMatrix(), and view.

template<typename PointT >
void Camera::cvtWindowCoordinates ( const PointT pt,
Eigen::Vector4d &  window_cord,
const Eigen::Matrix4d &  composite_mat 
) const

converts point to window coordiantes

Parameters
[in]ptxyz point to be converted
[out]window_cordvector containing the pts' window X,Y, Z and 1
[in]composite_matcomposite transformation matrix (proj*view)

Use this function to compute window coordinates with a precomputed transformation function. The typical composite matrix will be the projection matrix * the view matrix. However, additional matrices like a camera disortion matrix can also be added.

Parameters
[in]ptxyz point to be converted
[out]window_cordvector containing the pts' window X,Y, Z and 1
[in]composite_matcomposite transformation matrix (proj*view)
Note
Use this function to compute window coordinates with a pre-computed transformation function. The typical composite matrix will be the projection matrix * the view matrix. However, additional matrices like a camera distortion matrix can also be added.

Definition at line 69 of file common.hpp.

References window_size.

Member Data Documentation

double pcl::visualization::Camera::clip[2]

Clipping planes depths.

clip[0] is near clipping plane, and clip [1] is the far clipping plane

Definition at line 166 of file common.h.

double pcl::visualization::Camera::focal[3]

Focal point or lookAt.

Note
The view direction can be obtained by (focal-pos).normalized ()

Definition at line 154 of file common.h.

double pcl::visualization::Camera::fovy

Field of view angle in y direction (radians).

Definition at line 169 of file common.h.

double pcl::visualization::Camera::pos[3]

Position of the camera.

Definition at line 157 of file common.h.

double pcl::visualization::Camera::view[3]

Up vector of the camera.

Note
Not to be confused with the view direction, bad naming here.

Definition at line 161 of file common.h.

Referenced by cvtWindowCoordinates().

double pcl::visualization::Camera::window_pos[2]

Definition at line 174 of file common.h.

double pcl::visualization::Camera::window_size[2]

Definition at line 173 of file common.h.

Referenced by cvtWindowCoordinates().


The documentation for this class was generated from the following files: