46 #include <visp3/core/vpColor.h>
47 #include <visp3/core/vpHistogramPeak.h>
48 #include <visp3/core/vpHistogramValey.h>
49 #include <visp3/core/vpImage.h>
51 #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS
52 #include <visp3/core/vpList.h>
140 return histogram[level];
143 std::stringstream ss;
144 ss <<
"Level is > to size (" << size <<
") !";
170 return histogram[level];
173 std::stringstream ss;
174 ss <<
"Level is > to size (" << size <<
") !";
197 inline unsigned get(
const unsigned char level)
const
200 return histogram[level];
203 std::stringstream ss;
204 ss <<
"Level is > to size (" << size <<
") !";
225 inline void set(
const unsigned char level,
unsigned int value)
228 histogram[level] = value;
230 std::stringstream ss;
231 ss <<
"Level is > to size (" << size <<
") !";
239 unsigned int maxValue_ = 0);
241 void smooth(
unsigned int fsize = 3);
242 unsigned getPeaks(std::list<vpHistogramPeak> &peaks);
245 unsigned getValey(std::list<vpHistogramValey> &valey);
249 unsigned sort(std::list<vpHistogramPeak> &peaks);
251 bool write(
const std::string &filename);
252 bool write(
const char *filename);
262 inline unsigned getSize()
const {
return size; };
288 void init(
unsigned size = 256);
290 unsigned int *histogram;
Class to define RGB colors available for display functionalities.
static const vpColor white
error that can be emitted 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