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 {
39  {
40  public:
43  {
44  defineRequiredProperty<std::string>("CalibrationFile", "Camera calibration file");
45 
46  defineOptionalProperty<bool>("LeftCameraAsIdentity", true, "Set left camera as identity");
47 
48  defineOptionalProperty<std::string>("ReferenceFrameName", "EyeLeftCameras", "Optional reference frame name.");
49  }
50  };
51 
52  /**
53  * Stereo camera provider is based on IEEE1394 image provider with the
54  * restriction that the number of specified cameras must be two. This
55  * provider supplies the processor with a stereo calibration to perform
56  * stereo vision.
57  *
58  * \componentproperties
59  * \prop VisionX.StereoCameraProvider.CalibrationFile: The stereo
60  * calibration file of the stereo system.
61  */
63  virtual public IEEE1394ImageProvider,
64  virtual public StereoCalibrationCaptureProviderInterface
65  {
66  public:
67  /**
68  * Part of visionx::StereoCalibrationProvider interface
69  *
70  * Returns the VisionX StereoCalibration, especially vis ICE
71  *
72  * @return visionx::StereoCalibration
73  */
74  visionx::StereoCalibration getStereoCalibration(
75  const Ice::Current& c = Ice::emptyCurrent) override;
76 
77  /**
78  * Part of visionx::StereoCalibrationProvider interface
79  *
80  * Returns whether images are undistorted
81  *
82  * @return bool
83  */
85  const Ice::Current& c = Ice::emptyCurrent) override
86  {
87  return false;
88  }
89 
90 
91  std::string getReferenceFrame(const Ice::Current& c = Ice::emptyCurrent) override
92  {
93  return getProperty<std::string>("ReferenceFrameName").getValue();
94  }
95 
96 
97  /**
98  * @see armarx::Component::getDefaultName()
99  */
100  std::string getDefaultName() const override
101  {
102  return "StereoCameraProvider";
103  }
104 
105  /**
106  * @see ImageProviderBase::onInitImageProvider()
107  */
108  void onInitCapturingImageProvider() override;
109 
110  /**
111  * @see PropertyUser::createPropertyDefinitions()
112  */
114  {
118  }
119 
120  private:
121  /**
122  * IVT Stereo Calibration object
123  */
124  CStereoCalibration ivtStereoCalibration;
125 
126  /**
127  * VisionX StereoCalibration object
128  */
129  visionx::StereoCalibration stereoCalibration;
130  };
131 }
visionx::IEEE1394ImageProvider
IEEE1394 image provider captures images from one or more cameras and supports the following image tra...
Definition: IEEE1394ImageProvider.h:168
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::StereoCameraProvider::getDefaultName
std::string getDefaultName() const override
Definition: StereoCameraProvider.h:100
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
visionx::StereoCameraProvider::getReferenceFrame
std::string getReferenceFrame(const Ice::Current &c=Ice::emptyCurrent) override
Definition: StereoCameraProvider.h:91
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
visionx::StereoCameraProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: StereoCameraProvider.h:113
visionx::StereoCalibrationProviderPropertyDefinitions::StereoCalibrationProviderPropertyDefinitions
StereoCalibrationProviderPropertyDefinitions(std::string prefix)
Definition: StereoCameraProvider.h:41
visionx::StereoCameraProvider::getStereoCalibration
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
Definition: StereoCameraProvider.cpp:74
visionx::StereoCameraProvider::getImagesAreUndistorted
bool getImagesAreUndistorted(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
Definition: StereoCameraProvider.h:84
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
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:34
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:62