Point Cloud Library (PCL)  1.12.1-dev
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 */
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 
69 
70 
71 
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
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
DeviceArray class
Definition: device_array.h:54
Defines all the PCL implemented PointT point type structures.
std::uint8_t Label
Definition: tree.h:73
pcl::RGB getLColor(unsigned char l)
gives a label and returns the color out of the colormap
PCL_EXPORTS void uploadColorMap(DeviceArray< pcl::RGB > &color_map)
const int LUT_COLOR_LABEL_LENGTH
void colorLMap(int W, int H, const trees::Label *l, unsigned char *c)
PCL_EXPORTS void colorizeMixedLabels(const DeviceArray< RGB > &color_map, const DeviceArray2D< unsigned char > &labels, const DeviceArray2D< RGB > &image, DeviceArray2D< RGB > &color_labels)
PCL_EXPORTS void colorizeLabels(const DeviceArray< pcl::RGB > &color_map, const DeviceArray2D< unsigned char > &labels, DeviceArray2D< pcl::RGB > &color_labels)
const unsigned char LUT_COLOR_LABEL[]
void colorFG(int W, int H, const unsigned char *labels, unsigned char *c)
Definition: colormap.h:76
#define PCL_EXPORTS
Definition: pcl_macros.h:323
A structure representing RGB color information.