Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpBasicKeyPoint Class Referenceabstract

#include <visp3/vision/vpBasicKeyPoint.h>

+ Inheritance diagram for vpBasicKeyPoint:

Public Member Functions

 vpBasicKeyPoint ()
 
virtual ~vpBasicKeyPoint ()
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I)=0
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int height, const unsigned int width)=0
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I, const vpRect &rectangle)=0
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I)=0
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int height, const unsigned int width)=0
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I, const vpRect &rectangle)=0
 
virtual void display (const vpImage< unsigned char > &Iref, const vpImage< unsigned char > &Icurrent, unsigned int size=3)=0
 
virtual void display (const vpImage< unsigned char > &Icurrent, unsigned int size=3, const vpColor &color=vpColor::green)=0
 
bool referenceBuilt () const
 
const vpImagePointgetAllPointsInReferenceImage ()
 
void getReferencePoint (const unsigned int index, vpImagePoint &referencePoint)
 
void getMatchedPoints (const unsigned int index, vpImagePoint &referencePoint, vpImagePoint &currentPoint)
 
unsigned int getIndexInAllReferencePointList (const unsigned int indexInMatchedPointList)
 
unsigned int getReferencePointNumber () const
 
unsigned int getMatchedPointNumber () const
 
const std::vector< vpImagePoint > & getReferenceImagePointsList () const
 
const std::vector< vpImagePoint > & getCurrentImagePointsList () const
 
const std::vector< unsigned int > & getMatchedReferencePoints () const
 

Protected Attributes

std::vector< vpImagePointreferenceImagePointsList
 
std::vector< vpImagePointcurrentImagePointsList
 
std::vector< unsigned int > matchedReferencePoints
 
bool _reference_computed
 

Detailed Description

class that defines what is a Keypoint. This class provides all the basic elements to implement classes which aims to match points from an image to another.

Definition at line 63 of file vpBasicKeyPoint.h.

Constructor & Destructor Documentation

vpBasicKeyPoint::vpBasicKeyPoint ( )

Basic constructor.

Definition at line 44 of file vpBasicKeyPoint.cpp.

virtual vpBasicKeyPoint::~vpBasicKeyPoint ( )
inlinevirtual

Definition at line 68 of file vpBasicKeyPoint.h.

Member Function Documentation

virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > &  I)
pure virtual
virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > &  I,
const vpImagePoint iP,
const unsigned int  height,
const unsigned int  width 
)
pure virtual
virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > &  I,
const vpRect rectangle 
)
pure virtual
virtual void vpBasicKeyPoint::display ( const vpImage< unsigned char > &  Iref,
const vpImage< unsigned char > &  Icurrent,
unsigned int  size = 3 
)
pure virtual
virtual void vpBasicKeyPoint::display ( const vpImage< unsigned char > &  Icurrent,
unsigned int  size = 3,
const vpColor color = vpColor::green 
)
pure virtual
const vpImagePoint* vpBasicKeyPoint::getAllPointsInReferenceImage ( )
inline

Get the pointer to the complete list of reference points. The pointer is const. Thus the points can not be modified

Returns
The pointer to the complete list of reference points.

Definition at line 110 of file vpBasicKeyPoint.h.

const std::vector<vpImagePoint>& vpBasicKeyPoint::getCurrentImagePointsList ( ) const
inline

Return the vector of current image point.

Warning
Should not be modified.
Returns
Vector of the current image point.

Definition at line 207 of file vpBasicKeyPoint.h.

unsigned int vpBasicKeyPoint::getIndexInAllReferencePointList ( const unsigned int  indexInMatchedPointList)
inline

Get the nth matched reference point index in the complete list of reference point.

In the code below referencePoint1 and referencePoint2 correspond to the same matched reference point.

//Here the code to compute the reference points and the current points.
vpImagePoint referencePoint1;
vpImagePoint currentPoint;
surf.getMatchedPoints(1, referencePoint1, currentPoint); //Get the first matched points
vpImagePoint referencePoint2;
const vpImagePoint* referencePointsList = surf.getAllPointsInReferenceImage();
int index = surf.getIndexInAllReferencePointList(1); //Get the first matched reference point index in the complete reference point list
referencePoint2 = referencePointsList[index]; //Get the first matched reference point

Definition at line 168 of file vpBasicKeyPoint.h.

References vpException::fatalError, and vpTRACE.

unsigned int vpBasicKeyPoint::getMatchedPointNumber ( ) const
inline

Get the number of matched points.

Returns
the number of matched points.

Definition at line 189 of file vpBasicKeyPoint.h.

void vpBasicKeyPoint::getMatchedPoints ( const unsigned int  index,
vpImagePoint referencePoint,
vpImagePoint currentPoint 
)
inline

Get the nth couple of reference point and current point which have been matched. These points are copied in the vpImagePoint instances given in argument.

Parameters
index: The index of the desired couple of reference point and current point . The index must be between 0 and the number of matched points - 1.
referencePoint: The coordinates of the desired reference point are copied here.
currentPoint: The coordinates of the desired current point are copied here.
Examples:
tutorial-matching-keypoint-homography.cpp, tutorial-matching-keypoint-SIFT.cpp, tutorial-matching-keypoint.cpp, tutorial-matching-surf-deprecated.cpp, and tutorial-matching-surf-homography-deprecated.cpp.

Definition at line 138 of file vpBasicKeyPoint.h.

References vpException::fatalError, vpImagePoint::set_ij(), and vpTRACE.

const std::vector<unsigned int>& vpBasicKeyPoint::getMatchedReferencePoints ( ) const
inline

Return the index of the matched associated to the current image point i. The ith element of the vector is the index of the reference image point matching with the current image point.

Warning
Should not be modified.
Returns
The vector of matching index.

Definition at line 218 of file vpBasicKeyPoint.h.

const std::vector<vpImagePoint>& vpBasicKeyPoint::getReferenceImagePointsList ( ) const
inline

Return the vector of reference image point.

Warning
Should not be modified.
Returns
Vector of reference image point.

Definition at line 198 of file vpBasicKeyPoint.h.

void vpBasicKeyPoint::getReferencePoint ( const unsigned int  index,
vpImagePoint referencePoint 
)
inline

Get the nth reference point. This point is copied in the vpImagePoint instance given in argument.

Parameters
index: The index of the desired reference point. The index must be between 0 and the number of reference points - 1.
referencePoint: The coordinates of the desired reference point are copied there.

Definition at line 120 of file vpBasicKeyPoint.h.

References vpException::fatalError, vpImagePoint::set_ij(), and vpTRACE.

unsigned int vpBasicKeyPoint::getReferencePointNumber ( ) const
inline

Get the number of reference points.

Returns
the number of reference points.

Definition at line 182 of file vpBasicKeyPoint.h.

virtual unsigned int vpBasicKeyPoint::matchPoint ( const vpImage< unsigned char > &  I)
pure virtual
virtual unsigned int vpBasicKeyPoint::matchPoint ( const vpImage< unsigned char > &  I,
const vpImagePoint iP,
const unsigned int  height,
const unsigned int  width 
)
pure virtual
virtual unsigned int vpBasicKeyPoint::matchPoint ( const vpImage< unsigned char > &  I,
const vpRect rectangle 
)
pure virtual
bool vpBasicKeyPoint::referenceBuilt ( ) const
inline

Indicate wether the reference has been built or not.

Returns
True if the reference of the current instance has been built.

Definition at line 103 of file vpBasicKeyPoint.h.

Member Data Documentation

bool vpBasicKeyPoint::_reference_computed
protected
std::vector<vpImagePoint> vpBasicKeyPoint::currentImagePointsList
protected

List of the points which belong to the current image and have been matched with points belonging to the reference.

Definition at line 233 of file vpBasicKeyPoint.h.

Referenced by vpKeyPointSurf::display(), vpFernClassifier::display(), vpKeyPoint::getQueryKeyPoints(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), vpKeyPoint::matchPoint(), and vpKeyPoint::reset().

std::vector<unsigned int> vpBasicKeyPoint::matchedReferencePoints
protected

Array containing the index in the array "referenceImagePointsList" of the reference points which have been matched.

The first element of the "currentImagePointsList" array is matched with the nth element of the "referenceImagePointsList" array. The value of n is stored in the first element of the "matchedReferencePoints" array.

Definition at line 241 of file vpBasicKeyPoint.h.

Referenced by vpKeyPointSurf::display(), vpFernClassifier::display(), vpKeyPointSurf::matchPoint(), vpFernClassifier::matchPoint(), vpKeyPoint::matchPoint(), and vpKeyPoint::reset().