Ocean
Ocean::CV::Segmentation::Triangulation Class Reference

This class implements functions allowing for triangulation. More...

Data Structures

class  IndexTriangle
 This class holds coordinate index of a triangle. More...
 

Public Types

typedef std::vector< IndexTriangleIndexTriangles
 Definition of a vector holding index triangle objects. More...
 

Static Public Member Functions

template<typename T >
static IndexTriangles triangulate (const PixelContourT< T > &pixelContour, const bool forceTriangulation=false, bool *triangulationForced=nullptr)
 Triangulates a given (sparse or dense) contour. More...
 
template<typename T >
static std::vector< Advanced::PixelTriangleT< T > > triangulation2triangles (const std::vector< PixelPositionT< T >> &coordinates, const IndexTriangles &triangulation)
 Converts a given set of pixel coordinates and a corresponding triangulation into triangle objects. More...
 

Private Types

typedef std::pair< unsigned int, bool > PixelPositionPair
 Definition of a pair combining a pixel position index and a boolean state. More...
 
typedef std::vector< PixelPositionPairPixelPositionPairs
 Definition of a vector holding pixel position pairs. More...
 

Detailed Description

This class implements functions allowing for triangulation.

Member Typedef Documentation

◆ IndexTriangles

Definition of a vector holding index triangle objects.

◆ PixelPositionPair

typedef std::pair<unsigned int, bool> Ocean::CV::Segmentation::Triangulation::PixelPositionPair
private

Definition of a pair combining a pixel position index and a boolean state.

◆ PixelPositionPairs

Definition of a vector holding pixel position pairs.

Member Function Documentation

◆ triangulate()

template<typename T >
static IndexTriangles Ocean::CV::Segmentation::Triangulation::triangulate ( const PixelContourT< T > &  pixelContour,
const bool  forceTriangulation = false,
bool *  triangulationForced = nullptr 
)
static

Triangulates a given (sparse or dense) contour.

Due to performance reasons and due to irregular coordinates a sparse contours is recommended.

Parameters
pixelContourThe contour to be triangulated
forceTriangulationTrue, to return a triangulation even if some of the coordinates does not allow a valid triangulation
triangulationForcedOptional resulting state whether the triangulation needed to be forced
Returns
Resulting triangulation
Template Parameters
TThe data type of the pixel contour, can be 'int' or 'unsigned int'

◆ triangulation2triangles()

template<typename T >
std::vector< Advanced::PixelTriangleT< T > > Ocean::CV::Segmentation::Triangulation::triangulation2triangles ( const std::vector< PixelPositionT< T >> &  coordinates,
const IndexTriangles triangulation 
)
inlinestatic

Converts a given set of pixel coordinates and a corresponding triangulation into triangle objects.

Parameters
coordinatesSet of pixel coordinates
triangulationCorresponding triangulation
Returns
Resulting triangles
Template Parameters
TThe data type of the pixel coordinates, can be "int" or "unsigned int"

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