OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
okvis::cameras::NCameraSystem Class Reference

A class that assembles multiple cameras into a system of (potentially different) cameras. More...

#include <NCameraSystem.hpp>

Public Types

enum  DistortionType { Equidistant = 0, RadialTangential = 1, NoDistortion = 2, RadialTangential8 = 3 }
 The enumeration of the currently supported distortion types. More...
 

Public Member Functions

 NCameraSystem ()
 Default constructor. More...
 
 NCameraSystem (const std::vector< std::shared_ptr< const okvis::kinematics::Transformation >> &T_SC, const std::vector< std::shared_ptr< const cameras::CameraBase >> &cameraGeometries, const std::vector< DistortionType > &distortionTypes, bool computeOverlaps)
 Construct with vector of extrinsics and geometries. More...
 
virtual ~NCameraSystem ()
 Destructor that doesn't do anything really. More...
 
void reset (const std::vector< std::shared_ptr< const okvis::kinematics::Transformation >> &T_SC, const std::vector< std::shared_ptr< const cameras::CameraBase >> &cameraGeometries, const std::vector< DistortionType > &distortionTypes, bool computeOverlaps)
 Reset with vector of extrinsics and geometries. More...
 
void addCamera (std::shared_ptr< const okvis::kinematics::Transformation > T_SC, std::shared_ptr< const cameras::CameraBase > cameraGeometry, DistortionType distortionType, bool computeOverlaps=true)
 Append with a single camera. More...
 
size_t numCameras () const
 Obtatin the number of cameras currently added. More...
 
void computeOverlaps ()
 compute all the overlaps of fields of view. Attention: can be expensive. More...
 
std::shared_ptr< const
okvis::kinematics::Transformation
T_SC (size_t cameraIndex) const
 get the pose of the IMU frame S with respect to the camera cameraIndex More...
 
std::shared_ptr< const
cameras::CameraBase
cameraGeometry (size_t cameraIndex) const
 get the camera geometry of camera cameraIndex More...
 
DistortionType distortionType (size_t cameraIndex) const
 get the distortion type of the camera More...
 
const cv::Mat overlap (size_t cameraIndexSeenBy, size_t cameraIndex) const
 Get the overlap mask. Sorry for the weird syntax, but remember that cv::Mat is essentially a shared pointer. More...
 
bool hasOverlap (size_t cameraIndexSeenBy, size_t cameraIndex) const
 Can the first camera see parts of the FOV of the second camera? More...
 

Protected Member Functions

bool overlapComputationValid () const
 Use this to check overlapMats_ and overlaps_ have correct sizes. More...
 

Protected Attributes

std::vector< std::shared_ptr
< const
okvis::kinematics::Transformation > > 
T_SC_
 Mounting transformations from IMU. More...
 
std::vector< std::shared_ptr
< const cameras::CameraBase > > 
cameraGeometries_
 Camera geometries. More...
 
std::vector< DistortionTypedistortionTypes_
 
std::vector< std::vector
< cv::Mat > > 
overlapMats_
 Overlaps between cameras: mats. More...
 
std::vector< std::vector< bool > > overlaps_
 Overlaps between cameras: binary. More...
 

Detailed Description

A class that assembles multiple cameras into a system of (potentially different) cameras.

Member Enumeration Documentation

The enumeration of the currently supported distortion types.

Enumerator
Equidistant 

Use with okvis::cameras::EquidistantDistortion.

RadialTangential 

Use with okvis::cameras::RadialTangentialDistortion.

NoDistortion 
RadialTangential8 

Use with okvis::cameras::RadialTangentialDistortion.

Constructor & Destructor Documentation

okvis::cameras::NCameraSystem::NCameraSystem ( )
inline

Default constructor.

okvis::cameras::NCameraSystem::NCameraSystem ( const std::vector< std::shared_ptr< const okvis::kinematics::Transformation >> &  T_SC,
const std::vector< std::shared_ptr< const cameras::CameraBase >> &  cameraGeometries,
const std::vector< DistortionType > &  distortionTypes,
bool  computeOverlaps 
)
inline

Construct with vector of extrinsics and geometries.

Parameters
[in]T_SCa vector of extrinsics.
[in]cameraGeometriesa vector of camera geometries (same length as T_SC).
[in]distortionTypesa vector of distortion types (same length as T_SC).
[in]computeOverlapsIndicate, if the overlap computation (can take a while) should be performed.
okvis::cameras::NCameraSystem::~NCameraSystem ( )
inlinevirtual

Destructor that doesn't do anything really.

Member Function Documentation

void okvis::cameras::NCameraSystem::addCamera ( std::shared_ptr< const okvis::kinematics::Transformation T_SC,
std::shared_ptr< const cameras::CameraBase cameraGeometry,
DistortionType  distortionType,
bool  computeOverlaps = true 
)
inline

Append with a single camera.

Parameters
[in]T_SCextrinsics.
[in]cameraGeometryCamera geometry.
[in]distortionTypeDistortion type.
[in]computeOverlapsIndicate, if the overlap computation (can take a while) should be performed.
std::shared_ptr< const cameras::CameraBase > okvis::cameras::NCameraSystem::cameraGeometry ( size_t  cameraIndex) const
inline

get the camera geometry of camera cameraIndex

Parameters
[in]cameraIndexThe camera index for which the camera geometry should be returned.
Returns
The camera geometry.
void okvis::cameras::NCameraSystem::computeOverlaps ( )

compute all the overlaps of fields of view. Attention: can be expensive.

NCameraSystem::DistortionType okvis::cameras::NCameraSystem::distortionType ( size_t  cameraIndex) const
inline

get the distortion type of the camera

Parameters
[in]cameraIndexThe camera index for which the distortion type should be returned.
Returns
The distortion type
bool okvis::cameras::NCameraSystem::hasOverlap ( size_t  cameraIndexSeenBy,
size_t  cameraIndex 
) const
inline

Can the first camera see parts of the FOV of the second camera?

Parameters
[in]cameraIndexSeenByThe camera index for one camera.
[in]cameraIndexThe camera index for the other camera.
Returns
True, if there is at least one pixel of overlap.
size_t okvis::cameras::NCameraSystem::numCameras ( ) const
inline

Obtatin the number of cameras currently added.

Returns
The number of cameras.
const cv::Mat okvis::cameras::NCameraSystem::overlap ( size_t  cameraIndexSeenBy,
size_t  cameraIndex 
) const
inline

Get the overlap mask. Sorry for the weird syntax, but remember that cv::Mat is essentially a shared pointer.

Parameters
[in]cameraIndexSeenByThe camera index for one camera.
[in]cameraIndexThe camera index for the other camera.
Returns
The overlap mask image.
bool okvis::cameras::NCameraSystem::overlapComputationValid ( ) const
inlineprotected

Use this to check overlapMats_ and overlaps_ have correct sizes.

Returns
True, if valid.
void okvis::cameras::NCameraSystem::reset ( const std::vector< std::shared_ptr< const okvis::kinematics::Transformation >> &  T_SC,
const std::vector< std::shared_ptr< const cameras::CameraBase >> &  cameraGeometries,
const std::vector< DistortionType > &  distortionTypes,
bool  computeOverlaps 
)
inline

Reset with vector of extrinsics and geometries.

Parameters
[in]T_SCa vector of extrinsics.
[in]cameraGeometriesa vector of camera geometries (same length as T_SC).
[in]distortionTypesa vector of distortion types (same length as T_SC).
[in]computeOverlapsIndicate, if the overlap computation (can take a while) should be performed.
std::shared_ptr< const okvis::kinematics::Transformation > okvis::cameras::NCameraSystem::T_SC ( size_t  cameraIndex) const
inline

get the pose of the IMU frame S with respect to the camera cameraIndex

Parameters
[in]cameraIndexThe camera index for which the extrinsics should be returned.
Returns
T_SC, the extrinsics.

Member Data Documentation

std::vector<std::shared_ptr<const cameras::CameraBase> > okvis::cameras::NCameraSystem::cameraGeometries_
protected

Camera geometries.

std::vector<DistortionType> okvis::cameras::NCameraSystem::distortionTypes_
protected
std::vector<std::vector<cv::Mat> > okvis::cameras::NCameraSystem::overlapMats_
protected

Overlaps between cameras: mats.

std::vector<std::vector<bool> > okvis::cameras::NCameraSystem::overlaps_
protected

Overlaps between cameras: binary.

std::vector<std::shared_ptr<const okvis::kinematics::Transformation> > okvis::cameras::NCameraSystem::T_SC_
protected

Mounting transformations from IMU.


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