Ocean
Loading...
Searching...
No Matches
Ocean::Geometry::FisheyeEpipolarGeometry Class Reference

This class implements fisheye epipolar geometry functionality. More...

#include <FisheyeEpipolarGeometry.h>

Public Types

enum  CameraIdentifier : unsigned int { CI_CAMERA0 = 0u , CI_CAMERA1 }
 Definition of camera identifiers. More...
 
using EpipolarLine = std::vector< Vector2 >
 Definition of an epipolar line as a vector of 2D points.
 
using EpipolarLines = std::vector< EpipolarLine >
 Definition of a vector holding epipolar lines.
 

Public Member Functions

 FisheyeEpipolarGeometry ()=default
 Default constructor creating an invalid epipolar geometry object.
 
 FisheyeEpipolarGeometry (const SharedAnyCamera &camera0, const SharedAnyCamera &camera1, const HomogenousMatrix4 &camera0_T_camera1)
 Creates a new fisheye epipolar geometry object.
 
bool isValid () const
 Returns whether this epipolar geometry object is valid.
 
bool updateCameras (const SharedAnyCamera &camera0, const SharedAnyCamera &camera1, const HomogenousMatrix4 &camera0_T_camera1)
 Updates the cameras and transformation of this epipolar geometry object.
 
bool epipolarLine (const Vector2 &sourcePointFisheye, Vectors2 &fisheyeEpipolarLineSegments, const CameraIdentifier sourceCameraIdentifier=CI_CAMERA0, const Scalar lineStep=Scalar(70), const size_t maxNumberLineSegments=100u) const
 Computes the epipolar line in the target camera corresponding to a point in the source camera.
 
bool isOnEpipolarLine (const CameraIdentifier sourceCameraIdentifier, const Vector2 &sourcePointFisheye, const Vector2 &targetPointFisheye, const Scalar maxDistance=Scalar(2)) const
 Determines whether a target point lies on the epipolar line corresponding to a source point.
 
Scalar squareDistanceToEpipolarLine (const CameraIdentifier sourceCameraIdentifier, const Vector2 &sourcePointFisheye, const Vector2 &targetPointFisheye) const
 Computes the squared distance from a target point to the epipolar line corresponding to a source point.
 

Protected Member Functions

Vector2 reprojectPoint (const AnyCamera &sourceCamera, const AnyCamera &targetCamera, const Vector2 &sourcePoint) const
 Reprojects a point from one camera to another.
 
bool epipolarLine (const CameraIdentifier sourceCameraIdentifier, const Vector2 &sourcePointFisheye, Line2 &epipolarLinePinhole) const
 Computes the epipolar line in the target camera corresponding to a point in the source camera (in pinhole space).
 

Protected Attributes

SharedAnyCamera fisheyeCamera0_
 The first fisheye camera.
 
SharedAnyCamera fisheyeCamera1_
 The second fisheye camera.
 
SharedAnyCamera pinholeCamera0_
 The first pinhole camera.
 
SharedAnyCamera pinholeCamera1_
 The second pinhole camera.
 
HomogenousMatrix4 camera0_T_camera1_
 The transformation from camera 1 to camera 0.
 
SquareMatrix3 camera1_E_camera0_
 The essential matrix from camera 0 to camera 1.
 
SquareMatrix3 camera1_F_camera0_
 The fundamental matrix from camera 0 to camera 1.
 

Detailed Description

This class implements fisheye epipolar geometry functionality.

Member Typedef Documentation

◆ EpipolarLine

Definition of an epipolar line as a vector of 2D points.

◆ EpipolarLines

Definition of a vector holding epipolar lines.

Member Enumeration Documentation

◆ CameraIdentifier

Definition of camera identifiers.

Enumerator
CI_CAMERA0 

Camera 0.

CI_CAMERA1 

Camera 1.

Constructor & Destructor Documentation

◆ FisheyeEpipolarGeometry() [1/2]

Ocean::Geometry::FisheyeEpipolarGeometry::FisheyeEpipolarGeometry ( )
default

Default constructor creating an invalid epipolar geometry object.

◆ FisheyeEpipolarGeometry() [2/2]

Ocean::Geometry::FisheyeEpipolarGeometry::FisheyeEpipolarGeometry ( const SharedAnyCamera camera0,
const SharedAnyCamera camera1,
const HomogenousMatrix4 camera0_T_camera1 
)

Creates a new fisheye epipolar geometry object.

Parameters
camera0The first camera, must be valid
camera1The second camera, must be valid
camera0_T_camera1The transformation from camera 1 to camera 0, must be valid

Member Function Documentation

◆ epipolarLine() [1/2]

bool Ocean::Geometry::FisheyeEpipolarGeometry::epipolarLine ( const CameraIdentifier  sourceCameraIdentifier,
const Vector2 sourcePointFisheye,
Line2 epipolarLinePinhole 
) const
protected

Computes the epipolar line in the target camera corresponding to a point in the source camera (in pinhole space).

Parameters
sourceCameraIdentifierThe identifier of the source camera, either CI_CAMERA0 or CI_CAMERA1
sourcePointFisheyeThe point in the source camera (fisheye space), with range [0, sourceCamera.width())x[0, sourceCamera.height())
epipolarLinePinholeThe resulting epipolar line in the target camera (pinhole space)
Returns
True, if succeeded

◆ epipolarLine() [2/2]

bool Ocean::Geometry::FisheyeEpipolarGeometry::epipolarLine ( const Vector2 sourcePointFisheye,
Vectors2 fisheyeEpipolarLineSegments,
const CameraIdentifier  sourceCameraIdentifier = CI_CAMERA0,
const Scalar  lineStep = Scalar(70),
const size_t  maxNumberLineSegments = 100u 
) const

Computes the epipolar line in the target camera corresponding to a point in the source camera.

Parameters
sourcePointFisheyeThe point in the source camera, with range [0, sourceCamera.width())x[0, sourceCamera.height())
fisheyeEpipolarLineSegmentsThe resulting epipolar line in the target camera as a sequence of connected points
sourceCameraIdentifierThe identifier of the source camera, either CI_CAMERA0 or CI_CAMERA1
lineStepThe step size along the epipolar line, in pixels, with range (0, infinity)
maxNumberLineSegmentsThe maximum number of line segments to compute, with range [1, infinity)
Returns
True, if succeeded

◆ isOnEpipolarLine()

bool Ocean::Geometry::FisheyeEpipolarGeometry::isOnEpipolarLine ( const CameraIdentifier  sourceCameraIdentifier,
const Vector2 sourcePointFisheye,
const Vector2 targetPointFisheye,
const Scalar  maxDistance = Scalar(2) 
) const

Determines whether a target point lies on the epipolar line corresponding to a source point.

Parameters
sourceCameraIdentifierThe identifier of the source camera, either CI_CAMERA0 or CI_CAMERA1
sourcePointFisheyeThe point in the source camera, with range [0, sourceCamera.width())x[0, sourceCamera.height())
targetPointFisheyeThe point in the target camera to check, with range [0, targetCamera.width())x[0, targetCamera.height())
maxDistanceThe maximum allowed distance from the epipolar line, in pixels, with range [0, infinity)
Returns
True, if the target point lies on the epipolar line

◆ isValid()

bool Ocean::Geometry::FisheyeEpipolarGeometry::isValid ( ) const

Returns whether this epipolar geometry object is valid.

Returns
True, if so

◆ reprojectPoint()

Vector2 Ocean::Geometry::FisheyeEpipolarGeometry::reprojectPoint ( const AnyCamera sourceCamera,
const AnyCamera targetCamera,
const Vector2 sourcePoint 
) const
protected

Reprojects a point from one camera to another.

Parameters
sourceCameraThe source camera, must be valid
targetCameraThe target camera, must be valid
sourcePointThe point in the source camera
Returns
The reprojected point in the target camera

◆ squareDistanceToEpipolarLine()

Scalar Ocean::Geometry::FisheyeEpipolarGeometry::squareDistanceToEpipolarLine ( const CameraIdentifier  sourceCameraIdentifier,
const Vector2 sourcePointFisheye,
const Vector2 targetPointFisheye 
) const

Computes the squared distance from a target point to the epipolar line corresponding to a source point.

Parameters
sourceCameraIdentifierThe identifier of the source camera, either CI_CAMERA0 or CI_CAMERA1
sourcePointFisheyeThe point in the source camera, with range [0, sourceCamera.width())x[0, sourceCamera.height())
targetPointFisheyeThe point in the target camera, with range [0, targetCamera.width())x[0, targetCamera.height())
Returns
The squared distance from the target point to the epipolar line, in pixels^2, with range [0, infinity), or -1 if the computation fails

◆ updateCameras()

bool Ocean::Geometry::FisheyeEpipolarGeometry::updateCameras ( const SharedAnyCamera camera0,
const SharedAnyCamera camera1,
const HomogenousMatrix4 camera0_T_camera1 
)

Updates the cameras and transformation of this epipolar geometry object.

Parameters
camera0The first camera, must be valid
camera1The second camera, must be valid
camera0_T_camera1The transformation from camera 1 to camera 0, must be valid
Returns
True, if succeeded

Field Documentation

◆ camera0_T_camera1_

HomogenousMatrix4 Ocean::Geometry::FisheyeEpipolarGeometry::camera0_T_camera1_
protected

The transformation from camera 1 to camera 0.

◆ camera1_E_camera0_

SquareMatrix3 Ocean::Geometry::FisheyeEpipolarGeometry::camera1_E_camera0_
protected

The essential matrix from camera 0 to camera 1.

◆ camera1_F_camera0_

SquareMatrix3 Ocean::Geometry::FisheyeEpipolarGeometry::camera1_F_camera0_
protected

The fundamental matrix from camera 0 to camera 1.

◆ fisheyeCamera0_

SharedAnyCamera Ocean::Geometry::FisheyeEpipolarGeometry::fisheyeCamera0_
protected

The first fisheye camera.

◆ fisheyeCamera1_

SharedAnyCamera Ocean::Geometry::FisheyeEpipolarGeometry::fisheyeCamera1_
protected

The second fisheye camera.

◆ pinholeCamera0_

SharedAnyCamera Ocean::Geometry::FisheyeEpipolarGeometry::pinholeCamera0_
protected

The first pinhole camera.

◆ pinholeCamera1_

SharedAnyCamera Ocean::Geometry::FisheyeEpipolarGeometry::pinholeCamera1_
protected

The second pinhole camera.


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