RGBDOpenPoseEstimationComponent.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::OpenPoseEstimation
17 * @author Stefan Reither ( stef dot reither at web dot de )
18 * @date 2018
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22#pragma once
23
24// STD/STL
25
26// IVT
27#include <Calibration/Calibration.h>
28#include <Calibration/StereoCalibration.h>
29
30
31// Base class
33
34namespace armarx
35{
37 {
38 public:
41
42 // helper functions
43 void preOnInitImageProcessor() override;
44 void preOnConnectImageProcessor() override;
45 void postOnConnectImageProcessor() override;
46 void preOnDisconnectImageProcessor() override;
47 void postOnDisconnectImageProcessor() override;
48
50
51 // OpenPoseEstimation Interface
52 void stop(const Ice::Current& = Ice::emptyCurrent) override;
53 void start3DPoseEstimation(const Ice::Current& = Ice::emptyCurrent) override;
54 void stop3DPoseEstimation(const Ice::Current& = Ice::emptyCurrent) override;
55
56 // HumanPoseEstimation Interface
57 void enableHumanPoseEstimation(const EnableHumanPoseEstimationInput& input,
58 const Ice::Current&) override;
59
60 void renderOutputImage(const op::Array<float>&) override;
61 void reportEntities() override;
62 void visualize() override;
63
64 private:
65 void maskOutputImageBasedOnDepth();
66 int getMedianDepthFromImage(int x, int y, int radius) const;
67
68 void filterToNearest();
69
70
71 public:
72 // Depth image info
73 unsigned int radius = 10;
74 unsigned int maxDepth = 3000;
75 unsigned int maxDepthDifference = 700;
76
77 // Image calibration
78 const CCalibration* calibration = nullptr;
79 std::string cameraNodeName = "AzureKinectCamera";
81
82 // ImageBuffer und ImageInformations
84
85 CByteImage* depthImageBuffer;
88
89 // Meta (Properties)
91
92 // Topics
93 OpenPose3DListenerPrx listener3DPrx;
94
95 // OpenPose Buffers
96 HumanPose3DMap openposeResult3D;
97
98 // Robot
101
102 // Threads and program flow information
103 std::atomic_bool running3D;
104 };
105} // namespace armarx
void start3DPoseEstimation(const Ice::Current &=Ice::emptyCurrent) override
void stop(const Ice::Current &=Ice::emptyCurrent) override
void stop3DPoseEstimation(const Ice::Current &=Ice::emptyCurrent) override
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
void enableHumanPoseEstimation(const EnableHumanPoseEstimationInput &input, const Ice::Current &) override
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx