ViSP  2.8.0
vpHistogramPeak Class Reference

#include <vpHistogramPeak.h>

+ Inheritance diagram for vpHistogramPeak:

Public Member Functions

 vpHistogramPeak ()
 
 vpHistogramPeak (unsigned char level, unsigned value)
 
 vpHistogramPeak (const vpHistogramPeak &p)
 
vpHistogramPeakoperator= (const vpHistogramPeak &p)
 
bool operator== (const vpHistogramPeak &p) const
 
void setLevel (unsigned char level)
 
void setValue (unsigned value)
 
void set (unsigned char level, unsigned value)
 
unsigned char getLevel () const
 
unsigned getValue () const
 

Protected Attributes

unsigned char level
 
unsigned value
 

Friends

VISP_EXPORT std::ostream & operator<< (std::ostream &s, const vpHistogramPeak &p)
 

Detailed Description

Declaration of the peak (maximum value) in a gray level image histogram.

A peak is internally represented as a gray level and a value. The value represents the number of pixels having the gray level.

Examples:
histogram.cpp.

Definition at line 70 of file vpHistogramPeak.h.

Constructor & Destructor Documentation

vpHistogramPeak::vpHistogramPeak ( )

Defaut constructor for a gray level histogram peak.

Definition at line 55 of file vpHistogramPeak.cpp.

References level, and value.

vpHistogramPeak::vpHistogramPeak ( unsigned char  level,
unsigned  value 
)

Defaut constructor for a gray level histogram peak.

Definition at line 64 of file vpHistogramPeak.cpp.

References setLevel(), and setValue().

vpHistogramPeak::vpHistogramPeak ( const vpHistogramPeak p)

Copy constructor of a gray level histogram peak.

Definition at line 72 of file vpHistogramPeak.cpp.

References level, setLevel(), setValue(), and value.

Member Function Documentation

unsigned char vpHistogramPeak::getLevel ( ) const
inline

Get the peak gray level. The number of pixels having this gray level is available throw getValue().

Returns
Location of the peak or gray level.
See also
getValue()
Examples:
histogram.cpp.

Definition at line 134 of file vpHistogramPeak.h.

Referenced by vpHistogram::getPeaks(), and vpHistogram::getValey().

unsigned vpHistogramPeak::getValue ( ) const
inline

Get the peak number of pixels having a same gray level. The corresponding gray level is available throw getLevel().

Returns
: Number of pixels having the same location or gray level.
See also
getLevel()
Examples:
histogram.cpp.

Definition at line 148 of file vpHistogramPeak.h.

Referenced by vpHistogram::getPeaks(), vpHistogram::getValey(), and vpHistogram::sort().

vpHistogramPeak & vpHistogramPeak::operator= ( const vpHistogramPeak p)

Copy operator.

Parameters
p: Histogram peak to copy.
vpHistogramPeak p1(0, 255);
vpHistogramPeak p2 = p1; // Peak p2 is set to 0, 255

Definition at line 89 of file vpHistogramPeak.cpp.

References level, setLevel(), setValue(), and value.

bool vpHistogramPeak::operator== ( const vpHistogramPeak p) const

Comparison operator.

Parameters
p: Gray level histogram peak to compar.

Definition at line 105 of file vpHistogramPeak.cpp.

References level, and value.

void vpHistogramPeak::set ( unsigned char  level,
unsigned  value 
)
inline

Set the peak gray level and number of pixels at this gray level.

Parameters
level: Location of the peak or gray level.
value: Number of pixels having the same location or gray level.
See also
setLevel(), setValue()

Definition at line 118 of file vpHistogramPeak.h.

Referenced by vpHistogram::getPeaks(), and vpHistogram::getValey().

void vpHistogramPeak::setLevel ( unsigned char  level)
inline

Set the peak gray level. To set the number of pixels having this gray level use setValue().

Parameters
level: Location of the peak or gray level.
See also
setValue(), set()

Definition at line 90 of file vpHistogramPeak.h.

Referenced by operator=(), and vpHistogramPeak().

void vpHistogramPeak::setValue ( unsigned  value)
inline

Set the peak number of pixels having a same gray level. To set the gray level of this peak use setLevel().

Parameters
value: Number of pixels having the same location or gray level.
See also
setLevel(), set()

Definition at line 104 of file vpHistogramPeak.h.

Referenced by operator=(), and vpHistogramPeak().

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  s,
const vpHistogramPeak p 
)
friend

std::cout a peak

Definition at line 113 of file vpHistogramPeak.cpp.

Member Data Documentation