Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpTemplateTrackerTriangle Class Reference

#include <vpTemplateTrackerTriangle.h>

Public Member Functions

 vpTemplateTrackerTriangle ()
 vpTemplateTrackerTriangle (const vpTemplateTrackerTriangle &T)
 vpTemplateTrackerTriangle (const vpColVector &c1, const vpColVector &c2, const vpColVector &c3)
 vpTemplateTrackerTriangle (const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3)
 vpTemplateTrackerTriangle (int x1, int y1, int x2, int y2, int x3, int y3)
 vpTemplateTrackerTriangle (double x1, double y1, double x2, double y2, double x3, double y3)
double getArea () const
vpTemplateTrackerTriangle getPyramidDown () const
void getCorners (vpColVector &c1, vpColVector &c2, vpColVector &c3) const
void getCorners (vpImagePoint &c1, vpImagePoint &c2, vpImagePoint &c3) const
void getCorners (std::vector< vpImagePoint > &c) const
vpColVector getCorner (unsigned int i) const
void getCorner (unsigned int i, double &x, double &y) const
double getMaxx () const
double getMaxy () const
double getMinx () const
double getMiny () const
void getSize (double &w, double &h) const
void getSize (int &w, int &h) const
void init (const vpColVector &c1, const vpColVector &c2, const vpColVector &c3)
void init (const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3)
void init (int x1, int y1, int x2, int y2, int x3, int y3)
void init (double x1, double y1, double x2, double y2, double x3, double y3)
bool inTriangle (const vpImagePoint &ip) const
bool inTriangle (const int &i, const int &j) const
bool inTriangle (const double &i, const double &j) const
vpTemplateTrackerTriangleoperator= (const vpTemplateTrackerTriangle &T)

Protected Attributes

double minx_temp
double miny_temp
vpTemplateTrackerDPoint C1
vpTemplateTrackerDPoint C2
vpTemplateTrackerDPoint C3
double l_t
double h_t
bool not_good
double uvinv00
double uvinv01
double uvinv10
double uvinv11
double marge_triangle
double area

Detailed Description

Tutorials & Examples

Tutorials
If you are interested in the Template Tracker (TT), you may have a look at:

Definition at line 67 of file vpTemplateTrackerTriangle.h.

Constructor & Destructor Documentation

◆ vpTemplateTrackerTriangle() [1/6]

BEGIN_VISP_NAMESPACE vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( )

Default constructor.

Definition at line 43 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, h_t, l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

Referenced by getPyramidDown(), operator=(), and vpTemplateTrackerTriangle().

◆ vpTemplateTrackerTriangle() [2/6]

vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( const vpTemplateTrackerTriangle & T)

◆ vpTemplateTrackerTriangle() [3/6]

vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( const vpColVector & c1,
const vpColVector & c2,
const vpColVector & c3 )

Create a triangle from 3 corners.

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y).

Definition at line 102 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, h_t, init(), l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ vpTemplateTrackerTriangle() [4/6]

vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( const vpImagePoint & c1,
const vpImagePoint & c2,
const vpImagePoint & c3 )

Create a triangle from 3 corners defined as image points.

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

Definition at line 137 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, vpImagePoint::get_u(), vpImagePoint::get_v(), h_t, init(), l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ vpTemplateTrackerTriangle() [5/6]

vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( int x1,
int y1,
int x2,
int y2,
int x3,
int y3 )

Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3).

  • x coordinate is along the columns
  • y coordinate is along the rows.

Definition at line 124 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, h_t, init(), l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ vpTemplateTrackerTriangle() [6/6]

vpTemplateTrackerTriangle::vpTemplateTrackerTriangle ( double x1,
double y1,
double x2,
double y2,
double x3,
double y3 )

Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3).

  • x coordinate is along the columns
  • y coordinate is along the rows.

Definition at line 150 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, h_t, init(), l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

Member Function Documentation

◆ getArea()

double vpTemplateTrackerTriangle::getArea ( ) const
inline

Return the area of the triangle.

Returns
The area of the triangle.

Definition at line 105 of file vpTemplateTrackerTriangle.h.

Referenced by vpTemplateTrackerZone::getArea().

◆ getCorner() [1/2]

vpColVector vpTemplateTrackerTriangle::getCorner ( unsigned int i) const
inline

Returns the coordinates of a triangle corner.

Parameters
i: Allowed values are 0, 1 or 2.
Returns
  • if i = 0, return corner 1 coordinates,
  • if i = 1, return corner 2 coordinates,
  • if i = 2, return corner 3 coordinates.

The coordinates are returned as a 2 dimension vector (x,y).

Definition at line 122 of file vpTemplateTrackerTriangle.h.

Referenced by vpTemplateTracker::computeEvalRMS(), vpTemplateTrackerWarp::getDistanceBetweenZoneAndWarpedZone(), and vpTemplateTracker::initPosEvalRMS().

◆ getCorner() [2/2]

void vpTemplateTrackerTriangle::getCorner ( unsigned int i,
double & x,
double & y ) const
inline

Returns the coordinates of a triangle corner.

Parameters
i: Allowed values are 0, 1 or 2.
  • if i = 0, return corner 1 coordinates,
  • if i = 1, return corner 2 coordinates,
  • if i = 2, return corner 3 coordinates.
x: The coordinate of the corner along horizontal axis.
y: The coordinate of the corner along vertical axis.

Definition at line 141 of file vpTemplateTrackerTriangle.h.

References C1, C2, and C3.

◆ getCorners() [1/3]

void vpTemplateTrackerTriangle::getCorners ( std::vector< vpImagePoint > & c) const

Returns the coordinates of the triangle corners as a 3 dimension vector of image points.

Parameters
c: 3 dimension vector of image points that correspond to the triangle corners.

Definition at line 325 of file vpTemplateTrackerTriangle.cpp.

References C1, C2, and C3.

◆ getCorners() [2/3]

void vpTemplateTrackerTriangle::getCorners ( vpColVector & c1,
vpColVector & c2,
vpColVector & c3 ) const

Returns the coordinates of the triangle corners as a 2 dimension vector (x,y).

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

Definition at line 338 of file vpTemplateTrackerTriangle.cpp.

Referenced by vpTemplateTrackerWarp::warpTriangle().

◆ getCorners() [3/3]

void vpTemplateTrackerTriangle::getCorners ( vpImagePoint & c1,
vpImagePoint & c2,
vpImagePoint & c3 ) const

Returns the coordinates of the triangle corners as an image point.

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

Definition at line 313 of file vpTemplateTrackerTriangle.cpp.

References C1, C2, C3, and vpImagePoint::set_uv().

◆ getMaxx()

double vpTemplateTrackerTriangle::getMaxx ( ) const
Returns
The maximal x coordinate (along the columns of the image) of the points that are in the triangle.
See also
getMinx()

Definition at line 419 of file vpTemplateTrackerTriangle.cpp.

References l_t, and minx_temp.

Referenced by vpTemplateTrackerZone::copy(), and vpTemplateTrackerZone::initFromPoints().

◆ getMaxy()

double vpTemplateTrackerTriangle::getMaxy ( ) const
Returns
The maximal y coordinate (along the rows of the image) of the points that are in the triangle.
See also
getMaxx()

Definition at line 424 of file vpTemplateTrackerTriangle.cpp.

References h_t, and miny_temp.

Referenced by vpTemplateTrackerZone::copy(), and vpTemplateTrackerZone::initFromPoints().

◆ getMinx()

double vpTemplateTrackerTriangle::getMinx ( ) const
Returns
The minimal x coordinate (along the columns of the image) of the points that are in the triangle.
See also
getMaxx()

Definition at line 409 of file vpTemplateTrackerTriangle.cpp.

References minx_temp.

Referenced by vpTemplateTrackerZone::copy(), and vpTemplateTrackerZone::initFromPoints().

◆ getMiny()

double vpTemplateTrackerTriangle::getMiny ( ) const
Returns
The minimal y coordinate (along the rows of the image) of the points that are in the triangle.
See also
getMaxy()

Definition at line 414 of file vpTemplateTrackerTriangle.cpp.

References miny_temp.

Referenced by vpTemplateTrackerZone::copy(), and vpTemplateTrackerZone::initFromPoints().

◆ getPyramidDown()

vpTemplateTrackerTriangle vpTemplateTrackerTriangle::getPyramidDown ( ) const

Return a triangle with coordinates that are down scaled by a factor 2.

Definition at line 112 of file vpTemplateTrackerTriangle.cpp.

References C1, C2, C3, init(), and vpTemplateTrackerTriangle().

Referenced by vpTemplateTrackerZone::getPyramidDown().

◆ getSize() [1/2]

void vpTemplateTrackerTriangle::getSize ( double & w,
double & h ) const

Get the size of the triangle bounding box.

Parameters
w: Bounding box width.
h: Bounding box height.

Definition at line 389 of file vpTemplateTrackerTriangle.cpp.

References h_t, and l_t.

◆ getSize() [2/2]

void vpTemplateTrackerTriangle::getSize ( int & w,
int & h ) const

Get the size of the triangle bounding box.

Parameters
w: Bounding box width.
h: Bounding box height.

Definition at line 399 of file vpTemplateTrackerTriangle.cpp.

References h_t, and l_t.

◆ init() [1/4]

void vpTemplateTrackerTriangle::init ( const vpColVector & c1,
const vpColVector & c2,
const vpColVector & c3 )

Initializes a triangle from 3 corners.

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y).

Definition at line 165 of file vpTemplateTrackerTriangle.cpp.

References init().

Referenced by getPyramidDown(), init(), init(), init(), vpTemplateTrackerTriangle(), vpTemplateTrackerTriangle(), vpTemplateTrackerTriangle(), vpTemplateTrackerTriangle(), and vpTemplateTrackerWarp::warpTriangle().

◆ init() [2/4]

void vpTemplateTrackerTriangle::init ( const vpImagePoint & c1,
const vpImagePoint & c2,
const vpImagePoint & c3 )

Initializes a triangle from 3 corners defined as image points.

Parameters
c1: First corner.
c2: Second corner.
c3: Third corner.

Definition at line 175 of file vpTemplateTrackerTriangle.cpp.

References vpImagePoint::get_u(), vpImagePoint::get_v(), and init().

◆ init() [3/4]

void vpTemplateTrackerTriangle::init ( double x1,
double y1,
double x2,
double y2,
double x3,
double y3 )

Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3).

  • x coordinate is along the columns
  • y coordinate is along the rows.

Definition at line 197 of file vpTemplateTrackerTriangle.cpp.

References area, C1, C2, C3, vpMatrix::det(), h_t, vpMatrix::inverseByLU(), l_t, marge_triangle, minx_temp, miny_temp, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ init() [4/4]

void vpTemplateTrackerTriangle::init ( int x1,
int y1,
int x2,
int y2,
int x3,
int y3 )

Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3).

  • x coordinate is along the columns
  • y coordinate is along the rows.

Definition at line 186 of file vpTemplateTrackerTriangle.cpp.

References init().

◆ inTriangle() [1/3]

bool vpTemplateTrackerTriangle::inTriangle ( const double & i,
const double & j ) const

Indicates if a point with coordinates (i,j) is in the triangle.

Parameters
i: Coordinate along the rows.
j: Coordinate along the columns.

Definition at line 286 of file vpTemplateTrackerTriangle.cpp.

References C1, marge_triangle, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ inTriangle() [2/3]

bool vpTemplateTrackerTriangle::inTriangle ( const int & i,
const int & j ) const

Indicates if a point with coordinates (i,j) is in the triangle.

Parameters
i: Coordinate along the rows.
j: Coordinate along the columns.

Definition at line 263 of file vpTemplateTrackerTriangle.cpp.

References C1, marge_triangle, not_good, uvinv00, uvinv01, uvinv10, and uvinv11.

◆ inTriangle() [3/3]

bool vpTemplateTrackerTriangle::inTriangle ( const vpImagePoint & ip) const

Indicates if an image point is in the triangle.

Parameters
ip: Image point to consider.

Definition at line 306 of file vpTemplateTrackerTriangle.cpp.

References vpImagePoint::get_i(), vpImagePoint::get_j(), and inTriangle().

Referenced by vpTemplateTrackerZone::fillTriangle(), and inTriangle().

◆ operator=()

Member Data Documentation

◆ area

◆ C1

◆ C2

◆ C3

◆ h_t

◆ l_t

◆ marge_triangle

◆ minx_temp

◆ miny_temp

◆ not_good

◆ uvinv00

◆ uvinv01

◆ uvinv10

◆ uvinv11