RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
StereoCameraModel Class Reference

The Camera class defines a general interface to a stereo camera. A stereo camera consists of two cameras with the same intrinsic parameters, but with different extrinsic parameters. More...

#include <StereoCameraModel.hpp>

Inherits SensorModel.

Public Types

enum  CalibrationFormat { OPENCV }
 output calibration file format for SaveCalibration()
 
enum  FOVDirection { HORIZONTAL , VERTICAL }
 FOV direction.
 
typedef rw::core::Ptr< StereoCameraModelPtr
 smart pointer type to this class
 
- Public Types inherited from SensorModel
typedef rw::core::Ptr< SensorModelPtr
 smart pointer type
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 StereoCameraModel (const std::string &name, double fov, double width, double height, const rw::math::Transform3D<> &TL, const rw::math::Transform3D<> &TR, rw::core::Ptr< rw::kinematics::Frame > frame, const std::string &modelInfo="")
 constructor More...
 
virtual ~StereoCameraModel ()
 destructor
 
Image::Ptr getLeftImage (const rw::kinematics::State &state)
 get left image
 
void setLeftImage (Image::Ptr img, rw::kinematics::State &state)
 set left image
 
Image::Ptr getRightImage (const rw::kinematics::State &state)
 get right image
 
void setRightImage (Image::Ptr img, rw::kinematics::State &state)
 set right image
 
- Public Member Functions inherited from SensorModel
 SensorModel (const std::string &name, rw::core::Ptr< kinematics::Frame > frame)
 constructor More...
 
 SensorModel (const std::string &name, rw::core::Ptr< kinematics::Frame > frame, const std::string &description)
 constructor More...
 
virtual ~SensorModel ()
 destructor
 
void setName (const std::string &name)
 sets the name of this sensor More...
 
void setDescription (const std::string &description)
 sets the description of this sensor More...
 
const std::string & getName () const
 returns the name of this sensor More...
 
const std::string & getDescription () const
 returns a description of this sensor More...
 
kinematics::FramegetFrame () const
 The frame to which the sensor is attached. More...
 
virtual void attachTo (rw::core::Ptr< kinematics::Frame > frame)
 Sets the frame to which the sensor should be attached. More...
 
rw::core::PropertyMapgetPropertyMap ()
 gets the propertymap of this sensor
 
const rw::core::PropertyMapgetPropertyMap () const
 gets the propertymap of this sensor
 
- Public Member Functions inherited from Stateless
virtual ~Stateless ()
 destructor
 
virtual void registerIn (State &state)
 initialize this stateless data to a specific state More...
 
virtual void registerIn (StateStructure::Ptr state)
 register this stateless object in a statestructure.
 
virtual void unregister ()
 unregisters all state data of this stateless object
 
StateStructure::Ptr getStateStructure ()
 Get the state structure. More...
 
const StateStructure::Ptr getStateStructure () const
 Get the state structure. More...
 
bool isRegistered ()
 Check if object has registered its state. More...
 

Static Public Member Functions

static bool SaveCalibration (const std::string &filename, double fov, double wx, double wy, const rw::math::Transform3D<> &TL, const rw::math::Transform3D<> &TR, FOVDirection direction=HORIZONTAL, CalibrationFormat format=OPENCV)
 utility function for saving a stereo calibration to a file More...
 
static void WriteCalibration (std::ostream &os, double fov, double wx, double wy, const rw::math::Transform3D<> &T, const std::vector< double > &dist=std::vector< double >(4, 0.0), FOVDirection direction=HORIZONTAL, CalibrationFormat format=OPENCV)
 utility function for writing a camera calibration to a stream More...
 

Additional Inherited Members

- Protected Member Functions inherited from Stateless
 Stateless ()
 constructor
 
template<class T >
void add (StatelessData< T > &data)
 implementations of sensor should add all their stateless data on initialization
 
void add (StateData *data)
 Add data. More...
 
void add (rw::core::Ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 
- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< rw::core::Ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

The Camera class defines a general interface to a stereo camera. A stereo camera consists of two cameras with the same intrinsic parameters, but with different extrinsic parameters.

Since ideal cameras are assumed, the intrinsics are given as a horizontal/vertical pixel resolution as well as a horizontal field of view (FOV).

The extrinsic parameters are given simply as two transformation matrices, which give the pose of the cameras relative some external frame.

Constructor & Destructor Documentation

◆ StereoCameraModel()

StereoCameraModel ( const std::string &  name,
double  fov,
double  width,
double  height,
const rw::math::Transform3D<> &  TL,
const rw::math::Transform3D<> &  TR,
rw::core::Ptr< rw::kinematics::Frame frame,
const std::string &  modelInfo = "" 
)

constructor

Parameters
name[in] name of sensor
fov[in] horizontal field of view
width[in] width of image
height[in] height of image
TL[in] transform from sensor frame to left camera frame
TR[in] transform from sensor frame to right camera frame
frame[in] sensor frame
modelInfo[in] info string

Member Function Documentation

◆ SaveCalibration()

static bool SaveCalibration ( const std::string &  filename,
double  fov,
double  wx,
double  wy,
const rw::math::Transform3D<> &  TL,
const rw::math::Transform3D<> &  TR,
FOVDirection  direction = HORIZONTAL,
CalibrationFormat  format = OPENCV 
)
static

utility function for saving a stereo calibration to a file

Parameters
filename[in] file to save to
fov[in] field of view (FOV) [rad]
wx[in] horizontal pixels
wy[in] vertical pixels
TL[in] transformation of left camera frame
TR[in] transformation of right camera frame
direction[in] the direction of the specified FOV
format[in] calibration file format to use
Returns
true if the file was successfully saved, false otherwise

◆ WriteCalibration()

static void WriteCalibration ( std::ostream &  os,
double  fov,
double  wx,
double  wy,
const rw::math::Transform3D<> &  T,
const std::vector< double > &  dist = std::vector< double >(4, 0.0),
FOVDirection  direction = HORIZONTAL,
CalibrationFormat  format = OPENCV 
)
static

utility function for writing a camera calibration to a stream

Parameters
osthe stream to write to
fovfield of view (FOV) [rad]
wxhorizontal pixels
wyvertical pixels
T[in] transformation of the camera frame
dist[in] distortion parameters
direction[in] the direction of the specified FOV
format[in] calibration file format to use

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