Point Cloud Library (PCL)  1.9.1
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 #ifndef PCL_GPU_PEOPLE_COLORMAP_H_
41 #define PCL_GPU_PEOPLE_COLORMAP_H_
42 
43 #include <pcl/point_cloud.h>
44 #include <pcl/point_types.h>
45 #include <pcl/gpu/people/tree.h>
46 #include <pcl/gpu/containers/device_array.h>
47 
48 namespace pcl
49 {
50  namespace gpu
51  {
52  namespace people
53  {
54 
55  /** @brief gives a label and returns the color out of the colormap */
56  pcl::RGB getLColor(unsigned char l);
57 
58  /** @brief gives a label and returns the color out of the colormap */
60 
61  void colorLMap(int W, int H, const trees::Label* l, unsigned char* c);
62  void colorLMap(const PointCloud<pcl::Label>& cloud_in, PointCloud<pcl::RGB>& colormap_out);
63 
64 
65  extern const unsigned char LUT_COLOR_LABEL[];
66  extern const int LUT_COLOR_LABEL_LENGTH;
67 
68  PCL_EXPORTS void uploadColorMap(DeviceArray<pcl::RGB>& color_map);
69  PCL_EXPORTS void colorizeLabels(const DeviceArray<pcl::RGB>& color_map, const DeviceArray2D<unsigned char>& labels, DeviceArray2D<pcl::RGB>& color_labels);
70 
71 
72 
73  PCL_EXPORTS void colorizeMixedLabels(const DeviceArray<RGB>& color_map, const DeviceArray2D<unsigned char>& labels,
74  const DeviceArray2D<RGB>& image, DeviceArray2D<RGB>& color_labels);
75 
76 
77  inline void colorFG ( int W, int H, const unsigned char* labels, unsigned char* c )
78  {
79  int numPix = W*H;
80  for(int pi = 0; pi < numPix; ++pi)
81  if(labels[pi] !=0 )
82  {
83  c[3*pi+0] = 0xFF;
84  c[3*pi+1] = 0x00;
85  c[3*pi+2] = 0x00;
86  }
87  }
88 
89 
90 
91  } // end namespace people
92  } // end namespace gpu
93 } // end namespace pcl
94 #endif //PCL_GPU_PEOPLE_COLORMAP_H_
PCL_EXPORTS void uploadColorMap(DeviceArray< pcl::RGB > &color_map)
void colorFG(int W, int H, const unsigned char *labels, unsigned char *c)
Definition: colormap.h:77
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
PCL_EXPORTS void colorizeMixedLabels(const DeviceArray< RGB > &color_map, const DeviceArray2D< unsigned char > &labels, const DeviceArray2D< RGB > &image, DeviceArray2D< RGB > &color_labels)
const int LUT_COLOR_LABEL_LENGTH
A structure representing RGB color information.
Defines all the PCL implemented PointT point type structures.
pcl::RGB getLColor(unsigned char l)
gives a label and returns the color out of the colormap
PointCloud represents the base class in PCL for storing collections of 3D points. ...
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 colorLMap(int W, int H, const trees::Label *l, unsigned char *c)