Basic Image AlgorithmS Library
2.8.0
|
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>
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_ |
This Class handels Integral Histograms on HSL Images It represents an integral image histogram and offers basic methods on histograms.
Definition at line 53 of file IntegralHistogram.hh.
IntegralHistogram::IntegralHistogram | ( | ) |
This class creates an IntegralHistogram in the HSL color space.
Definition at line 43 of file IntegralHistogram.cpp.
IntegralHistogram::~IntegralHistogram | ( | ) |
Definition at line 54 of file IntegralHistogram.cpp.
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.
chist | = the colorHistogram we compare with |
roi | = the roi to compare with: upperx, uppery, lowerx, lowery |
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.
Definition at line 443 of file IntegralHistogram.cpp.
void IntegralHistogram::Clear | ( | ) |
Deletes ALL current Histogram information.
Definition at line 74 of file IntegralHistogram.cpp.
|
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)
os | = the outstream, default std::cout |
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
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
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().
|
inline |
GetBinSize.
Definition at line 92 of file IntegralHistogram.hh.
|
inline |
GetBinSizeSat.
Definition at line 97 of file IntegralHistogram.hh.
Vector< int > IntegralHistogram::GetHistogram | ( | int | ux, |
int | uy, | ||
int | lx, | ||
int | ly | ||
) |
Get Histogram.
roi | = the Region in which the histogram should be created |
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.
|
protected |
Definition at line 169 of file IntegralHistogram.hh.
|
protected |
Definition at line 164 of file IntegralHistogram.hh.
|
protected |
Definition at line 165 of file IntegralHistogram.hh.
|
protected |
Definition at line 163 of file IntegralHistogram.hh.
|
protected |
Definition at line 170 of file IntegralHistogram.hh.
|
protected |
Definition at line 171 of file IntegralHistogram.hh.
|
protected |
Definition at line 168 of file IntegralHistogram.hh.
|
protected |
Definition at line 167 of file IntegralHistogram.hh.
|
protected |
Definition at line 172 of file IntegralHistogram.hh.
|
protected |
Definition at line 173 of file IntegralHistogram.hh.
|
protected |
Definition at line 175 of file IntegralHistogram.hh.
|
protected |
Definition at line 176 of file IntegralHistogram.hh.