51 #include <visp3/core/vpColor.h>
52 #include <visp3/core/vpHistogramPeak.h>
53 #include <visp3/core/vpHistogramValey.h>
54 #include <visp3/core/vpImage.h>
56 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
57 #include <visp3/core/vpList.h>
145 return histogram[level];
148 std::stringstream ss;
149 ss <<
"Level is > to size (" << size <<
") !";
175 return histogram[level];
178 std::stringstream ss;
179 ss <<
"Level is > to size (" << size <<
") !";
202 inline unsigned get(
const unsigned char level)
const
205 return histogram[level];
208 std::stringstream ss;
209 ss <<
"Level is > to size (" << size <<
") !";
230 inline void set(
const unsigned char level,
unsigned int value)
233 histogram[level] = value;
235 std::stringstream ss;
236 ss <<
"Level is > to size (" << size <<
") !";
244 unsigned int maxValue_ = 0);
246 void smooth(
unsigned int fsize = 3);
247 unsigned getPeaks(std::list<vpHistogramPeak> &peaks);
250 unsigned getValey(std::list<vpHistogramValey> &valey);
254 unsigned sort(std::list<vpHistogramPeak> &peaks);
256 bool write(
const std::string &filename);
257 bool write(
const char *filename);
267 inline unsigned getSize()
const {
return size; };
293 void init(
unsigned size = 256);
295 unsigned int *histogram;
Class to define RGB colors available for display functionnalities.
static const vpColor white
error that can be emited by ViSP classes.
@ dimensionError
Bad dimension.
Declaration of the peak (maximum value) in a gray level image histogram.
Declaration of the valey (minimum value) in a gray level image histogram.
Class to compute a gray level image histogram.
unsigned operator()(const unsigned char level) const
unsigned operator[](const unsigned char level) const
void set(const unsigned char level, unsigned int value)
unsigned get(const unsigned char level) const