Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
pcl
tracking
hsv_color_coherence.h
1
#pragma once
2
3
#include <pcl/tracking/coherence.h>
4
5
namespace
pcl
{
6
namespace
tracking
{
7
/** \brief @b HSVColorCoherence computes coherence between the two points from the color
8
* difference between them. the color difference is calculated in HSV color space. the
9
* coherence is calculated by 1 / ( 1 + w * (w_h^2 * h_diff^2 + w_s^2 * s_diff^2 + w_v^2
10
* * v_diff^2))
11
* \author Ryohei Ueda
12
* \ingroup tracking
13
*/
14
template
<
typename
Po
int
InT>
15
class
HSVColorCoherence
:
public
PointCoherence
<PointInT> {
16
public
:
17
using
Ptr
= shared_ptr<HSVColorCoherence<PointInT>>;
18
using
ConstPtr
= shared_ptr<const HSVColorCoherence<PointInT>>;
19
20
/** \brief initialize the weights of the computation. weight_, h_weight_, s_weight_
21
* default to 1.0 and v_weight_ defaults to 0.0.
22
*/
23
HSVColorCoherence
()
24
:
PointCoherence
<PointInT>()
25
,
weight_
(1.0)
26
,
h_weight_
(1.0)
27
,
s_weight_
(1.0)
28
,
v_weight_
(0.0)
29
{}
30
31
/** \brief set the weight of coherence
32
* \param[in] weight the weight of coherence.
33
*/
34
inline
void
35
setWeight
(
double
weight)
36
{
37
weight_
= weight;
38
}
39
40
/** \brief get the weight (w) of coherence */
41
inline
double
42
getWeight
()
43
{
44
return
weight_
;
45
}
46
47
/** \brief set the hue weight (w_h) of coherence
48
* \param[in] weight the hue weight (w_h) of coherence.
49
*/
50
inline
void
51
setHWeight
(
double
weight)
52
{
53
h_weight_
= weight;
54
}
55
56
/** \brief get the hue weight (w_h) of coherence */
57
inline
double
58
getHWeight
()
59
{
60
return
h_weight_
;
61
}
62
63
/** \brief set the saturation weight (w_s) of coherence
64
* \param[in] weight the saturation weight (w_s) of coherence.
65
*/
66
inline
void
67
setSWeight
(
double
weight)
68
{
69
s_weight_
= weight;
70
}
71
72
/** \brief get the saturation weight (w_s) of coherence */
73
inline
double
74
getSWeight
()
75
{
76
return
s_weight_
;
77
}
78
79
/** \brief set the value weight (w_v) of coherence
80
* \param[in] weight the value weight (w_v) of coherence.
81
*/
82
inline
void
83
setVWeight
(
double
weight)
84
{
85
v_weight_
= weight;
86
}
87
88
/** \brief get the value weight (w_v) of coherence */
89
inline
double
90
getVWeight
()
91
{
92
return
v_weight_
;
93
}
94
95
protected
:
96
/** \brief return the color coherence between the two points.
97
* \param[in] source instance of source point.
98
* \param[in] target instance of target point.
99
*/
100
double
101
computeCoherence
(PointInT& source, PointInT& target)
override
;
102
103
/** \brief the weight of coherence (w) */
104
double
weight_
;
105
106
/** \brief the hue weight (w_h) */
107
double
h_weight_
;
108
109
/** \brief the saturation weight (w_s) */
110
double
s_weight_
;
111
112
/** \brief the value weight (w_v) */
113
double
v_weight_
;
114
};
115
}
// namespace tracking
116
}
// namespace pcl
117
118
#ifdef PCL_NO_PRECOMPILE
119
#include <pcl/tracking/impl/hsv_color_coherence.hpp>
120
#endif
pcl::tracking::HSVColorCoherence::setWeight
void setWeight(double weight)
set the weight of coherence
Definition
hsv_color_coherence.h:35
pcl::tracking::HSVColorCoherence::HSVColorCoherence
HSVColorCoherence()
initialize the weights of the computation.
Definition
hsv_color_coherence.h:23
pcl::tracking::HSVColorCoherence::setHWeight
void setHWeight(double weight)
set the hue weight (w_h) of coherence
Definition
hsv_color_coherence.h:51
pcl::tracking::HSVColorCoherence::setSWeight
void setSWeight(double weight)
set the saturation weight (w_s) of coherence
Definition
hsv_color_coherence.h:67
pcl::tracking::HSVColorCoherence::getWeight
double getWeight()
get the weight (w) of coherence
Definition
hsv_color_coherence.h:42
pcl::tracking::HSVColorCoherence::getSWeight
double getSWeight()
get the saturation weight (w_s) of coherence
Definition
hsv_color_coherence.h:74
pcl::tracking::HSVColorCoherence::computeCoherence
double computeCoherence(PointInT &source, PointInT &target) override
return the color coherence between the two points.
Definition
hsv_color_coherence.hpp:132
pcl::tracking::HSVColorCoherence::h_weight_
double h_weight_
the hue weight (w_h)
Definition
hsv_color_coherence.h:107
pcl::tracking::HSVColorCoherence::weight_
double weight_
the weight of coherence (w)
Definition
hsv_color_coherence.h:104
pcl::tracking::HSVColorCoherence::ConstPtr
shared_ptr< const HSVColorCoherence< PointInT > > ConstPtr
Definition
hsv_color_coherence.h:18
pcl::tracking::HSVColorCoherence::s_weight_
double s_weight_
the saturation weight (w_s)
Definition
hsv_color_coherence.h:110
pcl::tracking::HSVColorCoherence::getVWeight
double getVWeight()
get the value weight (w_v) of coherence
Definition
hsv_color_coherence.h:90
pcl::tracking::HSVColorCoherence::v_weight_
double v_weight_
the value weight (w_v)
Definition
hsv_color_coherence.h:113
pcl::tracking::HSVColorCoherence::setVWeight
void setVWeight(double weight)
set the value weight (w_v) of coherence
Definition
hsv_color_coherence.h:83
pcl::tracking::HSVColorCoherence::getHWeight
double getHWeight()
get the hue weight (w_h) of coherence
Definition
hsv_color_coherence.h:58
pcl::tracking::HSVColorCoherence::Ptr
shared_ptr< HSVColorCoherence< PointInT > > Ptr
Definition
hsv_color_coherence.h:17
pcl::tracking::PointCoherence::PointCoherence
PointCoherence()=default
empty constructor
pcl::tracking
Definition
approx_nearest_pair_point_cloud_coherence.h:7
pcl
Definition
convolution.h:46