Fawkes API
Fawkes Development Version
|
SURF classifier. More...
#include <>>
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... | |
![]() | |
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 | |
![]() | |
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... | |
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.
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.
keypoints_dir | location of the keypoints (descriptor file as a txt file) for the reference objects |
samplingStep | Initial sampling step |
min_match | minimum number of features that have to be matched per ROI |
min_match_ratio | minimum ratio of features matched per object to be matched per ROI |
octaves | Number of analysed octaves |
thres | Blob response treshold |
doubleImageSize | true to double the image size, false to keep original |
initLobe | Initial lobe size, default 3 and 5 (with double image size) |
upright | rotation invariance (fasle) or upright (true) |
extended | true to use the extended descriptor (SURF 128) |
indexSize | Spatial 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().
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.
object_dir | file that contains an image of the object to detect |
samplingStep | Initial sampling step |
min_match | minimum number of features that have to be matched per ROI |
min_match_ratio | minimum ratio of features matched per object to be matched per ROI |
octaves | Number of analysed octaves |
thres | Blob response treshold |
doubleImageSize | true to double the image size, false to keep original |
initLobe | Initial lobe size, default 3 and 5 (with double image size) |
upright | rotation invariance (fasle) or upright (true) |
extended | true to use the extended descriptor (SURF 128) |
indexSize | Spatial 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().
|
virtual |
|
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.
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().