39 #ifndef vpBasicKeyPoint_H
40 #define vpBasicKeyPoint_H
47 #include <visp3/core/vpColor.h>
48 #include <visp3/core/vpImage.h>
49 #include <visp3/core/vpImagePoint.h>
50 #include <visp3/core/vpRect.h>
69 matchedReferencePoints.resize(0);
70 currentImagePointsList.resize(0);
71 referenceImagePointsList.resize(0);
77 const unsigned int height,
const unsigned int width) = 0;
84 const unsigned int width) = 0;
89 unsigned int size = 3) = 0;
99 bool referenceBuilt()
const {
return _reference_computed; }
107 inline const vpImagePoint *getAllPointsInReferenceImage() {
return &referenceImagePointsList[0]; };
117 inline void getReferencePoint(
const unsigned int index,
vpImagePoint &referencePoint)
119 if (index >= referenceImagePointsList.size()) {
120 vpTRACE(
"Index of the reference point out of range");
124 referencePoint.
set_ij(referenceImagePointsList[index].get_i(), referenceImagePointsList[index].get_j());
140 if (index >= matchedReferencePoints.size()) {
141 vpTRACE(
"Index of the matched points out of range");
144 referencePoint.
set_ij(referenceImagePointsList[matchedReferencePoints[index]].get_i(),
145 referenceImagePointsList[matchedReferencePoints[index]].get_j());
146 currentPoint.
set_ij(currentImagePointsList[index].get_i(), currentImagePointsList[index].get_j());
173 inline unsigned int getIndexInAllReferencePointList(
const unsigned int indexInMatchedPointList)
175 if (indexInMatchedPointList >= matchedReferencePoints.size()) {
176 vpTRACE(
"Index of the matched reference point out of range");
179 return matchedReferencePoints[indexInMatchedPointList];
187 inline unsigned int getReferencePointNumber()
const {
return (
unsigned int)referenceImagePointsList.size(); };
194 inline unsigned int getMatchedPointNumber()
const {
return (
unsigned int)matchedReferencePoints.size(); };
203 const std::vector<vpImagePoint> &getReferenceImagePointsList()
const {
return referenceImagePointsList; }
212 const std::vector<vpImagePoint> &getCurrentImagePointsList()
const {
return currentImagePointsList; }
223 const std::vector<unsigned int> &getMatchedReferencePoints()
const {
return matchedReferencePoints; }
226 virtual void init() = 0;
232 std::vector<vpImagePoint> referenceImagePointsList;
238 std::vector<vpImagePoint> currentImagePointsList;
248 std::vector<unsigned int> matchedReferencePoints;
251 bool _reference_computed;