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::IntegralHistogram Class Reference

This Class handels Integral Histograms on HSL Images It represents an integral image histogram and offers basic methods on histograms. More...

#include <Image/IntegralHistogram.hh>

+ Collaboration diagram for BIAS::IntegralHistogram:

Public Member Functions

double CalcSimilarity (ColorHistogram< unsigned char > &chist, int ux, int uy, int lx, int ly)
 Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 colorhistograms. More...
 
double CalcSimilarity (ColorHistogram< unsigned char > &chist1, int ux1, int uy1, int lx1, int ly1, ColorHistogram< unsigned char > &chist2, int ux2, int uy2, int lx2, int ly2, double weightSecond=0.5)
 Calculates the Bhattacharyya similarity Coeiffient^2 which is the distance or difference of 2 colorhistograms. More...
 
void Clear ()
 Deletes ALL current Histogram information. More...
 
void Dump (std::ostream &os, int y, int x)
 dumps information on histogram More...
 
int GenerateIntegralHist (BIAS::Image< unsigned char > &image, int nBinsize)
 calcluates the histogram from the picture and fills the data structs More...
 
int GenerateIntegralHistDiffBin (BIAS::Image< unsigned char > &image, int nBinsizeHue, int nBinsizeSat)
 calcluates the histogram from the picture and fills the data structs More...
 
int GetBinSize () const
 GetBinSize. More...
 
int GetBinSizeSat () const
 GetBinSizeSat. More...
 
Vector< int > GetHistogram (int ux, int uy, int lx, int ly)
 Get Histogram. More...
 
 IntegralHistogram ()
 This class creates an IntegralHistogram in the HSL color space. More...
 
void SetBinSize (int binsize)
 set the binsize (must be divideable by 2pown) More...
 
void SetExpDist (bool expdist)
 sets expDist_ true or false, used to calculate the dist in CalcSimilarity 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...
 
 ~IntegralHistogram ()
 

Protected Member Functions

void CopyNoCheck (const BIAS::Vector< int > &src, BIAS::Vector< int > &dst)
 

Protected Attributes

bool bExpDist_
 
std::vector< std::vector
< double > > 
m_cHSData
 
std::vector< double > m_cLData
 
TNT::Matrix< BIAS::Vector< int > > mHists_
 
int nBinsize_
 
int nBinsizeSat_
 
int nLambda_
 
int nMinSat_
 
int nOldBinsize_
 
int nOldBinsizeSat_
 
int nShift_
 
int nShiftSat_
 

Detailed Description

This Class handels Integral Histograms on HSL Images It represents an integral image histogram and offers basic methods on histograms.

Author
Ingo Schiller untested
Date
25.Oktober 2004

Definition at line 53 of file IntegralHistogram.hh.

Constructor & Destructor Documentation

IntegralHistogram::IntegralHistogram ( )

This class creates an IntegralHistogram in the HSL color space.

Author
ingo schiller
Date
feb 2004

Definition at line 43 of file IntegralHistogram.cpp.

IntegralHistogram::~IntegralHistogram ( )

Definition at line 54 of file IntegralHistogram.cpp.

Member Function Documentation

double IntegralHistogram::CalcSimilarity ( ColorHistogram< unsigned char > &  chist,
int  ux,
int  uy,
int  lx,
int  ly 
)

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

Parameters
chist= the colorHistogram we compare with
roi= the roi to compare with: upperx, uppery, lowerx, lowery
Returns
double value, which indicates the similarity. 1 if similar.
Author
Schiller oktober 2004

Definition at line 372 of file IntegralHistogram.cpp.

References BIAS::ColorHistogram< StorageType >::GetHist(), BIAS::ColorHistogram< StorageType >::GetHistL(), and TNT::Vector< T >::size().

double IntegralHistogram::CalcSimilarity ( ColorHistogram< unsigned char > &  chist1,
int  ux1,
int  uy1,
int  lx1,
int  ly1,
ColorHistogram< unsigned char > &  chist2,
int  ux2,
int  uy2,
int  lx2,
int  ly2,
double  weightSecond = 0.5 
)

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

The similarity is calculated for two image regions/histograms the resulting probability is the weighted sum of both.

Returns
double value, which indicates the similarity. 1 if equal.
Author
grest Oct 2005

Definition at line 443 of file IntegralHistogram.cpp.

void IntegralHistogram::Clear ( )

Deletes ALL current Histogram information.

Definition at line 74 of file IntegralHistogram.cpp.

void BIAS::IntegralHistogram::CopyNoCheck ( const BIAS::Vector< int > &  src,
BIAS::Vector< int > &  dst 
)
inlineprotected

Definition at line 177 of file IntegralHistogram.hh.

References BIAS::Vector< T >::GetData(), and TNT::Vector< T >::size().

void IntegralHistogram::Dump ( std::ostream &  os,
int  y,
int  x 
)

dumps information on histogram

dumps information on histogram to ostream format: 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 461 of file IntegralHistogram.cpp.

int IntegralHistogram::GenerateIntegralHist ( BIAS::Image< unsigned char > &  image,
int  nBinsize 
)

calcluates the histogram from the picture and fills the data structs

Author
Schiller
Parameters
image= the image

Definition at line 107 of file IntegralHistogram.cpp.

References BIAS::ImageBase::CM_HSL, BIAS::Vector< T >::Fill(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), and BIAS::ImageBase::GetWidth().

int IntegralHistogram::GenerateIntegralHistDiffBin ( BIAS::Image< unsigned char > &  image,
int  nBinsizeHue,
int  nBinsizeSat 
)

calcluates the histogram from the picture and fills the data structs

Author
Schiller
Parameters
image= the image
nBinsizeHue= binsize in hue direction
nBinsizeSat= binsize in sat direction

Definition at line 232 of file IntegralHistogram.cpp.

References BIAS::ImageBase::CM_HSL, BIAS::Vector< T >::Fill(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::ImageBase::GetWidth(), BIAS::TimeMeasure::Reset(), BIAS::TimeMeasure::Start(), and BIAS::TimeMeasure::Stop().

int BIAS::IntegralHistogram::GetBinSize ( ) const
inline

GetBinSize.

Definition at line 92 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::GetBinSizeSat ( ) const
inline

GetBinSizeSat.

Definition at line 97 of file IntegralHistogram.hh.

Vector< int > IntegralHistogram::GetHistogram ( int  ux,
int  uy,
int  lx,
int  ly 
)

Get Histogram.

Parameters
roi= the Region in which the histogram should be created
Returns
= Vector which holds the Histogram, structure: binsizeSat * binsizeHue elements(hue and sat )
  • binsizeSat elements(luminance)
  • totalNumber of entries (last element)

Definition at line 85 of file IntegralHistogram.cpp.

void IntegralHistogram::SetBinSize ( int  binsize)

set the binsize (must be divideable by 2pown)

Definition at line 67 of file IntegralHistogram.cpp.

void IntegralHistogram::SetExpDist ( bool  expdist)

sets expDist_ true or false, used to calculate the dist in CalcSimilarity

Definition at line 70 of file IntegralHistogram.cpp.

void IntegralHistogram::SetLambda ( int  lambda)

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

Definition at line 59 of file IntegralHistogram.cpp.

void IntegralHistogram::SetMinSat ( int  minsat)

set minsat_, which defines the minimum saturation

Definition at line 63 of file IntegralHistogram.cpp.

Member Data Documentation

bool BIAS::IntegralHistogram::bExpDist_
protected

Definition at line 169 of file IntegralHistogram.hh.

std::vector<std::vector<double> > BIAS::IntegralHistogram::m_cHSData
protected

Definition at line 164 of file IntegralHistogram.hh.

std::vector<double> BIAS::IntegralHistogram::m_cLData
protected

Definition at line 165 of file IntegralHistogram.hh.

TNT::Matrix<BIAS::Vector<int> > BIAS::IntegralHistogram::mHists_
protected

Definition at line 163 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nBinsize_
protected

Definition at line 170 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nBinsizeSat_
protected

Definition at line 171 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nLambda_
protected

Definition at line 168 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nMinSat_
protected

Definition at line 167 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nOldBinsize_
protected

Definition at line 172 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nOldBinsizeSat_
protected

Definition at line 173 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nShift_
protected

Definition at line 175 of file IntegralHistogram.hh.

int BIAS::IntegralHistogram::nShiftSat_
protected

Definition at line 176 of file IntegralHistogram.hh.


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