Visual Servoing Platform  version 3.1.0

#include <visp3/vision/vpFernClassifier.h>

+ Inheritance diagram for vpFernClassifier:

Public Member Functions

 vpFernClassifier ()
 
 vpFernClassifier (const std::string &_dataFile, const std::string &_objectName)
 
virtual ~vpFernClassifier ()
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I)
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int height, const unsigned int width)
 
virtual unsigned int buildReference (const vpImage< unsigned char > &I, const vpRect &rectangle)
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I)
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int height, const unsigned int width)
 
virtual unsigned int matchPoint (const vpImage< unsigned char > &I, const vpRect &rectangle)
 
virtual void display (const vpImage< unsigned char > &Iref, const vpImage< unsigned char > &Icurrent, unsigned int size=3)
 
virtual void display (const vpImage< unsigned char > &Icurrent, unsigned int size=3, const vpColor &color=vpColor::green)
 
void load (const std::string &_dataFile, const std::string &)
 
void record (const std::string &_objectName, const std::string &_dataFile)
 
void setBlurSetting (const bool _blur)
 
void setBlurSettings (const bool _blur, int _sigma, int _size)
 
bool getBlurSetting ()
 
int getBlurSigma ()
 
int getBlurSize ()
 
const std::vector< cv::Point2f > & getRefPt () const
 
const std::vector< cv::Point2f > & getCurPt () const
 
cv::Rect getModelROI () const
 
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 Member Functions

void setImage (const vpImage< unsigned char > &I)
 
void train ()
 
virtual void init ()
 

Protected Attributes

cv::LDetector ldetector
 
cv::FernClassifier fernClassifier
 
cv::PatchGenerator gen
 
bool hasLearn
 
int threshold
 
int nbView
 
int dist
 
int nbClassfier
 
int ClassifierSize
 
int nbOctave
 
int patchSize
 
int radius
 
int nbPoints
 
bool blurImage
 
int radiusBlur
 
int sigmaBlur
 
unsigned int nbMinPoint
 
cv::Mat curImg
 
std::vector< cv::KeyPoint > objKeypoints
 
cv::Rect modelROI_Ref
 
cv::Rect modelROI
 
std::vector< cv::KeyPoint > modelPoints
 
std::vector< cv::KeyPoint > imgKeypoints
 
std::vector< cv::Point2f > refPt
 
std::vector< cv::Point2f > curPt
 
std::vector< vpImagePointreferenceImagePointsList
 
std::vector< vpImagePointcurrentImagePointsList
 
std::vector< unsigned int > matchedReferencePoints
 
bool _reference_computed
 

Detailed Description

Class that implements the Fern classifier and the YAPE detector thanks to the OpenCV library.

Deprecated:
This class is deprecated with OpenCV 3.0.0 or more recent.

This class provides a way to detect and match point using the YAPE and a Fern Classifiers, thanks to the OpenCV library (version >= 2.0)

This class provides a tool to match points between a model and the current image. The points of interests belonging to the model and the points detected in the current image are given in pixels thanks to the vpImagePoint class.

For more details about the Ferns Classifier and the point detector, see [34] and [21].

To use this class, you first have to detect points in the model and train the associated Fern classifier. Then, for each new grabbed image, You can detect points and try to match them with the model.

As training can requires up to several minutes, it is possible to save (in a file) and load the classifier.

The following small example shows how to use the class.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpImage.h>
#include <visp3/vision/vpFernClassifier.h>
#if VISP_HAVE_OPENCV_VERSION >= 0x020000 // Fern classifier only available
since OpenCV-2.0.0 int main()
{
//First grab the reference image Ireference
//Build the reference points.
fern.buildReference(Ireference);
//Then grab another image which represents the current image Icurrent
//Match points between the reference points and the points detected in the current image.
fern.matchPoint(Icurrent);
//Display the matched points
fern.display(Ireference, Icurrent);
return (0);
}
#else
int main() {}
#endif

It is also possible to create the reference thanks to only a part of the reference image (not the whole image) and find points to match in only a part of the current image. The small following example shows how to do this.

#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDisplay.h>
#include <visp3/core/vpImage.h>
#include <visp3/vision/vpFernClassifier.h>
#if VISP_HAVE_OPENCV_VERSION >= 0x020000 // Fern classifier only available
since OpenCV-2.0.0 int main()
{
//First grab the reference image Ireference
//Select a part of the image by clicking on two points which define a rectangle
vpImagePoint corners[2];
for (int i=0 ; i < 2 ; i++) {
vpDisplay::getClick(Ireference, corners[i]);
}
//Build the reference points.
int nbrRef;
unsigned int height, width;
height = (unsigned int)(corners[1].get_i() - corners[0].get_i());
width = (unsigned int)(corners[1].get_j() - corners[0].get_j());
nbrRef = fern.buildReference(Ireference, corners[0], height, width);
// Then grab another image which represents the current image Icurrent
//Select a part of the image by clincking on two points which define a rectangle
for (int i=0 ; i < 2 ; i++) {
vpDisplay::getClick(Icurrent, corners[i]);
}
// Match points between the reference points and the points detected in the current image.
int nbrMatched;
height = (unsigned int)(corners[1].get_i() - corners[0].get_i());
width = (unsigned int)(corners[1].get_j() - corners[0].get_j());
nbrMatched = fern.matchPoint(Icurrent, corners[0], height, width);
// Display the matched points
fern.display(Ireference, Icurrent);
return(0);
}
#else
int main() {}
#endif
Examples:
fernClassifier.cpp.

Definition at line 176 of file vpFernClassifier.h.

Constructor & Destructor Documentation

◆ vpFernClassifier() [1/2]

vpFernClassifier::vpFernClassifier ( )

Basic constructor

Definition at line 55 of file vpFernClassifier.cpp.

◆ vpFernClassifier() [2/2]

vpFernClassifier::vpFernClassifier ( const std::string &  _dataFile,
const std::string &  _objectName 
)

Constructor using the provided data file to load the object given by its name.

If the name of the object does not correspond in the file, a vpException::ioError is thrown.

Parameters
_dataFile: the name of the file saved after a training (with the record methods).
_objectName: the name of the object to load

Definition at line 80 of file vpFernClassifier.cpp.

References load().

◆ ~vpFernClassifier()

vpFernClassifier::~vpFernClassifier ( )
virtual

Basic destructor

Definition at line 99 of file vpFernClassifier.cpp.

References curImg.

Member Function Documentation

◆ buildReference() [1/3]

unsigned int vpFernClassifier::buildReference ( const vpImage< unsigned char > &  _I)
virtual

Build the list of reference points. The computation of the points is made all over the image I. It also includes the training of the fern classifier.

Warning
thie method can take up to several minutes depending on the parameters of the classifier and on the size of the image.
Parameters
_I: The gray scaled image where the reference points are computed.
Returns
the number of reference points.

Implements vpBasicKeyPoint.

Examples:
fernClassifier.cpp.

Definition at line 196 of file vpFernClassifier.cpp.

References vpBasicKeyPoint::_reference_computed, objKeypoints, setImage(), and train().

Referenced by vpPlanarObjectDetector::buildReference(), and buildReference().

◆ buildReference() [2/3]

unsigned int vpFernClassifier::buildReference ( const vpImage< unsigned char > &  _I,
const vpImagePoint _iP,
const unsigned int  _height,
const unsigned int  _width 
)
virtual

Build the list of reference points. The computation of the points is made only on a part of the image. This part is a rectangle defined by its top left corner, its height and its width. The parameters of this rectangle must be given in pixel. It also includes the training of the fern classifier.

Warning
the method can take up to several minutes depending on the parameters of the classifier and on the size of the image.
Parameters
_I: The gray scaled image where the reference points are computed.
_iP: The top left corner of the rectangle.
_height: height of the rectangle (in pixel).
_width: width of the rectangle (in pixel).
Returns
the number of reference points.

Implements vpBasicKeyPoint.

Definition at line 224 of file vpFernClassifier.cpp.

References vpImageTools::crop(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImagePoint::get_u(), vpImagePoint::get_v(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), modelROI_Ref, vpImageException::notInTheImage, objKeypoints, setImage(), train(), and vpTRACE.

◆ buildReference() [3/3]

unsigned int vpFernClassifier::buildReference ( const vpImage< unsigned char > &  _I,
const vpRect _rectangle 
)
virtual

Build the list of reference points. The computation of the points is made only on a part of the image. This part is a rectangle. The parameters of this rectangle must be given in pixel. It also includes the training of the fern classifier.

Warning
the method can take up to several minutes depending on the parameters of the classifier and on the size of the image.
Parameters
_I: The gray scaled image where the reference points are computed.
_rectangle: The rectangle which defines the interesting part of the image.
Returns
The number of reference points.

Implements vpBasicKeyPoint.

Definition at line 264 of file vpFernClassifier.cpp.

References buildReference(), vpRect::getHeight(), vpRect::getLeft(), vpRect::getTop(), vpRect::getWidth(), vpImagePoint::set_i(), and vpImagePoint::set_j().

◆ display() [1/2]

void vpFernClassifier::display ( const vpImage< unsigned char > &  _Iref,
const vpImage< unsigned char > &  _Icurrent,
unsigned int  size = 3 
)
virtual

This function displays the matched reference points and the matched points computed in the current image. The reference points are displayed in the image Ireference and the matched points coming from the current image are displayed in the image Icurrent. It is possible to set Ireference and Icurrent with the same image when calling the method.

Parameters
_Iref: The image where the matched reference points are displayed.
_Icurrent: The image where the matched points computed in the current image are displayed.
size: Size in pixels of the cross that is used to display matched points.

Implements vpBasicKeyPoint.

Examples:
fernClassifier.cpp.

Definition at line 411 of file vpFernClassifier.cpp.

References vpBasicKeyPoint::currentImagePointsList, vpDisplay::displayCross(), vpColor::green, vpBasicKeyPoint::matchedReferencePoints, vpColor::red, and vpBasicKeyPoint::referenceImagePointsList.

◆ display() [2/2]

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

This function displays only the matched points computed in the current image. They are displayed in the image Icurrent.

Parameters
_Icurrent: the gray scaled image for the display
size: Size in pixels of the cross that is used to display matched points.
color: Color used to display the matched points.

Implements vpBasicKeyPoint.

Definition at line 431 of file vpFernClassifier.cpp.

References vpBasicKeyPoint::currentImagePointsList, vpDisplay::displayCross(), and vpBasicKeyPoint::matchedReferencePoints.

◆ getAllPointsInReferenceImage()

const vpImagePoint* vpBasicKeyPoint::getAllPointsInReferenceImage ( )
inlineinherited

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

◆ getBlurSetting()

bool vpFernClassifier::getBlurSetting ( )
inline

Return the blur option. The Blur option is used to activate a filter used to blur the input image. The blurring can improve the robustness of the detection.

Returns
the value of the blur option.

Definition at line 288 of file vpFernClassifier.h.

Referenced by matchPoint(), and train().

◆ getBlurSigma()

int vpFernClassifier::getBlurSigma ( )
inline

Return the blur sigma (for the filter) option.

Returns
The value of the sigma for the blur filter.

Definition at line 295 of file vpFernClassifier.h.

Referenced by matchPoint(), and train().

◆ getBlurSize()

int vpFernClassifier::getBlurSize ( )
inline

return the blur size (for the filter) option

Returns
the value of the radius for the blur filter

Definition at line 302 of file vpFernClassifier.h.

Referenced by matchPoint(), and train().

◆ getCurPt()

const std::vector<cv::Point2f>& vpFernClassifier::getCurPt ( ) const
inline

Return a reference on the vector of current points in the OpenCV format

Returns
the list of current points

Definition at line 316 of file vpFernClassifier.h.

Referenced by vpPlanarObjectDetector::matchPoint().

◆ getCurrentImagePointsList()

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

Return the vector of current image point.

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

Definition at line 212 of file vpBasicKeyPoint.h.

◆ getIndexInAllReferencePointList()

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

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();
// Get the first matched reference point index in the complete reference point list
int index = surf.getIndexInAllReferencePointList(1);
// Get the first matched reference point
referencePoint2 = referencePointsList[index];

Definition at line 173 of file vpBasicKeyPoint.h.

References vpException::fatalError, and vpTRACE.

◆ getMatchedPointNumber()

unsigned int vpBasicKeyPoint::getMatchedPointNumber ( ) const
inlineinherited

Get the number of matched points.

Returns
the number of matched points.

Definition at line 194 of file vpBasicKeyPoint.h.

◆ getMatchedPoints()

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

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.

◆ getMatchedReferencePoints()

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

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

◆ getModelROI()

cv::Rect vpFernClassifier::getModelROI ( ) const
inline

Return the region of interest in the OpenCV format

Definition at line 321 of file vpFernClassifier.h.

Referenced by vpPlanarObjectDetector::load().

◆ getReferenceImagePointsList()

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

Return the vector of reference image point.

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

Definition at line 203 of file vpBasicKeyPoint.h.

◆ getReferencePoint()

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

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

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

◆ getReferencePointNumber()

unsigned int vpBasicKeyPoint::getReferencePointNumber ( ) const
inlineinherited

Get the number of reference points.

Returns
the number of reference points.

Definition at line 187 of file vpBasicKeyPoint.h.

◆ getRefPt()

const std::vector<cv::Point2f>& vpFernClassifier::getRefPt ( ) const
inline

Return a reference on the vector of reference points in the OpenCV format

Returns
the list of reference points

Definition at line 309 of file vpFernClassifier.h.

Referenced by vpPlanarObjectDetector::matchPoint().

◆ init()

void vpFernClassifier::init ( void  )
protectedvirtual

initialise any OpenCV parameters

The classifier need to be trained again or to be loaded from an external file.

Implements vpBasicKeyPoint.

Definition at line 120 of file vpFernClassifier.cpp.

References blurImage, ClassifierSize, curImg, dist, hasLearn, nbClassfier, nbMinPoint, nbOctave, nbPoints, nbView, patchSize, radius, radiusBlur, sigmaBlur, and threshold.

◆ load()

void vpFernClassifier::load ( const std::string &  _dataFile,
const std::string &   
)

load the Fern classifier

Load and initialize the Fern classifier and load the 3D and 2D keypoints. It can take up to sevral seconds.

Parameters
_dataFile: The name of the data filename (very large text file). It can have any file extension.
Examples:
fernClassifier.cpp.

Definition at line 449 of file vpFernClassifier.cpp.

References dist, fernClassifier, hasLearn, ldetector, modelPoints, modelROI, nbOctave, nbView, patchSize, radius, and threshold.

Referenced by vpPlanarObjectDetector::load(), and vpFernClassifier().

◆ matchPoint() [1/3]

unsigned int vpFernClassifier::matchPoint ( const vpImage< unsigned char > &  _I)
virtual

Compute the points of interest in the current image and try to match them using the trained classifier. The matched pairs can be found with the getMatchedPointByRef function.

Exceptions
vpException::notInitialisedif the classifier has not been trained.
Parameters
_I: The gray scaled image where the points are computed.
Returns
The number of point which have been matched.

Implements vpBasicKeyPoint.

Examples:
fernClassifier.cpp.

Definition at line 284 of file vpFernClassifier.cpp.

References curImg, curPt, vpBasicKeyPoint::currentImagePointsList, fernClassifier, getBlurSetting(), getBlurSigma(), getBlurSize(), hasLearn, imgKeypoints, ldetector, vpBasicKeyPoint::matchedReferencePoints, modelPoints, vpException::notInitialized, refPt, setImage(), and vpERROR_TRACE.

Referenced by vpPlanarObjectDetector::matchPoint(), and matchPoint().

◆ matchPoint() [2/3]

unsigned int vpFernClassifier::matchPoint ( const vpImage< unsigned char > &  _I,
const vpImagePoint _iP,
const unsigned int  _height,
const unsigned int  _width 
)
virtual

Compute the points of interest in the specified region of the current image and try to recognise them using the trained classifier. The matched pairs can be found with the getMatchedPointByRef function. The homography between the two planar surfaces is also computed.

Parameters
_I: The gray scaled image where the points are computed.
_iP: the top left corner of the rectangle defining the ROI
_height: the height of the ROI
_width: the width of the ROI
Returns
the number of point which have been matched.

Implements vpBasicKeyPoint.

Definition at line 360 of file vpFernClassifier.cpp.

References vpImageTools::crop(), vpImagePoint::get_i(), vpImagePoint::get_j(), vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), matchPoint(), vpImageException::notInTheImage, and vpTRACE.

◆ matchPoint() [3/3]

unsigned int vpFernClassifier::matchPoint ( const vpImage< unsigned char > &  _I,
const vpRect _rectangle 
)
virtual

Compute the points of interest in the specified region of the current image and try to recognise them using the trained classifier. The matched pairs can be found with the getMatchedPointByRef function. The homography between the two planar surfaces is also computed.

Parameters
_I: The gray scaled image where the points are computed.
_rectangle: the rectangle defining the ROI
Returns
the number of point which have been matched.

Implements vpBasicKeyPoint.

Definition at line 386 of file vpFernClassifier.cpp.

References vpRect::getHeight(), vpRect::getLeft(), vpRect::getTop(), vpRect::getWidth(), matchPoint(), vpImagePoint::set_i(), and vpImagePoint::set_j().

◆ record()

void vpFernClassifier::record ( const std::string &  _objectName,
const std::string &  _dataFile 
)

record the Ferns classifier in the text file

Parameters
_objectName: The name of the object to store in the data file.
_dataFile: The name of the data filename (very large text file). It can have any file extension.
Examples:
fernClassifier.cpp.

Definition at line 478 of file vpFernClassifier.cpp.

References fernClassifier, ldetector, modelPoints, and modelROI_Ref.

Referenced by vpPlanarObjectDetector::recordDetector().

◆ referenceBuilt()

bool vpBasicKeyPoint::referenceBuilt ( ) const
inlineinherited

Indicate wether the reference has been built or not.

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

Definition at line 99 of file vpBasicKeyPoint.h.

◆ setBlurSetting()

void vpFernClassifier::setBlurSetting ( const bool  _blur)
inline

The image is blurred before being processed. This solution can lead to a better recognition rate.

Parameters
_blur: the new option for the blur

Definition at line 278 of file vpFernClassifier.h.

◆ setBlurSettings()

void vpFernClassifier::setBlurSettings ( const bool  _blur,
int  _sigma,
int  _size 
)
inline

◆ setImage()

void vpFernClassifier::setImage ( const vpImage< unsigned char > &  I)
protected

Set the current image. This method allows to convert a image from the ViSP format to the OpenCV one.

Parameters
I: the input image.

Definition at line 504 of file vpFernClassifier.cpp.

References vpImage< Type >::bitmap, vpImageConvert::convert(), curImg, vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpException::memoryAllocationError, and vpException::notInitialized.

Referenced by buildReference(), and matchPoint().

◆ train()

Member Data Documentation

◆ _reference_computed

bool vpBasicKeyPoint::_reference_computed
protectedinherited

◆ blurImage

bool vpFernClassifier::blurImage
protected

Flag to specify whether the reference image have to be blurred or not in order to improve the recognition rate

Definition at line 214 of file vpFernClassifier.h.

Referenced by init().

◆ ClassifierSize

int vpFernClassifier::ClassifierSize
protected

Size of the classifier.

Definition at line 201 of file vpFernClassifier.h.

Referenced by init().

◆ curImg

cv::Mat vpFernClassifier::curImg
protected

The current image in the OpenCV format.

Definition at line 226 of file vpFernClassifier.h.

Referenced by init(), matchPoint(), setImage(), train(), and ~vpFernClassifier().

◆ curPt

std::vector<cv::Point2f> vpFernClassifier::curPt
protected

Definition at line 242 of file vpFernClassifier.h.

Referenced by matchPoint().

◆ currentImagePointsList

std::vector<vpImagePoint> vpBasicKeyPoint::currentImagePointsList
protectedinherited

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

Definition at line 238 of file vpBasicKeyPoint.h.

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

◆ dist

int vpFernClassifier::dist
protected

Minimal distance between two points.

Definition at line 197 of file vpFernClassifier.h.

Referenced by init(), load(), and train().

◆ fernClassifier

cv::FernClassifier vpFernClassifier::fernClassifier
protected

The Fern classifier.

Definition at line 183 of file vpFernClassifier.h.

Referenced by load(), matchPoint(), record(), and train().

◆ gen

cv::PatchGenerator vpFernClassifier::gen
protected

The patch generator (OpenCV format).

Definition at line 186 of file vpFernClassifier.h.

Referenced by train().

◆ hasLearn

bool vpFernClassifier::hasLearn
protected

Flag to indicate whether the classifier has been trained or not.

Definition at line 189 of file vpFernClassifier.h.

Referenced by init(), load(), matchPoint(), and train().

◆ imgKeypoints

std::vector<cv::KeyPoint> vpFernClassifier::imgKeypoints
protected

the vector containing the points in the current image.

Definition at line 240 of file vpFernClassifier.h.

Referenced by matchPoint().

◆ ldetector

cv::LDetector vpFernClassifier::ldetector
protected

The points of interest detector.

Definition at line 180 of file vpFernClassifier.h.

Referenced by load(), matchPoint(), record(), and train().

◆ matchedReferencePoints

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

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

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

◆ modelPoints

std::vector<cv::KeyPoint> vpFernClassifier::modelPoints
protected

the vector containing the points in the model.

Definition at line 238 of file vpFernClassifier.h.

Referenced by load(), matchPoint(), record(), and train().

◆ modelROI

cv::Rect vpFernClassifier::modelROI
protected

the ROI for the reference image.

Definition at line 236 of file vpFernClassifier.h.

Referenced by load(), and train().

◆ modelROI_Ref

cv::Rect vpFernClassifier::modelROI_Ref
protected

the ROI in the reference image.

Definition at line 234 of file vpFernClassifier.h.

Referenced by buildReference(), record(), and train().

◆ nbClassfier

int vpFernClassifier::nbClassfier
protected

Number of classifier.

Definition at line 199 of file vpFernClassifier.h.

Referenced by init().

◆ nbMinPoint

unsigned int vpFernClassifier::nbMinPoint
protected

Number of minimum point below which the homography is not estimated (must be at least four)

Definition at line 222 of file vpFernClassifier.h.

Referenced by init().

◆ nbOctave

int vpFernClassifier::nbOctave
protected

Number of octave for the multi scale.

Definition at line 203 of file vpFernClassifier.h.

Referenced by init(), load(), and train().

◆ nbPoints

int vpFernClassifier::nbPoints
protected

Maximal number of points.

Definition at line 209 of file vpFernClassifier.h.

Referenced by init().

◆ nbView

int vpFernClassifier::nbView
protected

Number of view to generate for the training.

Definition at line 195 of file vpFernClassifier.h.

Referenced by init(), load(), and train().

◆ objKeypoints

std::vector<cv::KeyPoint> vpFernClassifier::objKeypoints
protected

keypoints detected in the reference image.

Definition at line 232 of file vpFernClassifier.h.

Referenced by buildReference(), and train().

◆ patchSize

int vpFernClassifier::patchSize
protected

Size of the patch.

Definition at line 205 of file vpFernClassifier.h.

Referenced by init(), load(), and train().

◆ radius

int vpFernClassifier::radius
protected

Radius for the detector.

Definition at line 207 of file vpFernClassifier.h.

Referenced by init(), load(), and train().

◆ radiusBlur

int vpFernClassifier::radiusBlur
protected

Radius of the kernel used to blur the image.

Definition at line 216 of file vpFernClassifier.h.

Referenced by init().

◆ referenceImagePointsList

◆ refPt

std::vector<cv::Point2f> vpFernClassifier::refPt
protected

vector in the OpenCV format to be used by the detector.

Definition at line 242 of file vpFernClassifier.h.

Referenced by matchPoint().

◆ sigmaBlur

int vpFernClassifier::sigmaBlur
protected

Sigma of the kernel used to blur the image.

Definition at line 218 of file vpFernClassifier.h.

Referenced by init().

◆ threshold

int vpFernClassifier::threshold
protected

Threshold to accept or reject points (usually around 20)

Definition at line 193 of file vpFernClassifier.h.

Referenced by init(), load(), and train().