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

This Class handels MultiHistogram matters on Images. More...

#include <Image/ColorMultiHistogram.hh>

Public Member Functions

double CalcSimilarity (const ColorMultiHistogram< StorageType > &chist) const
 Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 ColorMultiHistograms. More...
 
double CalcSimilarityColorWeighted (const BIAS::ColorMultiHistogram< StorageType > &chist) const
 Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 ColorMultiHistograms. More...
 
int Clear ()
 Deletes ALL current Histogram information. More...
 
 ColorMultiHistogram ()
 This class creates a ColorMultiHistogram in the HSL color space. More...
 
void Dump (std::ostream &os=std::cout, std::ostream &os2=std::cout)
 dumps information on the MultiHistogram calls the Dump of ColorHistogram More...
 
int GenerateHist (BIAS::Image< StorageType > &image)
 calculates the Histogram of the image ATTENTION: ROI must be set in upper function SetROI if this function is used More...
 
template<>
int GenerateHist (BIAS::Image< unsigned char > &img)
 
int GetBinSize () const
 GetBinSize. More...
 
void GetDistROIs (std::vector< double > &dist) const
 
ColorHistogram< StorageType > GetHist1 () const
 Get Hist1. More...
 
ColorHistogram< StorageType > GetHist2 () const
 Get Hist2. More...
 
int Read (char *filename1, char *filename2)
 reads a histogram from instream and fills the internal data structures More...
 
int SetBinSize (int binsize)
 set the binsize (must be divideable by 2pown) More...
 
void SetLambda (int lambda)
 sets Lambda, which is used to calculate the dist in CalcSimilarity More...
 
void SetMinSat (int minsat)
 set minsat_, which defines the minimum saturation More...
 
int SetROI1 (int ux, int uy, int lx, int ly)
 set the coords for the ROI in first Histogram More...
 
int SetROI2 (int ux, int uy, int lx, int ly)
 set the coords for the ROI in second Histogram More...
 
int Update (const BIAS::ColorMultiHistogram< StorageType > &hist, double factor=0.5)
 Updates the histogramm with values from hist, where the factor gives the weighting of the new values from hist. More...
 
 ~ColorMultiHistogram ()
 

Protected Attributes

int binSize_
 
BIAS::ColorHistogram< StorageType > hist1_
 
BIAS::ColorHistogram< StorageType > hist2_
 
int lambda_
 
int minSat_
 

Detailed Description

template<class StorageType>
class BIAS::ColorMultiHistogram< StorageType >

This Class handels MultiHistogram matters on Images.

it is derived from Colorhistogram, to make it usable just like a normal ColorHistogram It represents a Multihistogram and offers the same Methods as ColorHistogram

Author
Ingo Schiller March 2004 MultiHistogram is represented by two ColorHistograms untested

Definition at line 51 of file ColorMultiHistogram.hh.

Constructor & Destructor Documentation

template<class StorageType >
BIAS::ColorMultiHistogram< StorageType >::ColorMultiHistogram ( )

This class creates a ColorMultiHistogram in the HSL color space.

Author
ingo schiller
Date
march 2004

Definition at line 40 of file ColorMultiHistogram.cpp.

template<class StorageType >
BIAS::ColorMultiHistogram< StorageType >::~ColorMultiHistogram ( )

Definition at line 56 of file ColorMultiHistogram.cpp.

Member Function Documentation

template<class StorageType >
double BIAS::ColorMultiHistogram< StorageType >::CalcSimilarity ( const ColorMultiHistogram< StorageType > &  chist) const

Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 ColorMultiHistograms.

simply call the CalcSimilarity from ColorHistograms here and multiply the values.

Parameters
thehist to compare with
Returns
double value, which indicates the similarity. 1 if similar.
Author
schiller March 2004

This is the distance of the MultiHistogram

Definition at line 164 of file ColorMultiHistogram.cpp.

References BIAS::ColorMultiHistogram< StorageType >::GetHist1(), and BIAS::ColorMultiHistogram< StorageType >::GetHist2().

template<class StorageType >
double BIAS::ColorMultiHistogram< StorageType >::CalcSimilarityColorWeighted ( const BIAS::ColorMultiHistogram< StorageType > &  chist) const

Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 ColorMultiHistograms.

Same As CalcSimilarity, but the two histogram values are weighted according to the amount of color bins which are not zero.

Parameters
thehist to compare with
Returns
double value, which indicates the similarity. 1 if similar.
Author
grest May 2004

Definition at line 178 of file ColorMultiHistogram.cpp.

References BIAS::ColorMultiHistogram< StorageType >::GetHist1(), and BIAS::ColorMultiHistogram< StorageType >::GetHist2().

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::Clear ( )

Deletes ALL current Histogram information.

Definition at line 128 of file ColorMultiHistogram.cpp.

template<class StorageType >
void BIAS::ColorMultiHistogram< StorageType >::Dump ( std::ostream &  os = std::cout,
std::ostream &  os2 = std::cout 
)

dumps information on the MultiHistogram calls the Dump of ColorHistogram

dumps information on MultiHistogram to ostreams format: first hist1, then hist2 binsize tab ux tab uy tab lx tab ly hs histogram, as a matrix with binsize x binsize (tab separated) l values as a line with lenght binsize (tab separated)

Parameters
os= the outstream, default std::cout
Author
Schiller

Definition at line 207 of file ColorMultiHistogram.cpp.

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::GenerateHist ( BIAS::Image< StorageType > &  image)

calculates the Histogram of the image ATTENTION: ROI must be set in upper function SetROI if this function is used

simply call the GenerateHist() from ColorHistogram twice here

Parameters
image= the image
Returns
-1 if image does not exist

Definition at line 140 of file ColorMultiHistogram.cpp.

template<>
int BIAS::ColorMultiHistogram< unsigned char >::GenerateHist ( BIAS::Image< unsigned char > &  img)

Definition at line 151 of file ColorMultiHistogram.cpp.

template<class StorageType>
int BIAS::ColorMultiHistogram< StorageType >::GetBinSize ( ) const
inline

GetBinSize.

Definition at line 97 of file ColorMultiHistogram.hh.

template<class StorageType >
void BIAS::ColorMultiHistogram< StorageType >::GetDistROIs ( std::vector< double > &  dist) const
Returns
the distance of the two centers of the ROIs in pixels first x coords than y coord
the distance of the centers of the ROIs in pixels

Definition at line 113 of file ColorMultiHistogram.cpp.

template<class StorageType >
ColorHistogram< StorageType > BIAS::ColorMultiHistogram< StorageType >::GetHist1 ( ) const
template<class StorageType >
ColorHistogram< StorageType > BIAS::ColorMultiHistogram< StorageType >::GetHist2 ( ) const
template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::Read ( char *  filename1,
char *  filename2 
)

reads a histogram from instream and fills the internal data structures

Parameters
thefilenames of the two histograms
Author
Schiller March 2004
Returns
0 if ok, -1 if no file

Definition at line 215 of file ColorMultiHistogram.cpp.

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::SetBinSize ( int  binsize)

set the binsize (must be divideable by 2pown)

Definition at line 82 of file ColorMultiHistogram.cpp.

template<class StorageType>
void BIAS::ColorMultiHistogram< StorageType >::SetLambda ( int  lambda)
inline

sets Lambda, which is used to calculate the dist in CalcSimilarity

Definition at line 91 of file ColorMultiHistogram.hh.

template<class StorageType>
void BIAS::ColorMultiHistogram< StorageType >::SetMinSat ( int  minsat)
inline

set minsat_, which defines the minimum saturation

Definition at line 84 of file ColorMultiHistogram.hh.

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::SetROI1 ( int  ux,
int  uy,
int  lx,
int  ly 
)

set the coords for the ROI in first Histogram

Definition at line 64 of file ColorMultiHistogram.cpp.

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::SetROI2 ( int  ux,
int  uy,
int  lx,
int  ly 
)

set the coords for the ROI in second Histogram

Definition at line 73 of file ColorMultiHistogram.cpp.

template<class StorageType >
int BIAS::ColorMultiHistogram< StorageType >::Update ( const BIAS::ColorMultiHistogram< StorageType > &  hist,
double  factor = 0.5 
)

Updates the histogramm with values from hist, where the factor gives the weighting of the new values from hist.

Returns
0 in case of no error
Author
Daniel Grest, March 2004

Definition at line 191 of file ColorMultiHistogram.cpp.

References BIAS::ColorMultiHistogram< StorageType >::GetHist1(), and BIAS::ColorMultiHistogram< StorageType >::GetHist2().

Member Data Documentation

template<class StorageType>
int BIAS::ColorMultiHistogram< StorageType >::binSize_
protected

Definition at line 177 of file ColorMultiHistogram.hh.

template<class StorageType>
BIAS::ColorHistogram<StorageType> BIAS::ColorMultiHistogram< StorageType >::hist1_
protected

Definition at line 175 of file ColorMultiHistogram.hh.

template<class StorageType>
BIAS::ColorHistogram<StorageType> BIAS::ColorMultiHistogram< StorageType >::hist2_
protected

Definition at line 175 of file ColorMultiHistogram.hh.

template<class StorageType>
int BIAS::ColorMultiHistogram< StorageType >::lambda_
protected

Definition at line 177 of file ColorMultiHistogram.hh.

template<class StorageType>
int BIAS::ColorMultiHistogram< StorageType >::minSat_
protected

Definition at line 177 of file ColorMultiHistogram.hh.


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