Ocean
Ocean::Media::ImageSequenceStereoImageProvider Class Reference

This class implements a provider for stereo images which are extracted from two separate image sequences and poses/calibration file. More...

Inheritance diagram for Ocean::Media::ImageSequenceStereoImageProvider:

Public Types

typedef SampleMap< HomogenousMatrixD4TransformationMap
 Definition of a sample map holding 6-DOF transformations. More...
 

Public Member Functions

 ImageSequenceStereoImageProvider ()
 Creates an invalid provider object. More...
 
 ImageSequenceStereoImageProvider (ImageSequenceStereoImageProvider &&provider)
 Move constructor. More...
 
 ImageSequenceStereoImageProvider (const std::string &imageSequenceFilenameA, const std::string &imageSequenceFilenameB, const std::string &transformationsFilename, const double framesPerSecond=30.0)
 Creates a provider object for two image sequences and a poses/calibration file. More...
 
bool nextStereoImages (FisheyeCamera &fisheyeCameraA, FisheyeCamera &fisheyeCameraB, Frame &imageA, Frame &imageB, HomogenousMatrixD4 *world_T_device=nullptr, HomogenousMatrixD4 *device_T_cameraA=nullptr, HomogenousMatrixD4 *device_T_cameraB=nullptr, HomogenousMatricesD4 *world_T_leftHandJoints=nullptr, HomogenousMatricesD4 *world_T_rightHandJoints=nullptr, bool *abort=nullptr) override
 Returns the next stereo images from the provider, further optional transformations between device and world, and between cameras and device will be provided. More...
 
bool restart () override
 Restarts with the first pair of stereo images. More...
 
bool hasDeviceTransformations () const override
 Returns whether the provider has access to the transformations between device and world (world_T_device). More...
 
bool hasCameraTransformations () const override
 Returns whether the provider has access to the transformations between cameras and device (device_T_cameraA and device_T_cameraB). More...
 
bool isValid () const override
 Returns whether this provider can provide valid stereo images (e.g., whether the underlying resources are initialized and whether the source exists). More...
 
void release () override
 Releases all owned resources like e.g., the image sequence objects. More...
 
ImageSequenceStereoImageProvideroperator= (ImageSequenceStereoImageProvider &&provider)
 Move operator. More...
 
- Public Member Functions inherited from Ocean::Media::StereoImageProviderInterface
virtual ~StereoImageProviderInterface ()
 Destructs this interface. More...
 

Static Public Member Functions

static bool readTransformationsFile (const std::string &transformationsFilename, FisheyeCamera &fisheyeCameraA, FisheyeCamera &fisheyeCameraB, TransformationMap &map_world_T_device, TransformationMap &map_device_T_cameraA, TransformationMap &map_device_T_cameraB, const double framesPerSecond=30.0)
 Extracts the camera calibrations, the device transformations, and the camera transformations from a transformations file. More...
 

Protected Member Functions

 ImageSequenceStereoImageProvider (const ImageSequenceStereoImageProvider &provider)=delete
 Disabled copy constructor. More...
 
ImageSequenceStereoImageProvideroperator= (const ImageSequenceStereoImageProvider &provider)=delete
 Disabled assign operator. More...
 
- Protected Member Functions inherited from Ocean::Media::StereoImageProviderInterface
 StereoImageProviderInterface ()
 Protected default constructor. More...
 

Protected Attributes

ImageSequenceRef imageSequenceA_
 The first image sequence providing the images for the first stereo camera. More...
 
ImageSequenceRef imageSequenceB_
 The second image sequence providing the images for the first stereo camera. More...
 
FisheyeCamera fisheyeCameraA_
 The fisheye camera profile of the first camera. More...
 
FisheyeCamera fisheyeCameraB_
 The fisheye camera profile of the second camera. More...
 
TransformationMap map_world_T_device_
 The sample map transforming device to world. More...
 
TransformationMap map_device_T_cameraA_
 The sample map transforming the first camera to device. More...
 
TransformationMap map_device_T_cameraB_
 The sample map transforming the second camera to device. More...
 
double framesPerSecond_
 The number of frames per second, with range (0, infinity) More...
 

Detailed Description

This class implements a provider for stereo images which are extracted from two separate image sequences and poses/calibration file.

Member Typedef Documentation

◆ TransformationMap

Definition of a sample map holding 6-DOF transformations.

Constructor & Destructor Documentation

◆ ImageSequenceStereoImageProvider() [1/4]

Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider ( )

Creates an invalid provider object.

◆ ImageSequenceStereoImageProvider() [2/4]

Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider ( ImageSequenceStereoImageProvider &&  provider)

Move constructor.

Parameters
providerThe provider to be moved

◆ ImageSequenceStereoImageProvider() [3/4]

Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider ( const std::string &  imageSequenceFilenameA,
const std::string &  imageSequenceFilenameB,
const std::string &  transformationsFilename,
const double  framesPerSecond = 30.0 
)

Creates a provider object for two image sequences and a poses/calibration file.

Parameters
imageSequenceFilenameAThe filename of the first image of the first image sequence (the image sequence of the first fisheye camera), must be valid
imageSequenceFilenameBThe filename of the first image of the second image sequence (the image sequence of the second fisheye camera), must be valid
transformationsFilenameThe filename of the file containing the camera calibration of both fisheye cameras followed by the individual camera transformations
framesPerSecondThe number of frames per second, with range (0, infinity)

◆ ImageSequenceStereoImageProvider() [4/4]

Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider ( const ImageSequenceStereoImageProvider provider)
protecteddelete

Disabled copy constructor.

Parameters
providerThe provider which would have been copied

Member Function Documentation

◆ hasCameraTransformations()

bool Ocean::Media::ImageSequenceStereoImageProvider::hasCameraTransformations ( ) const
overridevirtual

Returns whether the provider has access to the transformations between cameras and device (device_T_cameraA and device_T_cameraB).

Returns
True, if so

Implements Ocean::Media::StereoImageProviderInterface.

◆ hasDeviceTransformations()

bool Ocean::Media::ImageSequenceStereoImageProvider::hasDeviceTransformations ( ) const
overridevirtual

Returns whether the provider has access to the transformations between device and world (world_T_device).

Returns
True, if so

Implements Ocean::Media::StereoImageProviderInterface.

◆ isValid()

bool Ocean::Media::ImageSequenceStereoImageProvider::isValid ( ) const
overridevirtual

Returns whether this provider can provide valid stereo images (e.g., whether the underlying resources are initialized and whether the source exists).

Returns
True, if so

Implements Ocean::Media::StereoImageProviderInterface.

◆ nextStereoImages()

bool Ocean::Media::ImageSequenceStereoImageProvider::nextStereoImages ( FisheyeCamera fisheyeCameraA,
FisheyeCamera fisheyeCameraB,
Frame imageA,
Frame imageB,
HomogenousMatrixD4 world_T_device = nullptr,
HomogenousMatrixD4 device_T_cameraA = nullptr,
HomogenousMatrixD4 device_T_cameraB = nullptr,
HomogenousMatricesD4 world_T_leftHandJoints = nullptr,
HomogenousMatricesD4 world_T_rightHandJoints = nullptr,
bool *  abort = nullptr 
)
overridevirtual

Returns the next stereo images from the provider, further optional transformations between device and world, and between cameras and device will be provided.

See also
StereoImageProviderInterface::nextStereoImages(), hasDeviceTransformations(), hasCameraTransformations().

Implements Ocean::Media::StereoImageProviderInterface.

◆ operator=() [1/2]

ImageSequenceStereoImageProvider& Ocean::Media::ImageSequenceStereoImageProvider::operator= ( const ImageSequenceStereoImageProvider provider)
protecteddelete

Disabled assign operator.

Parameters
providerThe provider which would have been assigned
Returns
Reference to this object

◆ operator=() [2/2]

ImageSequenceStereoImageProvider& Ocean::Media::ImageSequenceStereoImageProvider::operator= ( ImageSequenceStereoImageProvider &&  provider)

Move operator.

Parameters
providerThe provider to be moved
Returns
Reference to this object

◆ readTransformationsFile()

static bool Ocean::Media::ImageSequenceStereoImageProvider::readTransformationsFile ( const std::string &  transformationsFilename,
FisheyeCamera fisheyeCameraA,
FisheyeCamera fisheyeCameraB,
TransformationMap map_world_T_device,
TransformationMap map_device_T_cameraA,
TransformationMap map_device_T_cameraB,
const double  framesPerSecond = 30.0 
)
static

Extracts the camera calibrations, the device transformations, and the camera transformations from a transformations file.

The expected format can be outline as follows:

intrinsics of camera A
intrinsics of camera B
frame 1: world_T_device device_T_cameraA device_T_cameraB
frame 2: world_T_device device_T_cameraA device_T_cameraB
frame 3: world_T_device device_T_cameraA device_T_cameraB
...

or, more verbosely,

widthA heightA focalLengthXA focalLengthYA principalPointXA principalPointYA radialDistortionA[0] radialDistortionA[1] radialDistortionA[2] radialDistortionA[3] radialDistortionA[4] radialDistortionA[5] tangentialDistortionA[0] tangentialDistortionA[1]
widthB heightB focalLengthXB focalLengthYB principalPointXB principalPointYB radialDistortionB[0] radialDistortionB[1] radialDistortionB[2] radialDistortionB[3] radialDistortionB[4] radialDistortionB[5] tangentialDistortionB[0] tangentialDistortionB[1]
[wTd0] [wTd1] [wTd2] [wTd3] [wTd4] [wTd5] [wTd6] [wTd7] [wTd8] [wTd9] [wTd10] [wTd11] [wTd12] [wTd13] [wTd14] [wTd15] [dTa0] [dTa1] [dTa2] [dTa3] [dTa4] [dTa5] [dTa6] [dTa7] [dTa8] [dTa9] [dTa10] [dTa11] [dTa12] [dTa13] [dTa14] [dTa15] [dTb0] [dTb1] [dTb2] [dTb3] [dTb4] [dTb5] [dTb6] [dTb7] [dTb8] [dTb9] [dTb10] [dTb11] [dTb12] [dTb13] [dTb14] [dTb15]
[wTd0] [wTd1] [wTd2] [wTd3] [wTd4] [wTd5] [wTd6] [wTd7] [wTd8] [wTd9] [wTd10] [wTd11] [wTd12] [wTd13] [wTd14] [wTd15] [dTa0] [dTa1] [dTa2] [dTa3] [dTa4] [dTa5] [dTa6] [dTa7] [dTa8] [dTa9] [dTa10] [dTa11] [dTa12] [dTa13] [dTa14] [dTa15] [dTb0] [dTb1] [dTb2] [dTb3] [dTb4] [dTb5] [dTb6] [dTb7] [dTb8] [dTb9] [dTb10] [dTb11] [dTb12] [dTb13] [dTb14] [dTb15]
[wTd0] [wTd1] [wTd2] [wTd3] [wTd4] [wTd5] [wTd6] [wTd7] [wTd8] [wTd9] [wTd10] [wTd11] [wTd12] [wTd13] [wTd14] [wTd15] [dTa0] [dTa1] [dTa2] [dTa3] [dTa4] [dTa5] [dTa6] [dTa7] [dTa8] [dTa9] [dTa10] [dTa11] [dTa12] [dTa13] [dTa14] [dTa15] [dTb0] [dTb1] [dTb2] [dTb3] [dTb4] [dTb5] [dTb6] [dTb7] [dTb8] [dTb9] [dTb10] [dTb11] [dTb12] [dTb13] [dTb14] [dTb15]
...

where the first two rows contain the intrinsics of the two fisheye cameras, and starting with the third row each row stores three homogeneous 4-by-4 matrices which correspond to one frame. The matrix elements of each transformation are stored in column-major order, i.e.,

m = [m0 m4 m8 m12]
[m1 m5 m9 m13]
[m2 m6 m10 m14]
[m3 m7 m11 m15]
Parameters
transformationsFilenameThe filename of the transformations file, must be valid
fisheyeCameraAThe resulting profile of the first fisheye camera
fisheyeCameraBThe resulting profile of the second fisheye camera
map_world_T_deviceThe resulting sample map transforming device to world
map_device_T_cameraAThe resulting sample map transforming the first camera to device
map_device_T_cameraBThe resulting sample map transforming the second camera to device
framesPerSecondThe number of frames per second, with range (0, infinity)
Returns
True, if succeeded

◆ release()

void Ocean::Media::ImageSequenceStereoImageProvider::release ( )
overridevirtual

Releases all owned resources like e.g., the image sequence objects.

Implements Ocean::Media::StereoImageProviderInterface.

◆ restart()

bool Ocean::Media::ImageSequenceStereoImageProvider::restart ( )
overridevirtual

Restarts with the first pair of stereo images.

Returns
True, if succeeded

Implements Ocean::Media::StereoImageProviderInterface.

Field Documentation

◆ fisheyeCameraA_

FisheyeCamera Ocean::Media::ImageSequenceStereoImageProvider::fisheyeCameraA_
protected

The fisheye camera profile of the first camera.

◆ fisheyeCameraB_

FisheyeCamera Ocean::Media::ImageSequenceStereoImageProvider::fisheyeCameraB_
protected

The fisheye camera profile of the second camera.

◆ framesPerSecond_

double Ocean::Media::ImageSequenceStereoImageProvider::framesPerSecond_
protected

The number of frames per second, with range (0, infinity)

◆ imageSequenceA_

ImageSequenceRef Ocean::Media::ImageSequenceStereoImageProvider::imageSequenceA_
protected

The first image sequence providing the images for the first stereo camera.

◆ imageSequenceB_

ImageSequenceRef Ocean::Media::ImageSequenceStereoImageProvider::imageSequenceB_
protected

The second image sequence providing the images for the first stereo camera.

◆ map_device_T_cameraA_

TransformationMap Ocean::Media::ImageSequenceStereoImageProvider::map_device_T_cameraA_
protected

The sample map transforming the first camera to device.

◆ map_device_T_cameraB_

TransformationMap Ocean::Media::ImageSequenceStereoImageProvider::map_device_T_cameraB_
protected

The sample map transforming the second camera to device.

◆ map_world_T_device_

TransformationMap Ocean::Media::ImageSequenceStereoImageProvider::map_world_T_device_
protected

The sample map transforming device to world.


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