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 if (level < m_size) {
141 return m_histogram[level];
144 std::stringstream ss;
145 ss <<
"Level is > to size (" << m_size <<
") !";
170 if (level < m_size) {
171 return m_histogram[level];
174 std::stringstream ss;
175 ss <<
"Level is > to size (" << m_size <<
") !";
198 inline unsigned get(
const unsigned char level)
const
200 if (level < m_size) {
201 return m_histogram[level];
204 std::stringstream ss;
205 ss <<
"Level is > to size (" << m_size <<
") !";
226 inline void set(
const unsigned char level,
unsigned int value)
228 if (level < m_size) {
229 m_histogram[level] = value;
232 std::stringstream ss;
233 ss <<
"Level is > to size (" << m_size <<
") !";
257 unsigned int maxValue_ = 0);
259 void smooth(
unsigned int fsize = 3);
260 unsigned getPeaks(std::list<vpHistogramPeak> &peaks);
263 unsigned getValey(std::list<vpHistogramValey> &valey);
267 unsigned sort(std::list<vpHistogramPeak> &peaks);
269 bool write(
const std::string &filename);
270 bool write(
const char *filename);
280 inline unsigned getSize()
const {
return m_size; };
310 inline unsigned int getTotal() {
return m_total; };
313 void init(
unsigned size = 256);
315 unsigned int *m_histogram;
318 unsigned int m_total;
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 int getTotal()
Get the total number of pixels in the input image.
unsigned operator()(const unsigned char level) const
unsigned operator[](const unsigned char level) const
void set(const unsigned char level, unsigned int value)
void setMask(const vpImage< bool > *p_mask)
Set a mask to ignore pixels for which the mask is false.
unsigned get(const unsigned char level) const