StereoCameraProvider.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, 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::Component
19  * @author Jan Issac (jan dot issac at gmx dot net)
20  * @date 2011
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 #include <VisionX/interface/components/Calibration.h>
28 
29 // IEEE1394ImageProvider
31 
32 // IVT
33 #include <Calibration/StereoCalibration.h>
34 
35 namespace visionx
36 {
38  {
39  public:
42  {
43  defineRequiredProperty<std::string>("CalibrationFile", "Camera calibration file");
44 
45  defineOptionalProperty<bool>(
46  "LeftCameraAsIdentity", true, "Set left camera as identity");
47 
48  defineOptionalProperty<std::string>(
49  "ReferenceFrameName", "EyeLeftCameras", "Optional reference frame name.");
50  }
51  };
52 
53  /**
54  * Stereo camera provider is based on IEEE1394 image provider with the
55  * restriction that the number of specified cameras must be two. This
56  * provider supplies the processor with a stereo calibration to perform
57  * stereo vision.
58  *
59  * \componentproperties
60  * \prop VisionX.StereoCameraProvider.CalibrationFile: The stereo
61  * calibration file of the stereo system.
62  */
64  virtual public IEEE1394ImageProvider,
65  virtual public StereoCalibrationCaptureProviderInterface
66  {
67  public:
68  /**
69  * Part of visionx::StereoCalibrationProvider interface
70  *
71  * Returns the VisionX StereoCalibration, especially vis ICE
72  *
73  * @return visionx::StereoCalibration
74  */
75  visionx::StereoCalibration
76  getStereoCalibration(const Ice::Current& c = Ice::emptyCurrent) override;
77 
78  /**
79  * Part of visionx::StereoCalibrationProvider interface
80  *
81  * Returns whether images are undistorted
82  *
83  * @return bool
84  */
85  bool
86  getImagesAreUndistorted(const Ice::Current& c = Ice::emptyCurrent) override
87  {
88  return false;
89  }
90 
91  std::string
92  getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override
93  {
94  return getProperty<std::string>("ReferenceFrameName").getValue();
95  }
96 
97  /**
98  * @see armarx::Component::getDefaultName()
99  */
100  std::string
101  getDefaultName() const override
102  {
103  return "StereoCameraProvider";
104  }
105 
106  /**
107  * @see ImageProviderBase::onInitImageProvider()
108  */
109  void onInitCapturingImageProvider() override;
110 
111  /**
112  * @see PropertyUser::createPropertyDefinitions()
113  */
116  {
119  }
120 
121  private:
122  /**
123  * IVT Stereo Calibration object
124  */
125  CStereoCalibration ivtStereoCalibration;
126 
127  /**
128  * VisionX StereoCalibration object
129  */
130  visionx::StereoCalibration stereoCalibration;
131  };
132 } // namespace visionx
visionx::IEEE1394ImageProvider
IEEE1394 image provider captures images from one or more cameras and supports the following image tra...
Definition: IEEE1394ImageProvider.h:172
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::StereoCameraProvider::getDefaultName
std::string getDefaultName() const override
Definition: StereoCameraProvider.h:101
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
visionx::StereoCameraProvider::getReferenceFrame
std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
Definition: StereoCameraProvider.h:92
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
visionx::StereoCameraProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: StereoCameraProvider.h:115
visionx::StereoCalibrationProviderPropertyDefinitions::StereoCalibrationProviderPropertyDefinitions
StereoCalibrationProviderPropertyDefinitions(std::string prefix)
Definition: StereoCameraProvider.h:40
visionx::StereoCameraProvider::getStereoCalibration
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
Definition: StereoCameraProvider.cpp:77
visionx::StereoCameraProvider::getImagesAreUndistorted
bool getImagesAreUndistorted(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
Definition: StereoCameraProvider.h:86
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
visionx::StereoCalibrationProviderPropertyDefinitions
Definition: StereoCameraProvider.h:37
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::StereoCameraProvider::onInitCapturingImageProvider
void onInitCapturingImageProvider() override
Definition: StereoCameraProvider.cpp:42
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
visionx::IEEE1394PropertyDefinitions
Definition: IEEE1394ImageProvider.h:75
IEEE1394ImageProvider.h
visionx::StereoCameraProvider
Stereo camera provider is based on IEEE1394 image provider with the restriction that the number of sp...
Definition: StereoCameraProvider.h:63