Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
BIAS::LEDDetector Class Reference

This class contains methods to detect (IR)-LED-Spots, with template matching (new search) or in "recycling" mode (search at old positions). More...

#include <FeatureDetector/LEDDetector.hh>

+ Collaboration diagram for BIAS::LEDDetector:

Public Member Functions

int Compute (const BIAS::Image< unsigned char > &image, std::vector< BIAS::Vector3< double > > &results)
 Detect LED spots in image. More...
 
void GetAttributes (std::vector< double > &minX, std::vector< double > &maxX, std::vector< double > &maxValues)
 Return attributes of detected LED spots. More...
 
void GetNeighbours (std::vector< std::vector< BIAS::Vector3< double > > > &neighbours)
 Return neighbours of detected LED spots. More...
 
 LEDDetector ()
 
 ~LEDDetector ()
 

Protected Member Functions

int CheckNeighbours_ (int a, int b)
 
int CheckNeighboursIfWhite_ (int x, int y, int &a, int &b)
 
int CheckNeighboursIfWhite_inter_ (int x, int y)
 
int Recycle_ ()
 
void Search_ (int x, int y)
 
void TemplateMatching_ ()
 

Protected Attributes

double blobs
 
double blobsize
 
double count
 
unsigned char * data
 
IplImage * gray_orig
 
IplImage * gray_threshold
 
int height
 
unsigned char * lookup
 
int lookupsize
 
double maxvalue
 
std::vector< double > maxvalues
 
double maxx
 
std::vector< double > maxxcoords
 
double mean
 
double minx
 
std::vector< double > minxcoords
 
std::vector< std::vector
< BIAS::Vector3< double > > > 
nextpixel
 
double pixelweightvaluex
 
double pixelweightvaluey
 
double recursivedepth
 
std::vector< BIAS::Vector3
< double > > 
resultpixel
 
std::vector< BIAS::Vector3
< double > > 
resultpixel_old
 
int step
 
double valuesum
 
std::vector< BIAS::Vector3
< double > > 
whitepixel
 
int width
 

Detailed Description

This class contains methods to detect (IR)-LED-Spots, with template matching (new search) or in "recycling" mode (search at old positions).

Author
haase 3/2007, reworked by esquivel 11/2013
Examples:
ExampleLEDDetector.cpp.

Definition at line 50 of file LEDDetector.hh.

Constructor & Destructor Documentation

LEDDetector::LEDDetector ( )

Definition at line 13 of file LEDDetector.cpp.

LEDDetector::~LEDDetector ( )

Definition at line 20 of file LEDDetector.cpp.

Member Function Documentation

int LEDDetector::CheckNeighbours_ ( int  a,
int  b 
)
protected

Definition at line 234 of file LEDDetector.cpp.

int LEDDetector::CheckNeighboursIfWhite_ ( int  x,
int  y,
int &  a,
int &  b 
)
protected

Definition at line 125 of file LEDDetector.cpp.

int LEDDetector::CheckNeighboursIfWhite_inter_ ( int  x,
int  y 
)
protected

Definition at line 174 of file LEDDetector.cpp.

int LEDDetector::Compute ( const BIAS::Image< unsigned char > &  image,
std::vector< BIAS::Vector3< double > > &  results 
)

Detect LED spots in image.

Parameters
[in]imageRGB or gray image to detect LED spots in.
in/out]results Returns LED spot positions in current image. Parameters of 3d vectors are (x, y, val) where val is brightness. Can be also used as input parameter to specify LED spots positions in last image to use "recycling" mode.
Returns
Returns <0 in case of errors, >= 0 otherwise.
Examples:
ExampleLEDDetector.cpp.

Definition at line 40 of file LEDDetector.cpp.

References BIAS::ImageConvert::BIAS2ipl(), BIAS::Image< StorageType >::Release(), and BIAS::ImageConvert::ToGrey().

void LEDDetector::GetAttributes ( std::vector< double > &  minX,
std::vector< double > &  maxX,
std::vector< double > &  maxValues 
)

Return attributes of detected LED spots.

Parameters
[out]minXReturns min. x coordinate for each detected LED spot
[out]maxXReturns max. x coordinate for each detected LED spot
[out]maxValuesReturns max. gray value for each detected LED spot
Examples:
ExampleLEDDetector.cpp.

Definition at line 32 of file LEDDetector.cpp.

void LEDDetector::GetNeighbours ( std::vector< std::vector< BIAS::Vector3< double > > > &  neighbours)

Return neighbours of detected LED spots.

Parameters
[out]neighboursReturns vector of neighbour positions for each detected LED spot

Definition at line 26 of file LEDDetector.cpp.

int LEDDetector::Recycle_ ( )
protected

Definition at line 91 of file LEDDetector.cpp.

void LEDDetector::Search_ ( int  x,
int  y 
)
protected

Definition at line 182 of file LEDDetector.cpp.

References BIAS::Vector3< T >::clear().

void LEDDetector::TemplateMatching_ ( )
protected

Definition at line 274 of file LEDDetector.cpp.

Member Data Documentation

double BIAS::LEDDetector::blobs
protected

Definition at line 126 of file LEDDetector.hh.

double BIAS::LEDDetector::blobsize
protected

Definition at line 123 of file LEDDetector.hh.

double BIAS::LEDDetector::count
protected

Definition at line 119 of file LEDDetector.hh.

unsigned char* BIAS::LEDDetector::data
protected

Definition at line 102 of file LEDDetector.hh.

IplImage * BIAS::LEDDetector::gray_orig
protected

Definition at line 101 of file LEDDetector.hh.

IplImage* BIAS::LEDDetector::gray_threshold
protected

Definition at line 101 of file LEDDetector.hh.

int BIAS::LEDDetector::height
protected

Definition at line 116 of file LEDDetector.hh.

unsigned char* BIAS::LEDDetector::lookup
protected

Definition at line 112 of file LEDDetector.hh.

int BIAS::LEDDetector::lookupsize
protected

Definition at line 113 of file LEDDetector.hh.

double BIAS::LEDDetector::maxvalue
protected

Definition at line 118 of file LEDDetector.hh.

std::vector<double> BIAS::LEDDetector::maxvalues
protected

Definition at line 108 of file LEDDetector.hh.

double BIAS::LEDDetector::maxx
protected

Definition at line 125 of file LEDDetector.hh.

std::vector<double> BIAS::LEDDetector::maxxcoords
protected

Definition at line 108 of file LEDDetector.hh.

double BIAS::LEDDetector::mean
protected

Definition at line 117 of file LEDDetector.hh.

double BIAS::LEDDetector::minx
protected

Definition at line 125 of file LEDDetector.hh.

std::vector<double> BIAS::LEDDetector::minxcoords
protected

Definition at line 108 of file LEDDetector.hh.

std::vector<std::vector<BIAS::Vector3<double> > > BIAS::LEDDetector::nextpixel
protected

Definition at line 109 of file LEDDetector.hh.

double BIAS::LEDDetector::pixelweightvaluex
protected

Definition at line 120 of file LEDDetector.hh.

double BIAS::LEDDetector::pixelweightvaluey
protected

Definition at line 121 of file LEDDetector.hh.

double BIAS::LEDDetector::recursivedepth
protected

Definition at line 122 of file LEDDetector.hh.

std::vector<BIAS::Vector3<double> > BIAS::LEDDetector::resultpixel
protected

Definition at line 104 of file LEDDetector.hh.

std::vector<BIAS::Vector3<double> > BIAS::LEDDetector::resultpixel_old
protected

Definition at line 105 of file LEDDetector.hh.

int BIAS::LEDDetector::step
protected

Definition at line 115 of file LEDDetector.hh.

double BIAS::LEDDetector::valuesum
protected

Definition at line 124 of file LEDDetector.hh.

std::vector<BIAS::Vector3<double> > BIAS::LEDDetector::whitepixel
protected

Definition at line 106 of file LEDDetector.hh.

int BIAS::LEDDetector::width
protected

Definition at line 116 of file LEDDetector.hh.


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