Fawkes API  Fawkes Development Version
firevision::SurfClassifier Class Reference

SURF classifier. More...

#include <>>

Inheritance diagram for firevision::SurfClassifier:

Public Member Functions

 SurfClassifier (std::string keypoints_descriptor_txt_file, unsigned int min_match=5, float min_match_ratio=MIN_MATCH_RATIO, int samplingStep=2, int octaves=4, double thres=4.0, bool doubleImageSize=false, int initLobe=3, bool upright=false, bool extended=false, int indexSize=4)
 Constructor. More...
 
 SurfClassifier (const char *image_directory_png_files, unsigned int min_match=5, float min_match_ratio=MIN_MATCH_RATIO, int samplingStep=2, int octaves=4, double thres=4.0, bool doubleImageSize=false, int initLobe=3, bool upright=false, bool extended=false, int indexSize=4)
 Constructor. More...
 
virtual ~SurfClassifier ()
 Destructor. More...
 
virtual std::list< ROI > * classify ()
 Classify image. More...
 
- Public Member Functions inherited from firevision::Classifier
 Classifier (const char *name)
 Constructor. More...
 
virtual ~Classifier ()
 Destructor. More...
 
virtual void set_src_buffer (unsigned char *yuv422_planar, unsigned int width, unsigned int height)
 Set source buffer. More...
 
virtual const char * name () const
 Get name of classifier. More...
 

Additional Inherited Members

- Protected Attributes inherited from firevision::Classifier
unsigned char * _src
 Source buffer, encoded as YUV422_PLANAR. More...
 
unsigned int _width
 Width in pixels of _src buffer. More...
 
unsigned int _height
 Height in pixels of _src buffer. More...
 

Detailed Description

SURF classifier.

This class provides a classifier that uses SURF to detect objects in a given image by matching features. The objects are reported back as regions of interest. Each ROI contains an object. ROIs with 11x11 are matched features.

This code uses libSurf from http://www.vision.ee.ethz.ch/~surf/ and is partly based on code from their package.

Author
Stefan Schiffer

Definition at line 65 of file surf.h.

Constructor & Destructor Documentation

◆ SurfClassifier() [1/2]

firevision::SurfClassifier::SurfClassifier ( std::string  keypoints_dir,
unsigned int  min_match = 5,
float  min_match_ratio = MIN_MATCH_RATIO,
int  samplingStep = 2,
int  octaves = 4,
double  thres = 4.0,
bool  doubleImageSize = false,
int  initLobe = 3,
bool  upright = false,
bool  extended = false,
int  indexSize = 4 
)

Constructor.

Parameters
keypoints_dirlocation of the keypoints (descriptor file as a txt file) for the reference objects
samplingStepInitial sampling step
min_matchminimum number of features that have to be matched per ROI
min_match_ratiominimum ratio of features matched per object to be matched per ROI
octavesNumber of analysed octaves
thresBlob response treshold
doubleImageSizetrue to double the image size, false to keep original
initLobeInitial lobe size, default 3 and 5 (with double image size)
uprightrotation invariance (fasle) or upright (true)
extendedtrue to use the extended descriptor (SURF 128)
indexSizeSpatial size of the descriptor window (default 4)

surf::ImLoad::saveImage( "obj.pgm", __obj_img);

Definition at line 216 of file surf.cpp.

References fawkes::TimeTracker::add_class(), fawkes::LibLogger::log_error(), fawkes::TimeTracker::ping_end(), and fawkes::TimeTracker::ping_start().

◆ SurfClassifier() [2/2]

firevision::SurfClassifier::SurfClassifier ( const char *  object_dir,
unsigned int  min_match = 5,
float  min_match_ratio = MIN_MATCH_RATIO,
int  samplingStep = 2,
int  octaves = 4,
double  thres = 4.0,
bool  doubleImageSize = false,
int  initLobe = 3,
bool  upright = false,
bool  extended = false,
int  indexSize = 4 
)

Constructor.

Parameters
object_dirfile that contains an image of the object to detect
samplingStepInitial sampling step
min_matchminimum number of features that have to be matched per ROI
min_match_ratiominimum ratio of features matched per object to be matched per ROI
octavesNumber of analysed octaves
thresBlob response treshold
doubleImageSizetrue to double the image size, false to keep original
initLobeInitial lobe size, default 3 and 5 (with double image size)
uprightrotation invariance (fasle) or upright (true)
extendedtrue to use the extended descriptor (SURF 128)
indexSizeSpatial size of the descriptor window (default 4)

surf::ImLoad::saveImage( "obj.pgm", __obj_img);

Definition at line 335 of file surf.cpp.

References fawkes::TimeTracker::add_class(), fawkes::LibLogger::log_error(), fawkes::TimeTracker::ping_end(), and fawkes::TimeTracker::ping_start().

◆ ~SurfClassifier()

firevision::SurfClassifier::~SurfClassifier ( )
virtual

Destructor.

Definition at line 520 of file surf.cpp.

Member Function Documentation

◆ classify()

std::list< ROI > * firevision::SurfClassifier::classify ( )
virtual

Classify image.

The current buffer is processed and scanned for the features the classifier has been written and initialized for. It returns a list of disjunct regions of interest.

Returns
disjunct list of extracted regions of interest

adding feature-ROI

increment feature-match-count

Implements firevision::Classifier.

Definition at line 527 of file surf.cpp.

References firevision::Classifier::_height, firevision::Classifier::_src, firevision::Classifier::_width, fawkes::cblue, fawkes::cgreen, fawkes::cnormal, firevision::ROI::num_hint_points, fawkes::TimeTracker::ping_end(), and fawkes::TimeTracker::ping_start().


The documentation for this class was generated from the following files: