Ocean
Ocean::Test::TestGeometry::Utilities Class Reference

This class implements utility functions for the geometry test library. More...

Static Public Member Functions

static Vectors2 imagePoints (const PinholeCamera &pinholeCamera, const size_t number, RandomGenerator *randomGenerator=nullptr)
 Creates a set of image points that are located inside a camera frame. More...
 
static Vectors3 objectPoints (const Box3 &boundingBox, const size_t number, RandomGenerator *randomGenerator=nullptr)
 Creates a set of object points that are located inside a specified bounding box. More...
 
static HomogenousMatrix4 viewPosition (const PinholeCamera &pinholeCamera, const Sphere3 &boundingSphere, const Vector3 &viewingDirection)
 Deprecated. More...
 
template<typename T >
static HomogenousMatrixT4< T > viewPosition (const AnyCameraT< T > &anyCamera, const SphereT3< T > &boundingSphere, const VectorT3< T > &viewingDirection)
 Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame. More...
 
static HomogenousMatrix4 viewPosition (const PinholeCamera &pinholeCamera, const Vectors3 &objectPoints, const Vector3 &viewingDirection, const bool circumcircle=true)
 Deprecated. More...
 
template<typename T >
static HomogenousMatrixT4< T > viewPosition (const AnyCameraT< T > &anyCamera, const VectorsT3< T > &objectPoints, const VectorT3< T > &viewingDirection, const bool circumcircle=true)
 Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame. More...
 
static HomogenousMatrix4 viewPosition (const PinholeCamera &pinholeCamera, const Vectors3 &objectPoints, const bool circumcircle=true, RandomGenerator *randomGenerator=nullptr)
 Deprecated. More...
 
template<typename T >
static HomogenousMatrixT4< T > viewPosition (const AnyCameraT< T > &anyCamera, const VectorsT3< T > &objectPoints, const bool circumcircle=true, RandomGenerator *randomGenerator=nullptr)
 Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame. More...
 
static PinholeCamera distortedCamera (const PinholeCamera &pinholeCamera, const bool principalPointDistortion=true, const bool radialDistortion=true, const bool tangentialDistortion=true, RandomGenerator *randomGenerator=nullptr, const Scalar maximalPrincipalPointOffset=Scalar(20), const Scalar maximalRadialDistortion=Scalar(0.1), const Scalar maximalTangentialDistortion=Scalar(0.01))
 Modifies a provided camera and adds random radial and tangential distortion. More...
 
template<typename T = Scalar>
static PinholeCameraT< T > realisticPinholeCamera (const unsigned int index=0u)
 Returns one of two realistic pinhole camera profiles. More...
 
template<typename T = Scalar>
static FisheyeCameraT< T > realisticFisheyeCamera (const unsigned int index=0u)
 Returns one of two realistic fisheye camera profiles. More...
 
template<typename T = Scalar>
static SharedAnyCameraT< T > realisticAnyCamera (const AnyCameraType anyCameraType, const unsigned int index=0u)
 Returns one of two realistic camera profiles provided as an AnyCamera object. More...
 
static std::vector< AnyCameraTyperealisticCameraTypes ()
 Returns all camera types for which a realistic camera object can be accessed. More...
 
static IndexSet32 randomIndices (const size_t size, const size_t randomIndices, RandomGenerator *randomGenerator=nullptr)
 Creates a set of random indices. More...
 

Detailed Description

This class implements utility functions for the geometry test library.

Member Function Documentation

◆ distortedCamera()

static PinholeCamera Ocean::Test::TestGeometry::Utilities::distortedCamera ( const PinholeCamera pinholeCamera,
const bool  principalPointDistortion = true,
const bool  radialDistortion = true,
const bool  tangentialDistortion = true,
RandomGenerator randomGenerator = nullptr,
const Scalar  maximalPrincipalPointOffset = Scalar(20),
const Scalar  maximalRadialDistortion = Scalar(0.1),
const Scalar  maximalTangentialDistortion = Scalar(0.01) 
)
static

Modifies a provided camera and adds random radial and tangential distortion.

Parameters
pinholeCameraThe pinhole camera object that will be modified
principalPointDistortionTrue, to modify the principal point
radialDistortionTrue, to modify the radial distortion
tangentialDistortionTrue, to modify the tangential distortion
randomGeneratorOptional random generator, nullptr to use a default random generator
maximalPrincipalPointOffsetMaximal offset of the principal point, with range [0, infinity)
maximalRadialDistortionMaximal radial distortion, with range [0, infinity)
maximalTangentialDistortionMaximal tangential distortion, with range [0, infinity)
Returns
Resulting modified camera

◆ imagePoints()

static Vectors2 Ocean::Test::TestGeometry::Utilities::imagePoints ( const PinholeCamera pinholeCamera,
const size_t  number,
RandomGenerator randomGenerator = nullptr 
)
static

Creates a set of image points that are located inside a camera frame.

Parameters
pinholeCameraThe pinhole camera profile that is applied
numberThe number of the resulting image points, with range [1, infinity)
randomGeneratorOptional random generator
Returns
Resulting 2D image points

◆ objectPoints()

static Vectors3 Ocean::Test::TestGeometry::Utilities::objectPoints ( const Box3 boundingBox,
const size_t  number,
RandomGenerator randomGenerator = nullptr 
)
static

Creates a set of object points that are located inside a specified bounding box.

Parameters
boundingBox3D bounding box
numberThe number of the resulting object points, with range [1, infinity)
randomGeneratorOptional random generator
Returns
Resulting 3D object points

◆ randomIndices()

static IndexSet32 Ocean::Test::TestGeometry::Utilities::randomIndices ( const size_t  size,
const size_t  randomIndices,
RandomGenerator randomGenerator = nullptr 
)
static

Creates a set of random indices.

Parameters
sizeThe size of the entire element, with range [1, infinity)
randomIndicesNumber of random indices, with range [1, size]
randomGeneratorOptional random generator

◆ realisticAnyCamera()

template<typename T = Scalar>
static SharedAnyCameraT<T> Ocean::Test::TestGeometry::Utilities::realisticAnyCamera ( const AnyCameraType  anyCameraType,
const unsigned int  index = 0u 
)
static

Returns one of two realistic camera profiles provided as an AnyCamera object.

Parameters
anyCameraTypeThe type of the camera to be created, must be valid
indexThe index of the camera profile to be returned, with range [0, 1]
Returns
The realistic camera profile
Template Parameters
TThe data type of the scalar to be used, either 'float' or 'double'

◆ realisticCameraTypes()

static std::vector<AnyCameraType> Ocean::Test::TestGeometry::Utilities::realisticCameraTypes ( )
static

Returns all camera types for which a realistic camera object can be accessed.

Returns
The available camera types

◆ realisticFisheyeCamera()

template<typename T = Scalar>
static FisheyeCameraT<T> Ocean::Test::TestGeometry::Utilities::realisticFisheyeCamera ( const unsigned int  index = 0u)
static

Returns one of two realistic fisheye camera profiles.

Parameters
indexThe index of the camera profile to be returned, with range [0, 1]
Template Parameters
TThe data type of the scalar to be used, either 'float' or 'double'
Returns
The realistic camera profile

◆ realisticPinholeCamera()

template<typename T = Scalar>
static PinholeCameraT<T> Ocean::Test::TestGeometry::Utilities::realisticPinholeCamera ( const unsigned int  index = 0u)
static

Returns one of two realistic pinhole camera profiles.

Parameters
indexThe index of the camera profile to be returned, with range [0, 1]
Returns
The realistic camera profile
Template Parameters
TThe data type of the scalar to be used, either 'float' or 'double'

◆ viewPosition() [1/6]

template<typename T >
static HomogenousMatrixT4<T> Ocean::Test::TestGeometry::Utilities::viewPosition ( const AnyCameraT< T > &  anyCamera,
const SphereT3< T > &  boundingSphere,
const VectorT3< T > &  viewingDirection 
)
static

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
anyCameraThe camera profile defining the projection, must be valid
boundingSphereBounding sphere that has to be visible in the final view, can have radius 0, must be valid
viewingDirectionViewing direction of the resulting camera with unit length
Returns
Resulting camera pose, transforming camera to world (world_T_camera)
Template Parameters
TThe data type of the scalar to use, either 'float' or 'double'

◆ viewPosition() [2/6]

template<typename T >
static HomogenousMatrixT4<T> Ocean::Test::TestGeometry::Utilities::viewPosition ( const AnyCameraT< T > &  anyCamera,
const VectorsT3< T > &  objectPoints,
const bool  circumcircle = true,
RandomGenerator randomGenerator = nullptr 
)
static

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
anyCameraThe camera profile defining the projection, must be valid
objectPointsObject points for that the camera position will be determined
circumcircleTrue, to ensure that all object points will project into the frame, otherwise some sole points will project outside the image frame
randomGeneratorOptional random generator
Returns
Resulting camera pose, transforming camera to world (world_T_camera)
Template Parameters
TThe data type of the scalar to use, either 'float' or 'double'

◆ viewPosition() [3/6]

template<typename T >
static HomogenousMatrixT4<T> Ocean::Test::TestGeometry::Utilities::viewPosition ( const AnyCameraT< T > &  anyCamera,
const VectorsT3< T > &  objectPoints,
const VectorT3< T > &  viewingDirection,
const bool  circumcircle = true 
)
static

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
anyCameraThe camera profile defining the projection, must be valid
objectPointsObject points for that the camera position will be determined
viewingDirectionViewing direction of the resulting camera with unit length
circumcircleTrue, to ensure that all object points will project into the frame, otherwise some sole points will project outside the image frame
Returns
Resulting camera pose, transforming camera to world (world_T_camera)
Template Parameters
TThe data type of the scalar to use, either 'float' or 'double'

◆ viewPosition() [4/6]

static HomogenousMatrix4 Ocean::Test::TestGeometry::Utilities::viewPosition ( const PinholeCamera pinholeCamera,
const Sphere3 boundingSphere,
const Vector3 viewingDirection 
)
static

Deprecated.

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
pinholeCameraThe pinhole camera profile defining the projection, must be valid
boundingSphereBounding sphere that has to be visible in the final view, can have radius 0, must be valid
viewingDirectionViewing direction of the resulting camera with unit length
Returns
Resulting camera pose, transforming camera to world (world_T_camera)

◆ viewPosition() [5/6]

static HomogenousMatrix4 Ocean::Test::TestGeometry::Utilities::viewPosition ( const PinholeCamera pinholeCamera,
const Vectors3 objectPoints,
const bool  circumcircle = true,
RandomGenerator randomGenerator = nullptr 
)
static

Deprecated.

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
pinholeCameraThe pinhole camera profile defining the projection, must be valid
objectPointsObject points for that the camera position will be determined
circumcircleTrue, to ensure that all object points will project into the frame, otherwise some sole points will project outside the image frame
randomGeneratorOptional random generator
Returns
Resulting camera pose, transforming camera to world (world_T_camera)

◆ viewPosition() [6/6]

static HomogenousMatrix4 Ocean::Test::TestGeometry::Utilities::viewPosition ( const PinholeCamera pinholeCamera,
const Vectors3 objectPoints,
const Vector3 viewingDirection,
const bool  circumcircle = true 
)
static

Deprecated.

Determines a viewing position for a given camera for a set of 3D object points so that all point project into the camera frame.

Parameters
pinholeCameraThe pinhole camera profile defining the projection, must be valid
objectPointsObject points for that the camera position will be determined
viewingDirectionViewing direction of the resulting camera with unit length
circumcircleTrue, to ensure that all object points will project into the frame, otherwise some sole points will project outside the image frame
Returns
Resulting camera pose, transforming camera to world (world_T_camera)

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