Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpHistogramPeak Class Reference

#include <vpHistogramPeak.h>

Inheritance diagram for vpHistogramPeak:

Public Member Functions

 vpHistogramPeak ()
 vpHistogramPeak (unsigned char level, unsigned value)
 vpHistogramPeak (const vpHistogramPeak &p)
virtual ~vpHistogramPeak ()
vpHistogramPeakoperator= (const vpHistogramPeak &p)
bool operator== (const vpHistogramPeak &p) const
void setLevel (unsigned char lvl)
void setValue (unsigned val)
void set (unsigned char lvl, unsigned val)
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 59 of file vpHistogramPeak.h.

Constructor & Destructor Documentation

◆ vpHistogramPeak() [1/3]

vpHistogramPeak::vpHistogramPeak ( )

Defaut constructor for a gray level histogram peak.

Definition at line 49 of file vpHistogramPeak.cpp.

References level, and value.

Referenced by operator<<, operator=(), operator==(), vpHistogramPeak(), vpHistogramValey::vpHistogramValey(), vpHistogramValey::vpHistogramValey(), and vpHistogramValey::vpHistogramValey().

◆ vpHistogramPeak() [2/3]

vpHistogramPeak::vpHistogramPeak ( unsigned char lvl,
unsigned val )

Defaut constructor for a gray level histogram peak.

Definition at line 54 of file vpHistogramPeak.cpp.

References level, and value.

◆ vpHistogramPeak() [3/3]

vpHistogramPeak::vpHistogramPeak ( const vpHistogramPeak & p)

Copy constructor of a gray level histogram peak.

Definition at line 59 of file vpHistogramPeak.cpp.

References level, value, and vpHistogramPeak().

◆ ~vpHistogramPeak()

virtual vpHistogramPeak::~vpHistogramPeak ( )
inlinevirtual

Destructor that does nothing.

Definition at line 67 of file vpHistogramPeak.h.

Member Function Documentation

◆ getLevel()

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 120 of file vpHistogramPeak.h.

References level.

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

◆ getValue()

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 131 of file vpHistogramPeak.h.

References value.

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

◆ operator=()

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 71 of file vpHistogramPeak.cpp.

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

◆ operator==()

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

Comparison operator.

Parameters
p: Gray level histogram peak to compar.

Definition at line 86 of file vpHistogramPeak.cpp.

References level, value, and vpHistogramPeak().

◆ set()

void vpHistogramPeak::set ( unsigned char lvl,
unsigned val )
inline

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

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

Definition at line 104 of file vpHistogramPeak.h.

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

◆ setLevel()

void vpHistogramPeak::setLevel ( unsigned char lvl)
inline

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

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

Definition at line 82 of file vpHistogramPeak.h.

Referenced by operator=().

◆ setValue()

void vpHistogramPeak::setValue ( unsigned val)
inline

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

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

Definition at line 93 of file vpHistogramPeak.h.

Referenced by operator=().

◆ operator<<

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

std::cout a peak

Definition at line 92 of file vpHistogramPeak.cpp.

References getLevel(), getValue(), operator<<, and vpHistogramPeak().

Referenced by operator<<.

Member Data Documentation

◆ level

◆ value