Fawkes API  Fawkes Development Version
firevision::GradientClassifier Class Reference

Gradient classifier. More...

#include <>>

Inheritance diagram for firevision::GradientClassifier:

Public Member Functions

 GradientClassifier (std::list< ScanlineGrid * > *scanlines, Qualifier *q, unsigned int threshold, unsigned int max_size=0, bool use_rising_flank=true, bool use_falling_flank=true)
 Constructor. More...
 
virtual ~GradientClassifier ()
 Destructor. More...
 
virtual std::list< ROI > * classify ()
 Classify image. More...
 
virtual void set_src_buffer (unsigned char *yuv422_planar, unsigned int width, unsigned int height)
 Set source buffer. More...
 
virtual void set_threshold (unsigned int threshold, unsigned int max_size=0)
 Threshold setter. More...
 
virtual void set_edges (bool use_rising_edge, bool use_falling_edge)
 Edge setter. More...
 
- Public Member Functions inherited from firevision::Classifier
 Classifier (const char *name)
 Constructor. More...
 
virtual ~Classifier ()
 Destructor. 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

Gradient classifier.

Uses the difference of the current and the last value.

Definition at line 36 of file gradient.h.

Constructor & Destructor Documentation

◆ GradientClassifier()

firevision::GradientClassifier::GradientClassifier ( std::list< ScanlineGrid * > *  scanlines,
Qualifier q,
unsigned int  threshold,
unsigned int  max_size = 0,
bool  use_rising_flank = true,
bool  use_falling_flank = true 
)

Constructor.

Parameters
scanlineslist of scanline models (Does only work with ScanlineGrid)
qQualifier for a single pixel (The qualifier gets deleted by this class)
thresholdminimum rise required for classification
max_sizeof an object to be detected (if 0 value will be ignored)
use_rising_flankif true the classification can start on a rising flank
use_falling_flankif true the classification can start on a falling flank

Definition at line 51 of file gradient.cpp.

References set_edges(), and set_threshold().

◆ ~GradientClassifier()

firevision::GradientClassifier::~GradientClassifier ( )
virtual

Destructor.

Definition at line 72 of file gradient.cpp.

Member Function Documentation

◆ classify()

std::list< ROI > * firevision::GradientClassifier::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

Implements firevision::Classifier.

Definition at line 121 of file gradient.cpp.

References firevision::Qualifier::get(), firevision::Qualifier::get_buffer(), firevision::ROI::pixel_step, firevision::ROI::set_height(), firevision::ROI::set_pixel_step(), firevision::ROI::set_start(), firevision::ROI::set_width(), firevision::ROI::start, fawkes::upoint_t::x, and fawkes::upoint_t::y.

◆ set_edges()

void firevision::GradientClassifier::set_edges ( bool  use_rising_edge,
bool  use_falling_edge 
)
virtual

Edge setter.

Parameters
use_rising_edgeif true the classification can start on a rising edge
use_falling_edgeif true the classification can start on a falling edge

Definition at line 98 of file gradient.cpp.

Referenced by GradientClassifier().

◆ set_src_buffer()

void firevision::GradientClassifier::set_src_buffer ( unsigned char *  yuv422_planar,
unsigned int  width,
unsigned int  height 
)
virtual

Set source buffer.

Parameters
yuv422_planara YUV422 planar buffer with the source image to classify. The classifier may NOT modify the image in any way. If that is required the classifier shall make a copy of the image.
widthwidth of buffer in pixels
heightheight of buffer in pixels

Reimplemented from firevision::Classifier.

Definition at line 112 of file gradient.cpp.

References firevision::Qualifier::set_buffer(), and firevision::Classifier::set_src_buffer().

◆ set_threshold()

void firevision::GradientClassifier::set_threshold ( unsigned int  threshold,
unsigned int  max_size = 0 
)
virtual

Threshold setter.

Parameters
thresholdminimum rise required for classification
max_sizeof an object to be detected (if 0 value will not be set)

Definition at line 83 of file gradient.cpp.

Referenced by GradientClassifier().


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