Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
people
include
pcl
gpu
people
colormap.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2010-2012, Willow Garage, Inc.
6
*
7
* All rights reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* * Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials provided
18
* with the distribution.
19
* * Neither the name of Willow Garage, Inc. nor the names of its
20
* contributors may be used to endorse or promote products derived
21
* from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
* $Id: $
37
* @author: Koen Buys, Anatoly Baksheev
38
*/
39
40
#pragma once
41
42
#include <pcl/point_cloud.h>
43
#include <
pcl/point_types.h
>
44
#include <pcl/gpu/people/tree.h>
45
#include <pcl/gpu/containers/device_array.h>
46
47
namespace
pcl
48
{
49
namespace
gpu
50
{
51
namespace
people
52
{
53
54
/** @brief gives a label and returns the color out of the colormap */
55
pcl::RGB
getLColor
(
unsigned
char
l);
56
57
/** @brief gives a label and returns the color out of the colormap */
58
pcl::RGB
getLColor
(
pcl::Label
l);
59
60
void
colorLMap
(
int
W,
int
H,
const
trees::Label
* l,
unsigned
char
* c);
61
void
colorLMap
(
const
PointCloud<pcl::Label>
& cloud_in,
PointCloud<pcl::RGB>
& colormap_out);
62
63
64
extern
const
unsigned
char
LUT_COLOR_LABEL
[];
65
extern
const
int
LUT_COLOR_LABEL_LENGTH
;
66
67
PCL_EXPORTS
void
uploadColorMap
(
DeviceArray<pcl::RGB>
& color_map);
68
PCL_EXPORTS
void
colorizeLabels
(
const
DeviceArray<pcl::RGB>
& color_map,
const
DeviceArray2D<unsigned char>
& labels,
DeviceArray2D<pcl::RGB>
& color_labels);
69
70
71
72
PCL_EXPORTS
void
colorizeMixedLabels
(
const
DeviceArray<RGB>
& color_map,
const
DeviceArray2D<unsigned char>
& labels,
73
const
DeviceArray2D<RGB>
& image,
DeviceArray2D<RGB>
& color_labels);
74
75
76
inline
void
colorFG
(
int
W,
int
H,
const
unsigned
char
* labels,
unsigned
char
* c )
77
{
78
int
numPix = W*H;
79
for
(
int
pi = 0; pi < numPix; ++pi)
80
if
(labels[pi] !=0 )
81
{
82
c[3*pi+0] = 0xFF;
83
c[3*pi+1] = 0x00;
84
c[3*pi+2] = 0x00;
85
}
86
}
87
88
89
90
}
// end namespace people
91
}
// end namespace gpu
92
}
// end namespace pcl
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition
point_cloud.h:174
pcl::gpu::DeviceArray2D
DeviceArray2D class
Definition
device_array.h:188
pcl::gpu::DeviceArray
DeviceArray class
Definition
device_array.h:54
point_types.h
Defines all the PCL implemented PointT point type structures.
pcl::gpu::people::trees::Label
std::uint8_t Label
Definition
tree.h:73
pcl::gpu::people
Definition
bodyparts_detector.h:63
pcl::gpu::people::getLColor
pcl::RGB getLColor(unsigned char l)
gives a label and returns the color out of the colormap
pcl::gpu::people::uploadColorMap
PCL_EXPORTS void uploadColorMap(DeviceArray< pcl::RGB > &color_map)
pcl::gpu::people::LUT_COLOR_LABEL_LENGTH
const int LUT_COLOR_LABEL_LENGTH
pcl::gpu::people::colorLMap
void colorLMap(int W, int H, const trees::Label *l, unsigned char *c)
pcl::gpu::people::colorizeMixedLabels
PCL_EXPORTS void colorizeMixedLabels(const DeviceArray< RGB > &color_map, const DeviceArray2D< unsigned char > &labels, const DeviceArray2D< RGB > &image, DeviceArray2D< RGB > &color_labels)
pcl::gpu::people::colorizeLabels
PCL_EXPORTS void colorizeLabels(const DeviceArray< pcl::RGB > &color_map, const DeviceArray2D< unsigned char > &labels, DeviceArray2D< pcl::RGB > &color_labels)
pcl::gpu::people::LUT_COLOR_LABEL
const unsigned char LUT_COLOR_LABEL[]
pcl::gpu::people::colorFG
void colorFG(int W, int H, const unsigned char *labels, unsigned char *c)
Definition
colormap.h:76
pcl::gpu
Definition
device_array.h:45
pcl
Definition
convolution.h:46
pcl::Label
Definition
point_types.hpp:490
pcl::RGB
A structure representing RGB color information.
Definition
point_types.hpp:363