MaskRobotInImage.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2018, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package VisionX
19 * @author Julian Zimmer ( urdbu at student dot kit dot edu )
20 * @date 2018
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#ifndef _H_VISIONX_MaskRobotInImage_
25#define _H_VISIONX_MaskRobotInImage_
26
27
28#include <Eigen/Core>
29
30#include <VirtualRobot/Robot.h>
31#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
32#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h>
33
35
36#include <RobotAPI/interface/core/RobotState.h>
40
41#include <VisionX/interface/core/DataTypes.h>
42
43#include <Image/ByteImage.h>
44#include <Image/ImageProcessor.h>
45#include <Inventor/SoInteraction.h>
46#include <Inventor/actions/SoGLRenderAction.h>
47#include <Inventor/nodes/SoBaseColor.h>
48#include <Inventor/nodes/SoSelection.h>
49#include <Inventor/nodes/SoUnits.h>
50
51namespace armarx
52{
53 /**
54 * @class MaskRobotInImage
55 * @brief A brief description
56 *
57 * Detailed Description
58 */
60 {
61 public:
62 /**
63 * MaskRobotInImage Constructor
64 */
66 std::string cameraFrameName,
67 visionx::ImageFormatInfo imageFormat,
68 float fov,
69 SbColor backgroundColor = SbColor(0.f, (177.f / 255.f), (64.f / 255.f)),
70 bool flipImages = true,
71 bool useFullModel = true,
72 float collisionModelInflationMargin = 0.f);
73
74 /**
75 * MaskRobotInImage Destructor
76 */
78
79 CByteImage* getMaskImage(Ice::Long timestamp);
80
81 void setBackgroundColor(SbColor newBackgroundColor);
82
83 private:
84 int imageWidth;
85 int imageHeight;
86 std::string cameraFrameName;
87 float fov;
88
89 SbColor backgroundColor;
90 bool flipImages;
91 bool useFullModel;
92 float collisionModelInflationMargin;
93
94 RobotStateComponentInterfacePrx robotStateComponent;
95 VirtualRobot::RobotPtr localRobot;
96
97 std::shared_ptr<SoOffscreenRenderer> renderer;
98 std::vector<unsigned char> renderBuffer;
99
100 CByteImage* renderedImage;
101 CByteImage* maskImage;
102 };
103} // namespace armarx
104#endif
std::string timestamp()
CByteImage * getMaskImage(Ice::Long timestamp)
MaskRobotInImage(RobotStateComponentInterfacePrx robotStateComponent, std::string cameraFrameName, visionx::ImageFormatInfo imageFormat, float fov, SbColor backgroundColor=SbColor(0.f,(177.f/255.f),(64.f/255.f)), bool flipImages=true, bool useFullModel=true, float collisionModelInflationMargin=0.f)
MaskRobotInImage Constructor.
void setBackgroundColor(SbColor newBackgroundColor)
~MaskRobotInImage()
MaskRobotInImage Destructor.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx