Ocean
Ocean::Geometry::VanishingProjection Class Reference

This class implements functions for vanishing projections. More...

Static Public Member Functions

static bool planeNormal (const PinholeCamera &pinholeCamera, const Vector2 parallelogramPoints[4], const bool undistortImagePoints, Vector3 &normal)
 Calculates the normal of a plane that is determined by four given image points defining a parallelogram and all lying on the same 3D plane. More...
 
static bool vanishingLine (const Vector2 parallelogramPoints[4], Line2 &line)
 Determines the vanishing line for four given (undistorted) image points defining a parallelogram that lies in a 3D plane. More...
 
static Indices32 perspectiveParallelLines (const ConstIndexedAccessor< Line2 > &lines, const Scalar projectiveParallelAngle=Numeric::deg2rad(5), const Scalar orientationError=Numeric::deg2rad(2), const Scalar maximalAngle=Numeric::deg2rad(35))
 Determines the largest subset of perspectively parallel lines from a set of given infinite lines. More...
 

Detailed Description

This class implements functions for vanishing projections.

Member Function Documentation

◆ perspectiveParallelLines()

static Indices32 Ocean::Geometry::VanishingProjection::perspectiveParallelLines ( const ConstIndexedAccessor< Line2 > &  lines,
const Scalar  projectiveParallelAngle = Numeric::deg2rad(5),
const Scalar  orientationError = Numeric::deg2rad(2),
const Scalar  maximalAngle = Numeric::deg2rad(35) 
)
static

Determines the largest subset of perspectively parallel lines from a set of given infinite lines.

The lines may be absolute parallel or may have a common vanishing point.

Parameters
linesThe lines from which the largest group of (perspectively) parallel lines will be determined
projectiveParallelAngleThe maximal angle between two projected lines (actually the given lines interpreted in the coordinate system of the frame) count as parallel, in radian with range [0, PI/2)
orientationErrorThe expected orientation error each provided line can have e.g., due to measurement/detection inaccuracies, in radian with range [0, PI/2)
maximalAngleThe maximal angle between two lines so that they still count as perspectively parallel, in radian with range (max(orientationError, projectiveParallelAngle), PI/2)
Returns
The indices of the requested lines out of the given group of lines

◆ planeNormal()

static bool Ocean::Geometry::VanishingProjection::planeNormal ( const PinholeCamera pinholeCamera,
const Vector2  parallelogramPoints[4],
const bool  undistortImagePoints,
Vector3 normal 
)
static

Calculates the normal of a plane that is determined by four given image points defining a parallelogram and all lying on the same 3D plane.

The resulting normal is defined in the coordinate system of the camera which is located in the origin and locking along the negative z-axis, with y-axis as up vector.

Parameters
pinholeCameraThe pinhole camera profile to be applied
parallelogramPointsThe four corners of the parallelogram visible in the camera frame
undistortImagePointsTrue, so that the given image points will be undistorted before the normal is calculated
normalResulting normal of the plane
Returns
True, if succeeded

◆ vanishingLine()

static bool Ocean::Geometry::VanishingProjection::vanishingLine ( const Vector2  parallelogramPoints[4],
Line2 line 
)
static

Determines the vanishing line for four given (undistorted) image points defining a parallelogram that lies in a 3D plane.

Parameters
parallelogramPointsFour (undistorted) image points defining a parallelogram
lineResulting vanishing line
Returns
True, if succeeded

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