Ocean
Loading...
Searching...
No Matches
Ocean::CV::Segmentation::ContourAnalyzer Class Reference

This class implements functions analyzing contours. More...

#include <ContourAnalyzer.h>

Data Structures

class  DenseObject
 This class implements a simple storage for a point index with corresponding dense parameter. More...
 

Public Types

typedef std::vector< unsigned int > Indices
 Definition of a vector holding indices.
 

Static Public Member Functions

static Scalars curvature (const PixelPositions &contour, const unsigned int offset)
 Determines the curvature for each contour pixel.
 
static PixelContour createDenseContour (const PixelPositions &points)
 Creates a dense and distinct contour from any kind of given contour also ensuring that the resulting contour does not contain complex properties like loops.
 
static PixelContour createDenseContour (const Vectors2 &points)
 Creates a dense and distinct contour from any kind of given contour also ensuring that the resulting contour does not contain complex properties like loops.
 
static Vectors2 equalizeContourDensity (const Vectors2 &contour)
 Equalized a sparse contour according to the density of the locations of contour points.
 

Protected Types

typedef std::vector< DenseObjectDenseObjects
 Definition of a vector holding dense objects.
 

Static Private Member Functions

static size_t pixelPositionHashValueFunction (const PixelPosition &position)
 Calculates a hash value for a given pixel position.
 
static PixelDirection determinePixelDirection (const PixelPosition &pixel0, const PixelPosition &pixel1)
 Returns the pixel direction of two successive pixels in a dense contour.
 

Detailed Description

This class implements functions analyzing contours.

Member Typedef Documentation

◆ DenseObjects

Definition of a vector holding dense objects.

◆ Indices

typedef std::vector<unsigned int> Ocean::CV::Segmentation::ContourAnalyzer::Indices

Definition of a vector holding indices.

Member Function Documentation

◆ createDenseContour() [1/2]

static PixelContour Ocean::CV::Segmentation::ContourAnalyzer::createDenseContour ( const PixelPositions points)
static

Creates a dense and distinct contour from any kind of given contour also ensuring that the resulting contour does not contain complex properties like loops.

In contrast to e.g., PixelContour::makeDense(), this function needs significantly more computational time while is able to handle more complex input contours.

Parameters
pointsThe points of any kind of contour which will be converted to a dense and distinct contour
Returns
The resulting dense and distinct contour
See also
PixelContour::makeDense().

◆ createDenseContour() [2/2]

PixelContour Ocean::CV::Segmentation::ContourAnalyzer::createDenseContour ( const Vectors2 points)
inlinestatic

Creates a dense and distinct contour from any kind of given contour also ensuring that the resulting contour does not contain complex properties like loops.

In contrast to e.g., PixelContour::makeDense(), this function needs significantly more computational time while is able to handle more complex input contours.

Parameters
pointsThe points of any kind of contour which will be converted to a dense and distinct contour with sub-pixel accuracy
Returns
The resulting dense and distinct contour

◆ curvature()

static Scalars Ocean::CV::Segmentation::ContourAnalyzer::curvature ( const PixelPositions contour,
const unsigned int  offset 
)
static

Determines the curvature for each contour pixel.

The resulting values are the cosine value of the angles between two vectors starting at the interest point pointing several pixels forward and backward in the contour.

Parameters
contourThe contour for which the curvature parameters will be determined
offsetPixel offset inside the contour between the pixel of interest and the pixels to measure the curvature, with range [1, contour.size())
Returns
Cosine values giving the curvature of the contour, one value for each pixel in the contour (a value of 1 determines an angle of 90 deg, a value of 0 determines a value of +/- 180 deg)

◆ determinePixelDirection()

PixelDirection Ocean::CV::Segmentation::ContourAnalyzer::determinePixelDirection ( const PixelPosition pixel0,
const PixelPosition pixel1 
)
inlinestaticprivate

Returns the pixel direction of two successive pixels in a dense contour.

Parameters
pixel0First pixel
pixel1Following pixel
Returns
Resulting pixel direction

◆ equalizeContourDensity()

static Vectors2 Ocean::CV::Segmentation::ContourAnalyzer::equalizeContourDensity ( const Vectors2 contour)
static

Equalized a sparse contour according to the density of the locations of contour points.

Parameters
contourThe contour to be equalized
Returns
The resulting equalized contour

◆ pixelPositionHashValueFunction()

size_t Ocean::CV::Segmentation::ContourAnalyzer::pixelPositionHashValueFunction ( const PixelPosition position)
inlinestaticprivate

Calculates a hash value for a given pixel position.

Parameters
positionPixel position to determine the hash function for
Returns
Resulting hash function

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