Ocean
|
This class implements a camera calibration manager as singleton. More...
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, Device > | DeviceMap |
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... | |
This class implements a camera calibration manager as singleton.
The manager organizes camera calibrations with different dimensions.
|
protected |
Definition of a map mapping alias device names to device names.
|
protected |
Definition of a map mapping device names to device objects.
|
protected |
Creates a new manager.
|
protected |
Destructs the manager.
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.
device | Name of the device |
width | The width of the frame in pixel, with range [1, infinity) |
height | The height of the frame in pixel, with range [1, infinity) |
quality | Optional resulting quality of the calibration |
defaultFovX | The default horizontal field of view the resulting camera profile will provide if no camera calibration exists for the specified device, with range (0, PI) |
bool Ocean::IO::CameraCalibrationManager::hasCalibration | ( | const std::string & | device | ) | const |
Returns whether this manager holds a valid camera profile for a specified device.
device | The name of the device to check |
bool Ocean::IO::CameraCalibrationManager::registerAlias | ( | const std::string & | camera, |
const std::string & | alias | ||
) |
Registers an alias camera name.
camera | Original camera name |
alias | Alias camera name |
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.
camera | Name of the device or camera |
calibration | The camera calibration profile |
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.
camera | Name or url of the camera to register |
width | The width of the camera resolution in pixel, with range [1, infinity) |
height | The height of the camera resolution in pixel, with range [1, infinity) |
fovX | Horizontal field of view in radian, with range (0, PI) |
bool Ocean::IO::CameraCalibrationManager::registerCalibrationFile | ( | const std::string & | url | ) |
Registers a new camera calibration file.
The file must have a specific file format.
url | Url of the calibration file |
|
friend |
|
protected |
Map holding alias names.
|
protected |
Map holding all registered devices.
|
mutableprotected |
The lock of this manager.