Simple classifier. More...
#include <classifiers/simple.h>
Public Member Functions | |
SimpleColorClassifier (ScanlineModel *scanline_model, ColorModel *color_model, unsigned int min_num_points=6, unsigned int box_extent=50, bool upward=false, unsigned int neighbourhood_min_match=8, unsigned int grow_by=10) | |
Constructor. | |
virtual std::list< ROI > * | classify () |
Classify image. | |
virtual void | get_mass_point_of_ball (ROI *roi, fawkes::point_t *massPoint) |
Get mass point of ball. | |
virtual void | set_hint (hint_t hint) |
Sets the object of interest (hint_t). | |
virtual void | add_hint (hint_t hint) |
Adds another object of interest (hint_t). |
Simple classifier.
Definition at line 37 of file simple.h.
firevision::SimpleColorClassifier::SimpleColorClassifier | ( | ScanlineModel * | scanline_model, | |
ColorModel * | color_model, | |||
unsigned int | min_num_points = 6 , |
|||
unsigned int | box_extent = 50 , |
|||
bool | upward = false , |
|||
unsigned int | neighbourhood_min_match = 8 , |
|||
unsigned int | grow_by = 10 | |||
) |
Constructor.
scanline_model | scanline model | |
color_model | color model | |
min_num_points | minimum number of points in ROI to be considered | |
box_extent | basic extent of a new ROI | |
upward | set to true if you have an upward scanline model, this means that points are traversed from the bottom to the top. In this case the ROIs are initially extended towards the top instead of the bottom. | |
neighbourhood_min_match | minimum number of object pixels to grow neighbourhood | |
grow_by | grow region by that many pixels |
Definition at line 57 of file simple.cpp.
References set_hint().
void firevision::SimpleColorClassifier::add_hint | ( | hint_t | hint | ) | [virtual] |
Adds another object of interest (hint_t).
hint | Object of interest |
Definition at line 98 of file simple.cpp.
References firevision::ColorObjectMap::get_instance().
std::list< ROI > * firevision::SimpleColorClassifier::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.
Implements firevision::Classifier.
Definition at line 151 of file simple.cpp.
References firevision::Classifier::_height, firevision::Classifier::_src, firevision::Classifier::_width, firevision::ColorModel::determine(), firevision::ScanlineModel::finished(), firevision::ColorObjectMap::get(), firevision::ColorObjectMap::get_instance(), firevision::ScanlineModel::get_margin(), firevision::ROI::height, firevision::ROI::hint, firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::line_step, firevision::ROI::pixel_step, firevision::ScanlineModel::reset(), firevision::ROI::start, firevision::ROI::width, fawkes::point_t::x, and fawkes::point_t::y.
void firevision::SimpleColorClassifier::get_mass_point_of_ball | ( | ROI * | roi, | |
fawkes::point_t * | massPoint | |||
) | [virtual] |
Get mass point of ball.
roi | ROI to consider | |
massPoint | contains mass point upon return |
Definition at line 334 of file simple.cpp.
References firevision::Classifier::_src, firevision::ColorModel::determine(), firevision::ColorObjectMap::get_instance(), firevision::ROI::height, firevision::ROI::hint, firevision::ROI::image_height, firevision::ROI::image_width, firevision::ROI::line_step, firevision::ROI::pixel_step, firevision::ROI::start, firevision::ROI::width, fawkes::point_t::x, and fawkes::point_t::y.
void firevision::SimpleColorClassifier::set_hint | ( | hint_t | hint | ) | [virtual] |
Sets the object of interest (hint_t).
Sets the object of interest (hint_t) This function clears the current list of objects of interests.
hint | Object of interest |
Definition at line 88 of file simple.cpp.
References firevision::ColorObjectMap::get_instance().
Referenced by SimpleColorClassifier().