Basic Image AlgorithmS Library
2.8.0
|
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_ |
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
Definition at line 51 of file ColorMultiHistogram.hh.
BIAS::ColorMultiHistogram< StorageType >::ColorMultiHistogram | ( | ) |
This class creates a ColorMultiHistogram in the HSL color space.
Definition at line 40 of file ColorMultiHistogram.cpp.
BIAS::ColorMultiHistogram< StorageType >::~ColorMultiHistogram | ( | ) |
Definition at line 56 of file ColorMultiHistogram.cpp.
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.
the | hist to compare with |
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().
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.
the | hist to compare with |
Definition at line 178 of file ColorMultiHistogram.cpp.
References BIAS::ColorMultiHistogram< StorageType >::GetHist1(), and BIAS::ColorMultiHistogram< StorageType >::GetHist2().
int BIAS::ColorMultiHistogram< StorageType >::Clear | ( | ) |
Deletes ALL current Histogram information.
Definition at line 128 of file ColorMultiHistogram.cpp.
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)
os | = the outstream, default std::cout |
Definition at line 207 of file ColorMultiHistogram.cpp.
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
image | = the image |
Definition at line 140 of file ColorMultiHistogram.cpp.
int BIAS::ColorMultiHistogram< unsigned char >::GenerateHist | ( | BIAS::Image< unsigned char > & | img | ) |
Definition at line 151 of file ColorMultiHistogram.cpp.
|
inline |
GetBinSize.
Definition at line 97 of file ColorMultiHistogram.hh.
void BIAS::ColorMultiHistogram< StorageType >::GetDistROIs | ( | std::vector< double > & | dist | ) | const |
Definition at line 113 of file ColorMultiHistogram.cpp.
ColorHistogram< StorageType > BIAS::ColorMultiHistogram< StorageType >::GetHist1 | ( | ) | const |
Get Hist1.
Definition at line 92 of file ColorMultiHistogram.cpp.
Referenced by BIAS::ColorMultiHistogram< StorageType >::CalcSimilarity(), BIAS::ColorMultiHistogram< StorageType >::CalcSimilarityColorWeighted(), and BIAS::ColorMultiHistogram< StorageType >::Update().
ColorHistogram< StorageType > BIAS::ColorMultiHistogram< StorageType >::GetHist2 | ( | ) | const |
Get Hist2.
Definition at line 102 of file ColorMultiHistogram.cpp.
Referenced by BIAS::ColorMultiHistogram< StorageType >::CalcSimilarity(), BIAS::ColorMultiHistogram< StorageType >::CalcSimilarityColorWeighted(), and BIAS::ColorMultiHistogram< StorageType >::Update().
int BIAS::ColorMultiHistogram< StorageType >::Read | ( | char * | filename1, |
char * | filename2 | ||
) |
reads a histogram from instream and fills the internal data structures
the | filenames of the two histograms |
Definition at line 215 of file ColorMultiHistogram.cpp.
int BIAS::ColorMultiHistogram< StorageType >::SetBinSize | ( | int | binsize | ) |
set the binsize (must be divideable by 2pown)
Definition at line 82 of file ColorMultiHistogram.cpp.
|
inline |
sets Lambda, which is used to calculate the dist in CalcSimilarity
Definition at line 91 of file ColorMultiHistogram.hh.
|
inline |
set minsat_, which defines the minimum saturation
Definition at line 84 of file ColorMultiHistogram.hh.
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.
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.
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.
Definition at line 191 of file ColorMultiHistogram.cpp.
References BIAS::ColorMultiHistogram< StorageType >::GetHist1(), and BIAS::ColorMultiHistogram< StorageType >::GetHist2().
|
protected |
Definition at line 177 of file ColorMultiHistogram.hh.
|
protected |
Definition at line 175 of file ColorMultiHistogram.hh.
|
protected |
Definition at line 175 of file ColorMultiHistogram.hh.
|
protected |
Definition at line 177 of file ColorMultiHistogram.hh.
|
protected |
Definition at line 177 of file ColorMultiHistogram.hh.