# opentl::input::ImageSensor Class Reference

Inherits opentl::input::AbstractSensor.

Inherited by opentl::input::FirewireCamera, opentl::input::ImageSequence, opentl::input::OpenCVCamera, opentl::input::V4L2Camera, and opentl::input::VideoFile.

List of all members.

## Public Types
## Public Member Functions
virtual void | captureNext ()
| capture the next image from the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class
virtual void | captureStart ()
| start the capturing process of the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class
virtual void | captureStop ()
| stop the capturing process of the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class
const opentl::math::Vector & | distortion () const
| get the distortion parameters
virtual std::size_t | height () const
| Returns the height of the captured image.
virtual const opentl::core::cvdata::Image & | image ()
| returns current frame
| ImageSensor ()
const opentl::math::SquareMatrix & | k_3x3 () const
| Get calibration/intrinsic transformation matrix K as 3x3.
const opentl::math::Matrix & | k_3x4 () const
| Get calibration/intrinsic transformation matrix K as 3x4.
void | perspectiveProjection (const math::Vector4 &srcSensorP, math::Vector2 &dstScreenP, opentl::math::Vector3 &dstScreenP3d) const
| Perspective projection from sensor space to screen (intrinsic transformation) with homogeneous coordinates using K matrix.
void | perspectiveProjection (const math::Vector4 &srcSensorP, math::Vector2 &dstScreenP) const
| Perspective projection from sensor space to screen (intrinsic transformation) with homogeneous coordinates using K matrix.
void | projectionLayerSize (int &rx, int &ry, double &focus) const
| Get projection layer size of sensor (= camera image dimensions).
void | projectionLayerSize (int &rx, int &ry) const
| Get projection layer size of sensor (= camera image dimensions).
const math::Matrix & | projectionMatrix () const
| Get the projection matrix of the sensor ==> Intrinsic Matrix * Extrinsic Matrix return value is then the projection matrix of this sensor (3 x 4).
void | setDistortion (opentl::math::Vector &distortions)
| set the distortion parameters
void | setK (double f, double rx, double ry, double sigma=0)
| Set calibration / intrinsic transformation matrix K for 2D and 3D case.
void | setK_3x3 (const math::SquareMatrix &k3x3)
| (For convenience) this method sets the 3x3 k-matrix directly
void | setK_FxFy (double fx, double fy, double rx, double ry, double sigma=0)
| Set calibration / intrinsic transformation matrix K for 2D and 3D case.
virtual void | setSensorPosition (const opentl::math::Transform &T)
| Set the transform of the sensor.
virtual std::size_t | width () const
| Returns the width of the captured image.
virtual | ~ImageSensor ()
## Protected Attributes
math::Vector | mDistortion
opentl::core::cvdata::Image * | mFrame
std::size_t | mHeight
math::SquareMatrix | mK_3x3
math::Matrix | mK_3x4
math::Matrix | mP
std::size_t | mWidth

## Member Enumeration Documentation

enum opentl::input::ImageSensor::OfflineParameters

Enumerator:

  OFFLINE_COUNT |

Reimplemented from opentl::input::AbstractSensor.

Reimplemented in opentl::input::FirewireCamera, and opentl::input::V4L2Camera.

enum opentl::input::ImageSensor::OnlineParameters

Enumerator:

  ONLINE_COUNT |

Reimplemented from opentl::input::AbstractSensor.

Reimplemented in opentl::input::FirewireCamera, and opentl::input::V4L2Camera.

## Constructor & Destructor Documentation

opentl::input::ImageSensor::ImageSensor | ( |  | ) |

virtual opentl::input::ImageSensor::~ImageSensor | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual void opentl::input::ImageSensor::captureNext | ( |  | ) | `[virtual]`

capture the next image from the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class

Reimplemented in opentl::input::ImageSequence, opentl::input::LinuxDC1394Camera, opentl::input::OpenCVCamera, opentl::input::V4L2Camera, opentl::input::VideoFile, and opentl::input::WindowsCMU1394Camera.

virtual void opentl::input::ImageSensor::captureStart | ( |  | ) | `[virtual]`

start the capturing process of the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class

Reimplemented in opentl::input::ImageSequence, opentl::input::LinuxDC1394Camera, opentl::input::OpenCVCamera, opentl::input::V4L2Camera, opentl::input::VideoFile, and opentl::input::WindowsCMU1394Camera.

virtual void opentl::input::ImageSensor::captureStop | ( |  | ) | `[virtual]`

stop the capturing process of the image sensor (e.g. a camera) IMPORTANT: implement this method in your sensor class

Reimplemented in opentl::input::ImageSequence, opentl::input::LinuxDC1394Camera, opentl::input::OpenCVCamera, opentl::input::V4L2Camera, opentl::input::VideoFile, and opentl::input::WindowsCMU1394Camera.

const opentl::math::Vector& opentl::input::ImageSensor::distortion | ( |  | ) | const

get the distortion parameters

virtual std::size_t opentl::input::ImageSensor::height | ( |  | ) | const`[virtual]`

Returns the height of the captured image.

Returns:
  Height in pixel.

Returns the height of the last image

virtual const opentl::core::cvdata::Image& opentl::input::ImageSensor::image | ( |  | ) | `[virtual]`

returns current frame

Reimplemented in opentl::input::ImageSequence, opentl::input::LinuxDC1394Camera, opentl::input::OpenCVCamera, opentl::input::V4L2Camera, opentl::input::VideoFile, and opentl::input::WindowsCMU1394Camera.

const opentl::math::SquareMatrix& opentl::input::ImageSensor::k_3x3 | ( |  | ) | const

Get calibration/intrinsic transformation matrix K as 3x3.

const opentl::math::Matrix& opentl::input::ImageSensor::k_3x4 | ( |  | ) | const

Get calibration/intrinsic transformation matrix K as 3x4.

void opentl::input::ImageSensor::perspectiveProjection | ( | const math::Vector4 & | srcSensorP,
|  | math::Vector2 & | dstScreenP,
|  | opentl::math::Vector3 & | dstScreenP3d |
| ) |  |  | const

Perspective projection from sensor space to screen (intrinsic transformation) with homogeneous coordinates using K matrix.

Parameters:

  | srcSensorP | Homog. coordinate of Point in 3D sensor (camera) space
  | dstScreenP | 2D coordinate of projected point
  | dstScreenP3d | 3D coordinate of projected point (not homogeneous!)

void opentl::input::ImageSensor::perspectiveProjection | ( | const math::Vector4 & | srcSensorP,
|  | math::Vector2 & | dstScreenP |
| ) |  |  | const

Perspective projection from sensor space to screen (intrinsic transformation) with homogeneous coordinates using K matrix.

Parameters:

  | srcSensorP | Homog. coordinate of Point in 3D sensor (camera) space
  | dstScreenP | 2D coordinate of projected point

void opentl::input::ImageSensor::projectionLayerSize | ( | int & | rx,
|  | int & | ry,
|  | double & | focus |
| ) |  |  | const

Get projection layer size of sensor (= camera image dimensions).

Parameters:

  | rx | X-direction resolution
  | ry | Y-direction resolution
  | focus | Distance to focal point

void opentl::input::ImageSensor::projectionLayerSize | ( | int & | rx,
|  | int & | ry |
| ) |  |  | const

Get projection layer size of sensor (= camera image dimensions).

Parameters:

  | rx | X-direction resolution
  | ry | Y-direction resolution

const math::Matrix& opentl::input::ImageSensor::projectionMatrix | ( |  | ) | const

Get the projection matrix of the sensor ==> Intrinsic Matrix * Extrinsic Matrix return value is then the projection matrix of this sensor (3 x 4).

void opentl::input::ImageSensor::setDistortion | ( | opentl::math::Vector & | distortions | ) |

set the distortion parameters

void opentl::input::ImageSensor::setK | ( | double | f,
|  | double | rx,
|  | double | ry,
|  | double | sigma = `0` |
| ) |  |  |

Set calibration / intrinsic transformation matrix K for 2D and 3D case.

Parameters:

  | f | focus of uncalibrated camera, ATTENTION: in orthogonal projection case (for 2D poses) this value is set internally to 1.0
  | rx | width of projectionlayer
  | ry | height of projectionlayer
  | sigma | sigma (for pinhole = 0)

void opentl::input::ImageSensor::setK_3x3 | ( | const math::SquareMatrix & | k3x3 | ) |

(For convenience) this method sets the 3x3 k-matrix directly

void opentl::input::ImageSensor::setK_FxFy | ( | double | fx,
|  | double | fy,
|  | double | rx,
|  | double | ry,
|  | double | sigma = `0` |
| ) |  |  |

Set calibration / intrinsic transformation matrix K for 2D and 3D case.

Parameters:

  | fx | focus of uncalibrated camera (x-direction), ATTENTION: in orthogonal projection case (for 2D poses) this value is set internally to 1.0
  | fy | focus of uncalibrated camera (y-direction), ATTENTION: in orthogonal projection case (for 2D poses) this value is set internally to 1.0
  | rx | width of projectionlayer
  | ry | height of projectionlayer
  | sigma | sigma (for pinhole = 0)

virtual void opentl::input::ImageSensor::setSensorPosition | ( | const opentl::math::Transform & | T | ) | `[virtual]`

Set the transform of the sensor.

Parameters:

  | T | IMPORTANT: T is the transform FROM the sensor TO the world origin!

Reimplemented from opentl::input::AbstractSensor.

virtual std::size_t opentl::input::ImageSensor::width | ( |  | ) | const`[virtual]`

Returns the width of the captured image.

Returns:
  Width in pixel.

Returns the width of the last image

## Member Data Documentation

math::Vector opentl::input::ImageSensor::mDistortion`[protected]`

opentl::core::cvdata::Image* opentl::input::ImageSensor::mFrame`[protected]`

std::size_t opentl::input::ImageSensor::mHeight`[protected]`

math::SquareMatrix opentl::input::ImageSensor::mK_3x3`[protected]`

math::Matrix opentl::input::ImageSensor::mK_3x4`[protected]`

math::Matrix opentl::input::ImageSensor::mP`[protected]`

std::size_t opentl::input::ImageSensor::mWidth`[protected]`