33 #include <Base/Image/ImageIO.hh>
34 #include <Base/Image/ImageConvert.hh>
35 #include <Base/Common/FileHandling.hh>
36 #include <Image/HistogramEqualization.hh>
37 #include <Image/HistogramImage.hh>
50 hsrc.
AddHist<
unsigned char>(im);
52 ofstream outfile(
"cumulathist.dat");
54 for(
unsigned b=0;b<256; b++)
63 int main(
int argc,
char *argv[])
68 cout<<
"usage: "<<argv[0]<<
" <image file>"<<endl;
74 cout<<
"can't load "<<argv[1]<<endl;
78 string dir,base,suffix;
82 HistEq.
Filter(GreyImg,OutPutImg);
84 WriteCumulativeHistogram(OutPutImg);
int InitHist(unsigned int bincount=256, unsigned int histcount=1)
reserves the internal data structures for histcount histograms with bincount bins in each in one imag...
double GetBin(unsigned int bin, unsigned int hist=0)
Get the counted number of bin from hist, -1 for invalid bin/hist.
int AddHist(const Image< StorageType > &Image, unsigned int hist=0)
calculates the histogram of image and adds them to the internal data structures
static void SplitName(const std::string &fullname, std::string &dir, std::string &base, std::string &suffix)
Split full path into:
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
Class for easy histogram image generation.
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
prototyp for filter computation function
perfoms a histogram equalization on a grey value image
static int ToGrey(const ImageBase &source, ImageBase &dest)
wrapper for the templated function ToGrey