Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches

#include <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, unsigned int height, 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, unsigned int height, 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 (unsigned int index, vpImagePoint &referencePoint)
void getMatchedPoints (unsigned int index, vpImagePoint &referencePoint, vpImagePoint &currentPoint)
unsigned int getIndexInAllReferencePointList (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< vpImagePointm_referenceImagePointsList
std::vector< vpImagePointm_currentImagePointsList
std::vector< unsigned int > m_matchedReferencePoints
bool m_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 60 of file vpBasicKeyPoint.h.

Constructor & Destructor Documentation

◆ vpBasicKeyPoint()

vpBasicKeyPoint::vpBasicKeyPoint ( )
inline

◆ ~vpBasicKeyPoint()

BEGIN_VISP_NAMESPACE vpBasicKeyPoint::~vpBasicKeyPoint ( )
virtual

Destructor.

Definition at line 47 of file vpBasicKeyPoint.cpp.

References m_currentImagePointsList, m_matchedReferencePoints, and m_referenceImagePointsList.

Member Function Documentation

◆ buildReference() [1/3]

virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > & I)
pure virtual

Build reference.

Implemented in vpKeyPoint.

◆ buildReference() [2/3]

virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > & I,
const vpImagePoint & iP,
unsigned int height,
unsigned int width )
pure virtual

Build reference.

Implemented in vpKeyPoint.

◆ buildReference() [3/3]

virtual unsigned int vpBasicKeyPoint::buildReference ( const vpImage< unsigned char > & I,
const vpRect & rectangle )
pure virtual

Build reference.

Implemented in vpKeyPoint.

◆ display() [1/2]

virtual void vpBasicKeyPoint::display ( const vpImage< unsigned char > & Icurrent,
unsigned int size = 3,
const vpColor & color = vpColor::green )
pure virtual

Display keypoints.

Implemented in vpKeyPoint.

References vpColor::green.

◆ display() [2/2]

virtual void vpBasicKeyPoint::display ( const vpImage< unsigned char > & Iref,
const vpImage< unsigned char > & Icurrent,
unsigned int size = 3 )
pure virtual

Display keypoints.

Implemented in vpKeyPoint.

◆ getAllPointsInReferenceImage()

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 130 of file vpBasicKeyPoint.h.

References m_referenceImagePointsList.

◆ getCurrentImagePointsList()

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 235 of file vpBasicKeyPoint.h.

References m_currentImagePointsList.

◆ getIndexInAllReferencePointList()

unsigned int vpBasicKeyPoint::getIndexInAllReferencePointList ( 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.

vpKeyPoint keypoint;
// Here the code to compute the reference points and the current points.
vpImagePoint referencePoint1;
vpImagePoint currentPoint;
keypoint.getMatchedPoints(1, referencePoint1, currentPoint); //Get the first matched points
vpImagePoint referencePoint2;
const vpImagePoint* referencePointsList = keypoint.getAllPointsInReferenceImage();
// Get the first matched reference point index in the complete reference point list
int index = keypoint.getIndexInAllReferencePointList(1);
// Get the first matched reference point
referencePoint2 = referencePointsList[index];
void getMatchedPoints(unsigned int index, vpImagePoint &referencePoint, vpImagePoint &currentPoint)
unsigned int getIndexInAllReferencePointList(unsigned int indexInMatchedPointList)
const vpImagePoint * getAllPointsInReferenceImage()
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that allows keypoints 2D features detection (and descriptors extraction) and matching thanks to...
Definition vpKeyPoint.h:274

Definition at line 196 of file vpBasicKeyPoint.h.

References vpException::fatalError, m_matchedReferencePoints, and vpTRACE.

◆ getMatchedPointNumber()

unsigned int vpBasicKeyPoint::getMatchedPointNumber ( ) const
inline

Get the number of matched points.

Returns
the number of matched points.

Definition at line 217 of file vpBasicKeyPoint.h.

References m_matchedReferencePoints.

◆ getMatchedPoints()

void vpBasicKeyPoint::getMatchedPoints ( 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-SIFT.cpp, tutorial-matching-keypoint-homography.cpp, and tutorial-matching-keypoint.cpp.

Definition at line 162 of file vpBasicKeyPoint.h.

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

◆ getMatchedReferencePoints()

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 246 of file vpBasicKeyPoint.h.

References m_matchedReferencePoints.

◆ getReferenceImagePointsList()

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 226 of file vpBasicKeyPoint.h.

References m_referenceImagePointsList.

◆ getReferencePoint()

void vpBasicKeyPoint::getReferencePoint ( 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 141 of file vpBasicKeyPoint.h.

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

◆ getReferencePointNumber()

unsigned int vpBasicKeyPoint::getReferencePointNumber ( ) const
inline

Get the number of reference points.

Returns
the number of reference points.

Definition at line 210 of file vpBasicKeyPoint.h.

References m_referenceImagePointsList.

◆ matchPoint() [1/3]

virtual unsigned int vpBasicKeyPoint::matchPoint ( const vpImage< unsigned char > & I)
pure virtual

Match keypoints.

Implemented in vpKeyPoint.

◆ matchPoint() [2/3]

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

Match keypoints.

Implemented in vpKeyPoint.

◆ matchPoint() [3/3]

virtual unsigned int vpBasicKeyPoint::matchPoint ( const vpImage< unsigned char > & I,
const vpRect & rectangle )
pure virtual

Match keypoints.

Implemented in vpKeyPoint.

◆ referenceBuilt()

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 122 of file vpBasicKeyPoint.h.

References m_reference_computed.

Member Data Documentation

◆ m_currentImagePointsList

std::vector<vpImagePoint> vpBasicKeyPoint::m_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 258 of file vpBasicKeyPoint.h.

Referenced by getCurrentImagePointsList(), getMatchedPoints(), vpKeyPoint::getQueryKeyPoints(), vpKeyPoint::matchPoint(), vpKeyPoint::matchPoint(), vpKeyPoint::reset(), vpBasicKeyPoint(), and ~vpBasicKeyPoint().

◆ m_matchedReferencePoints

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

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

The first element of the "m_currentImagePointsList" array is matched with the nth element of the "m_referenceImagePointsList" array. The value of n is stored in the first element of the "m_matchedReferencePoints" array.

Definition at line 268 of file vpBasicKeyPoint.h.

Referenced by getIndexInAllReferencePointList(), getMatchedPointNumber(), getMatchedPoints(), getMatchedReferencePoints(), vpKeyPoint::matchPoint(), vpKeyPoint::matchPoint(), vpKeyPoint::reset(), vpBasicKeyPoint(), and ~vpBasicKeyPoint().

◆ m_reference_computed

bool vpBasicKeyPoint::m_reference_computed
protected

◆ m_referenceImagePointsList