Component.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package VisionX::ArmarXObjects::DepthFilter
17  * @author Christian R. G. Dreher <c.dreher@kit.edu>
18  * @date 2019
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 
24 #pragma once
25 
26 
27 // STD/STL
28 #include <string>
29 
30 // IVT
31 #include <Image/ByteImage.h>
32 
33 // ArmarX
35 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
37 
38 
39 namespace visionx
40 {
41  namespace depthfilter
42 
43  {
44 
45  class Component:
47  {
48 
49  public:
50 
51  enum class replace_mode
52  {
55  };
56 
57  private:
58 
59  std::string m_ipc_in;
60  std::string m_ipc_out;
61  unsigned int m_threshold;
62  replace_mode m_mode;
63  armarx::DrawColor24Bit m_color_depth;
64  armarx::DrawColor24Bit m_color_invalid;
65  CByteImage** m_buffer;
66  CByteImage** m_buffer_single;
67  CByteImage* m_buffer_mask;
68  int m_grow_radius = 10;
69 
70  public:
71 
72  virtual ~Component() override;
73 
74  virtual void onInitPointCloudAndImageProcessor() override;
75  virtual void onConnectPointCloudAndImageProcessor() override;
76  virtual void onDisconnectPointCloudAndImageProcessor() override;
77  virtual void onExitPointCloudAndImageProcessor() override;
78 
79  /**
80  * @see armarx::ManagedIceObject::getDefaultName()
81  */
82  virtual std::string getDefaultName() const override;
83 
84  /**
85  * @see visionx::PointCloudAndImageProcessor::process()
86  */
87  virtual void process() override;
88 
89  /**
90  * @see PropertyUser::createPropertyDefinitions()
91  */
93 
94  static void applyDepthFilter(
95  const CByteImage& depth,
96  unsigned int threshold,
97  int grow_radius,
98  replace_mode mode,
99  const armarx::DrawColor24Bit& color_depth,
100  const armarx::DrawColor24Bit& color_invalid,
101  CByteImage& rgb,
102  CByteImage& mask
103  );
104 
105  };
106 
107  }
108 }
109 
110 
111 namespace visionx
112 {
114 }
PointCloudAndImageProcessor.h
visionx::depthfilter::Component::replace_mode
replace_mode
Definition: Component.h:51
visionx::depthfilter::Component::onConnectPointCloudAndImageProcessor
virtual void onConnectPointCloudAndImageProcessor() override
Implement this method in your PointCloudAndImageProcessor in order execute parts when the component i...
Definition: Component.cpp:118
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::depthfilter::Component::onDisconnectPointCloudAndImageProcessor
virtual void onDisconnectPointCloudAndImageProcessor() override
Implement this method in the PointCloudAndImageProcessor in order to execute parts when the component...
Definition: Component.cpp:160
visionx::depthfilter::Component::replace_mode::exceed_threshold
@ exceed_threshold
visionx::depthfilter::Component::~Component
virtual ~Component() override
Definition: Component.cpp:77
visionx::depthfilter::Component::replace_mode::undercut_threshold
@ undercut_threshold
visionx::depthfilter::Component::getDefaultName
virtual std::string getDefaultName() const override
Definition: Component.cpp:177
visionx::depthfilter::Component::applyDepthFilter
static void applyDepthFilter(const CByteImage &depth, unsigned int threshold, int grow_radius, replace_mode mode, const armarx::DrawColor24Bit &color_depth, const armarx::DrawColor24Bit &color_invalid, CByteImage &rgb, CByteImage &mask)
Definition: Component.cpp:227
visionx::depthfilter::Component::onInitPointCloudAndImageProcessor
virtual void onInitPointCloudAndImageProcessor() override
Setup the vision component.
Definition: Component.cpp:84
visionx::depthfilter::Component
Definition: Component.h:45
visionx::depthfilter::Component::process
virtual void process() override
Definition: Component.cpp:184
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::depthfilter::Component::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: Component.cpp:332
Logging.h
visionx::depthfilter::Component::onExitPointCloudAndImageProcessor
virtual void onExitPointCloudAndImageProcessor() override
Exit the ImapeProcessor component.
Definition: Component.cpp:170
visionx::PointCloudAndImageProcessor
The PointCloudAndImageProcessor class provides an interface for access to PointCloudProviders and Ima...
Definition: PointCloudAndImageProcessor.h:97