Ocean
|
This class implements a provider for stereo images which are extracted from two separate image sequences and poses/calibration file. More...
Public Types | |
typedef SampleMap< HomogenousMatrixD4 > | TransformationMap |
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... | |
ImageSequenceStereoImageProvider & | operator= (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... | |
ImageSequenceStereoImageProvider & | operator= (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... | |
This class implements a provider for stereo images which are extracted from two separate image sequences and poses/calibration file.
typedef SampleMap<HomogenousMatrixD4> Ocean::Media::ImageSequenceStereoImageProvider::TransformationMap |
Definition of a sample map holding 6-DOF transformations.
Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider | ( | ) |
Creates an invalid provider object.
Ocean::Media::ImageSequenceStereoImageProvider::ImageSequenceStereoImageProvider | ( | ImageSequenceStereoImageProvider && | provider | ) |
Move constructor.
provider | The provider to be moved |
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.
imageSequenceFilenameA | The filename of the first image of the first image sequence (the image sequence of the first fisheye camera), must be valid |
imageSequenceFilenameB | The filename of the first image of the second image sequence (the image sequence of the second fisheye camera), must be valid |
transformationsFilename | The filename of the file containing the camera calibration of both fisheye cameras followed by the individual camera transformations |
framesPerSecond | The number of frames per second, with range (0, infinity) |
|
protecteddelete |
Disabled copy constructor.
provider | The provider which would have been copied |
|
overridevirtual |
Returns whether the provider has access to the transformations between cameras and device (device_T_cameraA and device_T_cameraB).
Implements Ocean::Media::StereoImageProviderInterface.
|
overridevirtual |
Returns whether the provider has access to the transformations between device and world (world_T_device).
Implements Ocean::Media::StereoImageProviderInterface.
|
overridevirtual |
Returns whether this provider can provide valid stereo images (e.g., whether the underlying resources are initialized and whether the source exists).
Implements Ocean::Media::StereoImageProviderInterface.
|
overridevirtual |
Returns the next stereo images from the provider, further optional transformations between device and world, and between cameras and device will be provided.
Implements Ocean::Media::StereoImageProviderInterface.
|
protecteddelete |
Disabled assign operator.
provider | The provider which would have been assigned |
ImageSequenceStereoImageProvider& Ocean::Media::ImageSequenceStereoImageProvider::operator= | ( | ImageSequenceStereoImageProvider && | provider | ) |
Move operator.
provider | The provider to be moved |
|
static |
Extracts the camera calibrations, the device transformations, and the camera transformations from a transformations file.
The expected format can be outline as follows:
or, more verbosely,
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.,
transformationsFilename | The filename of the transformations file, must be valid |
fisheyeCameraA | The resulting profile of the first fisheye camera |
fisheyeCameraB | The resulting profile of the second fisheye camera |
map_world_T_device | The resulting sample map transforming device to world |
map_device_T_cameraA | The resulting sample map transforming the first camera to device |
map_device_T_cameraB | The resulting sample map transforming the second camera to device |
framesPerSecond | The number of frames per second, with range (0, infinity) |
|
overridevirtual |
Releases all owned resources like e.g., the image sequence objects.
Implements Ocean::Media::StereoImageProviderInterface.
|
overridevirtual |
Restarts with the first pair of stereo images.
Implements Ocean::Media::StereoImageProviderInterface.
|
protected |
The fisheye camera profile of the first camera.
|
protected |
The fisheye camera profile of the second camera.
|
protected |
The number of frames per second, with range (0, infinity)
|
protected |
The first image sequence providing the images for the first stereo camera.
|
protected |
The second image sequence providing the images for the first stereo camera.
|
protected |
The sample map transforming the first camera to device.
|
protected |
The sample map transforming the second camera to device.
|
protected |
The sample map transforming device to world.