Ocean
Ocean::IO::CameraCalibrationManager Class Reference

This class implements a camera calibration manager as singleton. More...

Inheritance diagram for Ocean::IO::CameraCalibrationManager:

Data Structures

class  Device
 Device calibration object. More...
 

Public Types

enum  Priority { PRIORITY_LOW , PRIORITY_MEDIUM , PRIORITY_HIGH , PRIORITY_EXPLICIT }
 Definition of different priority values for the camera calibrations. More...
 
enum  Quality { QUALITY_EXACT , QUALITY_INTERPOLATED , QUALITY_DEFAULT }
 Definition of different calibration qualities. More...
 

Public Member Functions

bool registerCalibration (const std::string &camera, const unsigned int width, const unsigned int height, const Scalar fovX)
 Registers a new camera calibration. More...
 
bool registerCalibrationFile (const std::string &url)
 Registers a new camera calibration file. More...
 
bool registerCalibration (const std::string &camera, const PinholeCamera &calibration)
 Registers a new camera calibration. More...
 
bool registerAlias (const std::string &camera, const std::string &alias)
 Registers an alias camera name. More...
 
PinholeCamera camera (const std::string &device, const unsigned int width, const unsigned int height, Quality *quality=nullptr, const Scalar defaultFovX=Numeric::deg2rad(45)) const
 Returns a calibration for a specific device with a specific frame resolution. More...
 
bool hasCalibration (const std::string &device) const
 Returns whether this manager holds a valid camera profile for a specified device. More...
 

Protected Types

typedef std::map< std::string, DeviceDeviceMap
 Definition of a map mapping device names to device objects. More...
 
typedef std::map< std::string, std::string > AliasMap
 Definition of a map mapping alias device names to device names. More...
 

Protected Member Functions

 CameraCalibrationManager ()
 Creates a new manager. More...
 
 ~CameraCalibrationManager ()
 Destructs the manager. More...
 
- Protected Member Functions inherited from Ocean::Singleton< CameraCalibrationManager >
 Singleton ()=default
 Default constructor. More...
 

Protected Attributes

DeviceMap deviceMap_
 Map holding all registered devices. More...
 
AliasMap aliasMap_
 Map holding alias names. More...
 
Lock lock_
 The lock of this manager. More...
 

Friends

class Singleton< CameraCalibrationManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from Ocean::Singleton< CameraCalibrationManager >
static CameraCalibrationManager & get ()
 Returns a reference to the unique object. More...
 

Detailed Description

This class implements a camera calibration manager as singleton.


The manager organizes camera calibrations with different dimensions.

Member Typedef Documentation

◆ AliasMap

typedef std::map<std::string, std::string> Ocean::IO::CameraCalibrationManager::AliasMap
protected

Definition of a map mapping alias device names to device names.

◆ DeviceMap

typedef std::map<std::string, Device> Ocean::IO::CameraCalibrationManager::DeviceMap
protected

Definition of a map mapping device names to device objects.

Member Enumeration Documentation

◆ Priority

Definition of different priority values for the camera calibrations.

Enumerator
PRIORITY_LOW 

Low priority.

PRIORITY_MEDIUM 

Medium priority.

PRIORITY_HIGH 

High priority.

PRIORITY_EXPLICIT 

Explicit use priority.

◆ Quality

Definition of different calibration qualities.

Enumerator
QUALITY_EXACT 

Exact calibration.

QUALITY_INTERPOLATED 

Interpolated calibration.

QUALITY_DEFAULT 

Default calibration.

Constructor & Destructor Documentation

◆ CameraCalibrationManager()

Ocean::IO::CameraCalibrationManager::CameraCalibrationManager ( )
protected

Creates a new manager.

◆ ~CameraCalibrationManager()

Ocean::IO::CameraCalibrationManager::~CameraCalibrationManager ( )
protected

Destructs the manager.

Member Function Documentation

◆ camera()

PinholeCamera Ocean::IO::CameraCalibrationManager::camera ( const std::string &  device,
const unsigned int  width,
const unsigned int  height,
Quality quality = nullptr,
const Scalar  defaultFovX = Numeric::deg2rad(45) 
) const

Returns a calibration for a specific device with a specific frame resolution.

Parameters
deviceName of the device
widthThe width of the frame in pixel, with range [1, infinity)
heightThe height of the frame in pixel, with range [1, infinity)
qualityOptional resulting quality of the calibration
defaultFovXThe default horizontal field of view the resulting camera profile will provide if no camera calibration exists for the specified device, with range (0, PI)
Returns
The camera profile for the given resolution

◆ hasCalibration()

bool Ocean::IO::CameraCalibrationManager::hasCalibration ( const std::string &  device) const

Returns whether this manager holds a valid camera profile for a specified device.

Parameters
deviceThe name of the device to check
Returns
True, if so

◆ registerAlias()

bool Ocean::IO::CameraCalibrationManager::registerAlias ( const std::string &  camera,
const std::string &  alias 
)

Registers an alias camera name.

Parameters
cameraOriginal camera name
aliasAlias camera name
Returns
True, if succeeded

◆ registerCalibration() [1/2]

bool Ocean::IO::CameraCalibrationManager::registerCalibration ( const std::string &  camera,
const PinholeCamera calibration 
)

Registers a new camera calibration.

This explicit calibration will receive the highest priority.

Parameters
cameraName of the device or camera
calibrationThe camera calibration profile
Returns
True, if succeeded

◆ registerCalibration() [2/2]

bool Ocean::IO::CameraCalibrationManager::registerCalibration ( const std::string &  camera,
const unsigned int  width,
const unsigned int  height,
const Scalar  fovX 
)

Registers a new camera calibration.

Parameters
cameraName or url of the camera to register
widthThe width of the camera resolution in pixel, with range [1, infinity)
heightThe height of the camera resolution in pixel, with range [1, infinity)
fovXHorizontal field of view in radian, with range (0, PI)
Returns
True, if succeeded

◆ registerCalibrationFile()

bool Ocean::IO::CameraCalibrationManager::registerCalibrationFile ( const std::string &  url)

Registers a new camera calibration file.

The file must have a specific file format.

Parameters
urlUrl of the calibration file
Returns
True, if succeeded

Friends And Related Function Documentation

◆ Singleton< CameraCalibrationManager >

friend class Singleton< CameraCalibrationManager >
friend

Field Documentation

◆ aliasMap_

AliasMap Ocean::IO::CameraCalibrationManager::aliasMap_
protected

Map holding alias names.

◆ deviceMap_

DeviceMap Ocean::IO::CameraCalibrationManager::deviceMap_
protected

Map holding all registered devices.

◆ lock_

Lock Ocean::IO::CameraCalibrationManager::lock_
mutableprotected

The lock of this manager.


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