MultiImageProvider.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::MultiImageProvider
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 
26 #include <mutex>
27 
29 #include <VisionX/interface/components/Calibration.h>
30 
31 namespace armarx
32 {
33 
34  /**
35  * @class MultiImageProviderPropertyDefinitions
36  * @brief
37  */
39  {
40  public:
43  {
44  defineRequiredProperty<std::string>("ImageProviders", "Split names by ;");
45  }
46  };
47 
48  /**
49  * @defgroup Component-MultiImageProvider MultiImageProvider
50  * @ingroup VisionX-Components
51  * A description of the component MultiImageProvider.
52  *
53  * @class MultiImageProvider
54  * @ingroup Component-MultiImageProvider
55  * @brief Brief description of class MultiImageProvider.
56  *
57  * Detailed description of class MultiImageProvider.
58  */
60  {
61  public:
62  /**
63  * @see armarx::ManagedIceObject::getDefaultName()
64  */
65  std::string
66  getDefaultName() const override
67  {
68  return "MultiImageProvider";
69  }
70 
71  protected:
72  /**
73  * @see visionx::ImageProcessor::onInitImageProcessor()
74  */
75  void onInitImageProcessor() override;
76 
77  /**
78  * @see visionx::ImageProcessor::onConnectImageProcessor()
79  */
80  void onConnectImageProcessor() override;
81 
82  /**
83  * @see visionx::ImageProcessor::onExitImageProcessor()
84  */
85  void onExitImageProcessor() override;
86 
87  /**
88  * @see visionx::ImageProcessor::process()
89  */
90  void process() override;
91 
92  /**
93  * @see PropertyUser::createPropertyDefinitions()
94  */
96 
97 
98  private:
99  std::mutex mutex;
100 
101  struct ImageProviderData
102  {
103  int numImages = 0;
104  std::vector<visionx::CByteImageUPtr> srcCameraImages;
105  std::vector<visionx::CByteImageUPtr> targetCameraImages;
106  bool resize = false;
107  std::set<size_t> imageSelection;
108  visionx::ImageProviderInfo providerInfo;
109  };
110 
111  size_t totalNumberOfImages = 0;
112  std::map<std::string, ImageProviderData> imageProviderData;
113  };
114 } // namespace armarx
armarx::MultiImageProvider
Brief description of class MultiImageProvider.
Definition: MultiImageProvider.h:59
armarx::MultiImageProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: MultiImageProvider.cpp:207
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::ImageProcessor
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
Definition: ImageProcessor.h:98
armarx::MultiImageProvider::getDefaultName
std::string getDefaultName() const override
Definition: MultiImageProvider.h:66
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::MultiImageProviderPropertyDefinitions
Definition: MultiImageProvider.h:38
visionx::ImageProcessorPropertyDefinitions::ImageProcessorPropertyDefinitions
ImageProcessorPropertyDefinitions(std::string prefix)
Definition: ImageProcessor.h:64
visionx::ImageProviderInfo
Definition: ImageProcessor.h:479
ImageProcessor.h
armarx::MultiImageProvider::onConnectImageProcessor
void onConnectImageProcessor() override
Definition: MultiImageProvider.cpp:68
armarx::MultiImageProvider::onExitImageProcessor
void onExitImageProcessor() override
Definition: MultiImageProvider.cpp:133
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::ImageProcessorPropertyDefinitions
Definition: ImageProcessor.h:61
armarx::MultiImageProviderPropertyDefinitions::MultiImageProviderPropertyDefinitions
MultiImageProviderPropertyDefinitions(std::string prefix)
Definition: MultiImageProvider.h:41
armarx::MultiImageProvider::onInitImageProcessor
void onInitImageProcessor() override
Definition: MultiImageProvider.cpp:40
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::MultiImageProvider::process
void process() override
Definition: MultiImageProvider.cpp:154