eVision C++ API 26.10.0-beta.2.dev
Loading...
Searching...
No Matches
eVision::EEllipse Class Reference

Represents a model of an (arc of) ellipse. More...

#include <eVision/Easy/EEllipse.h>

Inheritance diagram for eVision::EEllipse:
Collaboration diagram for eVision::EEllipse:

Public Member Functions

 EEllipse ()
 Constructs a EEllipse object.
 EEllipse (const eVision::EPoint &center, float radiusX, float radiusY, float radiusXOrientation, bool direct)
 Constructs a EEllipse object.
 EEllipse (const eVision::EPoint &center, float radiusX, float radiusY, float radiusXOrientation)
 Constructs a EEllipse object.
 EEllipse (const eVision::EPoint &center, float radiusX, float radiusY, float radiusXOrientation, float originAngle, float amplitude, bool direct)
 Constructs a EEllipse object.
 EEllipse (const eVision::EPoint &center, float radiusX, float radiusY, float radiusXOrientation, float originAngle, float amplitude)
 Constructs a EEllipse object.
 EEllipse (const eVision::EEllipse &other)
 Constructs a EEllipse object.
virtual ~EEllipse () throw ()
eVision::EEllipse & operator= (const eVision::EEllipse &other)
 Copies all the data from another EEllipse object into the current EEllipse object.
void CopyTo (eVision::EEllipse &other) const
 Copies all the data of the current EEllipse object into another EEllipse object and returns it.
void SetCenter (const eVision::EPoint &center)
 Center of the EEllipse.
eVision::EPoint GetCenter () const
 Center of the EEllipse.
float GetCenterX () const
 Abscissa of the center of the EEllipse.
void SetCenterX (float centerX)
 Abscissa of the center of the EEllipse.
float GetCenterY () const
 Ordinate of the the center of the EEllipse.
void SetCenterY (float centerY)
 Ordinate of the the center of the EEllipse.
float GetAngle () const
 Orientation of the EEllipse.
void SetAngle (float angle)
 Orientation of the EEllipse.
float GetHorizontalRadius () const
 Horizontal Radius of a EEllipse object.
void SetHorizontalRadius (float radius)
 Horizontal Radius of a EEllipse object.
float GetVerticalRadius () const
 Vertical Radius of a EEllipse object.
void SetVerticalRadius (float radius)
 Vertical Radius of a EEllipse object.
float GetHorizontalRadiusOrientation () const
 Orientation of the horizontal Radius of a EEllipse object.
void SetHorizontalRadiusOrientation (float orientation)
 Orientation of the horizontal Radius of a EEllipse object.
float GetOriginAngle () const
 Angular position from where the EEllipse object extents.
void SetOriginAngle (float angle)
 Angular position from where the EEllipse object extents.
float GetEndAngle () const
 Angular position of the end of a EEllipse object.
bool IsFull () const
 Flag indicating whether the EEllipse object is a full ellipse or not.
bool IsDirect () const
 Flag indicating whether positive angles correspond to a clockwise or an anticlockwise rotation.
float GetAmplitude () const
 Angular amplitude of the EEllipse object.
void SetAmplitude (float amplitude)
 Angular amplitude of the EEllipse object.
virtual eVision::EEditionMode GetAvailableEditionModes () const
 Available edition modes for the shape.
virtual std::string GetDescription () const
 Textual description of the shape and its parameters.
 EEllipse (CppWrapperInternal::InternalConstructor)
Public Member Functions inherited from eVision::EShape
virtual ~EShape () throw ()
void Load (const std::string &path)
 Load the EShape configuration. The given ESerializer must have been created for reading.
void Load (eVision::ESerializer *serializer)
 Load the EShape configuration. The given ESerializer must have been created for reading.
void Save (const std::string &path)
 Save the EShape configuration. The given ESerializer must have been created for writing.
void Save (eVision::ESerializer *serializer)
 Save the EShape configuration. The given ESerializer must have been created for writing.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX, float panY, bool drawDiagonals) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX, float panY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY, float panX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX, float zoomY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, float zoomX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY, bool drawDiagonals) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY, float panX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX, float zoomY) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame, float zoomX) const
 Draws the EShape shape.
void Draw (eVision::EDrawAdapter *drawAdapter, const eVision::EFrame &frame) const
 Draws the EShape shape.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY, float panX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX, float zoomY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, float zoomX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY)
 Detects if the cursor is placed over one of the dragging handles.
eVision::EEditionMode HitTest (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX)
 Detects if the cursor is placed over one of the dragging handles.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX, float panY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY, float panX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX, float zoomY)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame, float zoomX)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void Drag (int32_t x, int32_t y, const eVision::EFrame &frame)
 Moves the specified handle to a new position and updates all placement parameters of the region.
void SetEditionMode (eVision::EEditionMode modes)
 Current edition mode for the shape. Default: EEditionMode_None.
eVision::EEditionMode GetEditionMode () const
 Current edition mode for the shape. Default: EEditionMode_None.
eVision::EFrame ToFrame (bool useAngle, eVision::EFrameScaling frameScaling) const
 Converts the shape to a frame.
eVision::EFrame ToFrame (bool useAngle, eVision::EFrameScaling frameScaling, const eVision::EFrame &shapeFrame) const
 Converts the shape to a frame.
 EShape (CppWrapperInternal::InternalConstructor)

Static Public Member Functions

static float GetDistanceBetweenPointAndEllipse (const eVision::EPoint &pt, const eVision::EEllipse &ellipse, bool limited)
 Computes the distance between a point and an ellipse.
static float GetDistanceBetweenPointAndEllipse (const eVision::EPoint &pt, const eVision::EEllipse &ellipse)
 Computes the distance between a point and an ellipse.
static eVision::EEllipse Fit (const std::vector< eVision::EPoint > &points, bool fitArc, uint32_t numFilteringPasses, float filteringThreshold)
 Fits an ellipse to a set of points.
static eVision::EEllipse Fit (const std::vector< eVision::EPoint > &points, bool fitArc, uint32_t numFilteringPasses)
 Fits an ellipse to a set of points.
static eVision::EEllipse Fit (const std::vector< eVision::EPoint > &points, bool fitArc)
 Fits an ellipse to a set of points.
static eVision::EEllipse Fit (const std::vector< eVision::EPoint > &points)
 Fits an ellipse to a set of points.

Additional Inherited Members

Public Attributes inherited from eVision::EShape
CppWrapperInternal::WrappedClass wrappedClass_

Detailed Description

Represents a model of an (arc of) ellipse.

License(s): BasicTypes

Constructor & Destructor Documentation

◆ EEllipse() [1/7]

eVision::EEllipse::EEllipse ( )

Constructs a EEllipse object.

◆ EEllipse() [2/7]

eVision::EEllipse::EEllipse ( const eVision::EPoint & center,
float radiusX,
float radiusY,
float radiusXOrientation,
bool direct )

Constructs a EEllipse object.

Parameters
centerCenter coordinates of the ellipse at its nominal position. The default value is (0,0).
radiusXhorizontal radius of the ellipse. The default value is 100.
radiusYvertical radius of the ellipse. The default value is 50.
radiusXOrientationOrientation of the horizontal radius of the ellipse. The default value is 0.
directtrue (default) means that angles increase anticlockwisely in a direct coordinate system.

◆ EEllipse() [3/7]

eVision::EEllipse::EEllipse ( const eVision::EPoint & center,
float radiusX,
float radiusY,
float radiusXOrientation )

Constructs a EEllipse object.

Parameters
centerCenter coordinates of the ellipse at its nominal position. The default value is (0,0).
radiusXhorizontal radius of the ellipse. The default value is 100.
radiusYvertical radius of the ellipse. The default value is 50.
radiusXOrientationOrientation of the horizontal radius of the ellipse. The default value is 0.

◆ EEllipse() [4/7]

eVision::EEllipse::EEllipse ( const eVision::EPoint & center,
float radiusX,
float radiusY,
float radiusXOrientation,
float originAngle,
float amplitude,
bool direct )

Constructs a EEllipse object.

Parameters
centerCenter coordinates of the ellipse at its nominal position. The default value is (0,0).
radiusXhorizontal radius of the ellipse. The default value is 100.
radiusYvertical radius of the ellipse. The default value is 50.
radiusXOrientationOrientation of the horizontal radius of the ellipse. The default value is 0.
originAngleNominal angular origin of the (arc of) ellipse. The default value is 0°.
amplitudeNominal angular amplitude of the (arc of) ellipse. The default value is 360°.
directtrue (default) means that angles increase anticlockwisely in a direct coordinate system.

◆ EEllipse() [5/7]

eVision::EEllipse::EEllipse ( const eVision::EPoint & center,
float radiusX,
float radiusY,
float radiusXOrientation,
float originAngle,
float amplitude )

Constructs a EEllipse object.

Parameters
centerCenter coordinates of the ellipse at its nominal position. The default value is (0,0).
radiusXhorizontal radius of the ellipse. The default value is 100.
radiusYvertical radius of the ellipse. The default value is 50.
radiusXOrientationOrientation of the horizontal radius of the ellipse. The default value is 0.
originAngleNominal angular origin of the (arc of) ellipse. The default value is 0°.
amplitudeNominal angular amplitude of the (arc of) ellipse. The default value is 360°.

◆ EEllipse() [6/7]

eVision::EEllipse::EEllipse ( const eVision::EEllipse & other)

Constructs a EEllipse object.

Parameters
otherAnother EEllipse object to be copied in the new EEllipse object.

◆ ~EEllipse()

eVision::EEllipse::~EEllipse ( )
throw ( )
virtual

◆ EEllipse() [7/7]

eVision::EEllipse::EEllipse ( CppWrapperInternal::InternalConstructor )

Member Function Documentation

◆ CopyTo()

void eVision::EEllipse::CopyTo ( eVision::EEllipse & other) const

Copies all the data of the current EEllipse object into another EEllipse object and returns it.

Parameters
otherEEllipse object in which the current EEllipse object data have to be copied.

In the overload taking a pointer, in case of a NULL pointer, a new EEllipse object will be created and returned.

◆ Fit() [1/4]

eVision::EEllipse eVision::EEllipse::Fit ( const std::vector< eVision::EPoint > & points)
static

Fits an ellipse to a set of points.

Parameters
pointsVector of points to fit.

During a filtering pass, the points that are too distant from the model are discarded. During a model fitting operation, the "filtering" process can be invoked to remove outliers, i.e. points that were located significantly far away from the fitted model (so that their position is dubious).

This method returns a "direct" EEllipse, see EEllipse::IsDirect.

◆ Fit() [2/4]

eVision::EEllipse eVision::EEllipse::Fit ( const std::vector< eVision::EPoint > & points,
bool fitArc )
static

Fits an ellipse to a set of points.

Parameters
pointsVector of points to fit.
fitArcIf true, an ellipse arc big enough to be close to all points will be returned instead of a full ellipse. Defaults to false.

During a filtering pass, the points that are too distant from the model are discarded. During a model fitting operation, the "filtering" process can be invoked to remove outliers, i.e. points that were located significantly far away from the fitted model (so that their position is dubious).

This method returns a "direct" EEllipse, see EEllipse::IsDirect.

◆ Fit() [3/4]

eVision::EEllipse eVision::EEllipse::Fit ( const std::vector< eVision::EPoint > & points,
bool fitArc,
uint32_t numFilteringPasses )
static

Fits an ellipse to a set of points.

Parameters
pointsVector of points to fit.
fitArcIf true, an ellipse arc big enough to be close to all points will be returned instead of a full ellipse. Defaults to false.
numFilteringPassesNumber of filtering passes for an ellipse fitting operation. Defaults to 0 (no filtering performed).

During a filtering pass, the points that are too distant from the model are discarded. During a model fitting operation, the "filtering" process can be invoked to remove outliers, i.e. points that were located significantly far away from the fitted model (so that their position is dubious).

This method returns a "direct" EEllipse, see EEllipse::IsDirect.

◆ Fit() [4/4]

eVision::EEllipse eVision::EEllipse::Fit ( const std::vector< eVision::EPoint > & points,
bool fitArc,
uint32_t numFilteringPasses,
float filteringThreshold )
static

Fits an ellipse to a set of points.

Parameters
pointsVector of points to fit.
fitArcIf true, an ellipse arc big enough to be close to all points will be returned instead of a full ellipse. Defaults to false.
numFilteringPassesNumber of filtering passes for an ellipse fitting operation. Defaults to 0 (no filtering performed).
filteringThresholdRelative filtering threshold, that is the fraction of the average distance between the points and the fitted model above which a point is filtered out. Defaults to 3.

During a filtering pass, the points that are too distant from the model are discarded. During a model fitting operation, the "filtering" process can be invoked to remove outliers, i.e. points that were located significantly far away from the fitted model (so that their position is dubious).

This method returns a "direct" EEllipse, see EEllipse::IsDirect.

◆ GetAmplitude()

float eVision::EEllipse::GetAmplitude ( ) const

Angular amplitude of the EEllipse object.

The default value is 360°. The sign of the rotation angle depends whether the field of view is calibrated or not.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards. In this case, an anticlockwise rotation leads to a positive angle value.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards. In this case, a clockwise rotation leads to a positive angle value.

◆ GetAngle()

float eVision::EEllipse::GetAngle ( ) const

Orientation of the EEllipse.

◆ GetAvailableEditionModes()

eVision::EEditionMode eVision::EEllipse::GetAvailableEditionModes ( ) const
virtual

Available edition modes for the shape.

Implements eVision::EShape.

◆ GetCenter()

eVision::EPoint eVision::EEllipse::GetCenter ( ) const

Center of the EEllipse.

◆ GetCenterX()

float eVision::EEllipse::GetCenterX ( ) const

Abscissa of the center of the EEllipse.

◆ GetCenterY()

float eVision::EEllipse::GetCenterY ( ) const

Ordinate of the the center of the EEllipse.

◆ GetDescription()

std::string eVision::EEllipse::GetDescription ( ) const
virtual

Textual description of the shape and its parameters.

Implements eVision::EShape.

◆ GetDistanceBetweenPointAndEllipse() [1/2]

float eVision::EEllipse::GetDistanceBetweenPointAndEllipse ( const eVision::EPoint & pt,
const eVision::EEllipse & ellipse )
static

Computes the distance between a point and an ellipse.

Note that we compute the distance between the point and its projection on the ellipse. This is not always the shortest distance.

Parameters
ptThe point.
ellipseThe ellipse.

When the ellipse is restricted to an arc and the orthogonal projection of the point onto the ellipse falls outside this arc, the distance to the closest endpoint of the arc is returned instead.

◆ GetDistanceBetweenPointAndEllipse() [2/2]

float eVision::EEllipse::GetDistanceBetweenPointAndEllipse ( const eVision::EPoint & pt,
const eVision::EEllipse & ellipse,
bool limited )
static

Computes the distance between a point and an ellipse.

Note that we compute the distance between the point and its projection on the ellipse. This is not always the shortest distance.

Parameters
ptThe point.
ellipseThe ellipse.
limitedIndicates if the ellipse parameter should be considered as a full ellipse or as an arc.

When the ellipse is restricted to an arc and the orthogonal projection of the point onto the ellipse falls outside this arc, the distance to the closest endpoint of the arc is returned instead.

◆ GetEndAngle()

float eVision::EEllipse::GetEndAngle ( ) const

Angular position of the end of a EEllipse object.

The sign of the rotation angle depends whether the field of view is calibrated or not.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards. In this case, an anticlockwise rotation leads to a positive angle value.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards. In this case, a clockwise rotation leads to a positive angle value.

◆ GetHorizontalRadius()

float eVision::EEllipse::GetHorizontalRadius ( ) const

Horizontal Radius of a EEllipse object.

◆ GetHorizontalRadiusOrientation()

float eVision::EEllipse::GetHorizontalRadiusOrientation ( ) const

Orientation of the horizontal Radius of a EEllipse object.

◆ GetOriginAngle()

float eVision::EEllipse::GetOriginAngle ( ) const

Angular position from where the EEllipse object extents.

The sign of the rotation angle depends whether the field of view is calibrated or not.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards. In this case, an anticlockwise rotation leads to a positive angle value.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards. In this case, a clockwise rotation leads to a positive angle value.

◆ GetVerticalRadius()

float eVision::EEllipse::GetVerticalRadius ( ) const

Vertical Radius of a EEllipse object.

◆ IsDirect()

bool eVision::EEllipse::IsDirect ( ) const

Flag indicating whether positive angles correspond to a clockwise or an anticlockwise rotation.

true (default) means that angles increase anticlockwisely in a direct coordinate system, and clockwisely in an inverse coordinate system.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards.

◆ IsFull()

bool eVision::EEllipse::IsFull ( ) const

Flag indicating whether the EEllipse object is a full ellipse or not.

By default (true), the EEllipse object is a full ellipse.

◆ operator=()

eVision::EEllipse & eVision::EEllipse::operator= ( const eVision::EEllipse & other)

Copies all the data from another EEllipse object into the current EEllipse object.

Parameters
otherEEllipse object to be copied

◆ SetAmplitude()

void eVision::EEllipse::SetAmplitude ( float amplitude)

Angular amplitude of the EEllipse object.

The default value is 360°. The sign of the rotation angle depends whether the field of view is calibrated or not.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards. In this case, an anticlockwise rotation leads to a positive angle value.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards. In this case, a clockwise rotation leads to a positive angle value.

◆ SetAngle()

void eVision::EEllipse::SetAngle ( float angle)

Orientation of the EEllipse.

Parameters
angleNew starting orientation of the EEllipse.

◆ SetCenter()

void eVision::EEllipse::SetCenter ( const eVision::EPoint & center)

Center of the EEllipse.

Parameters
centerNew center of the EEllipse.

◆ SetCenterX()

void eVision::EEllipse::SetCenterX ( float centerX)

Abscissa of the center of the EEllipse.

Parameters
centerXX coordinate of the center of the EEllipse.

◆ SetCenterY()

void eVision::EEllipse::SetCenterY ( float centerY)

Ordinate of the the center of the EEllipse.

Parameters
centerYY coordinate of the center of the EEllipse.

◆ SetHorizontalRadius()

void eVision::EEllipse::SetHorizontalRadius ( float radius)

Horizontal Radius of a EEllipse object.

◆ SetHorizontalRadiusOrientation()

void eVision::EEllipse::SetHorizontalRadiusOrientation ( float orientation)

Orientation of the horizontal Radius of a EEllipse object.

◆ SetOriginAngle()

void eVision::EEllipse::SetOriginAngle ( float angle)

Angular position from where the EEllipse object extents.

The sign of the rotation angle depends whether the field of view is calibrated or not.

  • When the field of view is calibrated, the coordinate system is said to be direct, the abscissa extends rightwards and the ordinate extends upwards. In this case, an anticlockwise rotation leads to a positive angle value.
  • When the field of view is not calibrated, the coordinate system is said to be inverse, the abscissa extends rightwards and the ordinate extends downwards. In this case, a clockwise rotation leads to a positive angle value.

◆ SetVerticalRadius()

void eVision::EEllipse::SetVerticalRadius ( float radius)

Vertical Radius of a EEllipse object.