Gazebo Rendering

API Reference

6.6.3
gz/rendering/SegmentationCamera.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef IGNITION_RENDERING_SEGMENTATIONCAMERA_HH_
18 #define IGNITION_RENDERING_SEGMENTATIONCAMERA_HH_
19 
20 #include <functional>
21 #include <string>
22 
23 #include <ignition/common/Event.hh>
24 #include <ignition/math/Color.hh>
25 
27 
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
34  enum class SegmentationType
35  {
38  ST_SEMANTIC = 0,
39 
42  ST_PANOPTIC = 1
43  };
44 
45  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
51  class IGNITION_RENDERING_VISIBLE SegmentationCamera :
52  public virtual Camera
53  {
55  public: virtual ~SegmentationCamera() { }
56 
58  public: virtual void CreateSegmentationTexture() = 0;
59 
64  public: virtual uint8_t *SegmentationData() const = 0;
65 
71  public: virtual ignition::common::ConnectionPtr
72  ConnectNewSegmentationFrame(
73  std::function<void(const uint8_t *, unsigned int, unsigned int,
74  unsigned int, const std::string &)> _subscriber) = 0;
75 
78  public: virtual void SetSegmentationType(SegmentationType _type) = 0;
79 
82  public: virtual SegmentationType Type() const = 0;
83 
87  public: virtual void EnableColoredMap(bool _enable) = 0;
88 
91  public: virtual bool IsColoredMap() const = 0;
92 
95  public: virtual void SetBackgroundColor(const math::Color &_color) = 0;
96 
99  public: virtual void SetBackgroundLabel(int _label) = 0;
100 
103  public: virtual const math::Color &BackgroundColor() const = 0;
104 
107  public: virtual int BackgroundLabel() const = 0;
108 
116  public: virtual void LabelMapFromColoredBuffer(
117  uint8_t *_labelBuffer) const = 0;
118  };
119  }
120  }
121 }
122 #endif
virtual void SetBackgroundLabel(int _label)=0
Set label for background & unlabeled items in the semantic map.
STL class.
STL class.
@ ST_PANOPTIC
Pixels of same label from different items, have different color & id. 1 channel for label id & 2 chan...
Poseable Segmentation camera used for rendering the scene graph. This camera is designed to produce s...
Definition: gz/rendering/SegmentationCamera.hh:51
Posable camera used for rendering the scene graph.
Definition: gz/rendering/Camera.hh:49
virtual void SetBackgroundColor(const math::Color &_color)=0
Set color for background & unlabeled items in the colored map.
virtual ignition::common::ConnectionPtr ConnectNewSegmentationFrame(std::function< void(const uint8_t *, unsigned int, unsigned int, unsigned int, const std::string &)> _subscriber)=0
Connect to the new Segmentation image event.
virtual ~SegmentationCamera()
Destructor.
Definition: gz/rendering/SegmentationCamera.hh:55
virtual int BackgroundLabel() const =0
Get label for background & unlabeled items in the semantic map.
@ ST_SEMANTIC
Pixels of same label from different items have the same color & id.
virtual void CreateSegmentationTexture()=0
Create a texture which will hold the segmentation data.
virtual bool IsColoredMap() const =0
Check if color map mode is enabled.
virtual void EnableColoredMap(bool _enable)=0
Enable Color map mode to generate colored semantics.
virtual uint8_t * SegmentationData() const =0
Get the segmentation image data. If the segmentation type is panoptic, the first two channels are the...
SegmentationType
Segmentation types for Semantic / Panpoptic segmentation.
Definition: gz/rendering/SegmentationCamera.hh:34
virtual const math::Color & BackgroundColor() const =0
Get color for background & unlabeled items in the colored map.
virtual void SetSegmentationType(SegmentationType _type)=0
Set Segmentation Type.
virtual SegmentationType Type() const =0
Get Segmentation Type.
virtual void LabelMapFromColoredBuffer(uint8_t *_labelBuffer) const =0
Convert the colored map stored in the internal buffer to label IDs map, so users get both the colored...