StereoCameraProvider.cpp
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
26
28
29#include <iostream>
30#include <string>
31#include <vector>
32
33// VisionXTools
36
37// IVT
39
42#include <Calibration/Calibration.h>
43
44void
46{
48
49 using namespace armarx;
50 using namespace visionx;
51 using namespace visionx::tools;
52
53 // verify number of cameras
54
55 if (ieee1394Capturer->GetNumberOfCameras() != 2)
56 {
58 ieee1394Capturer->GetNumberOfCameras());
59 }
60
61 std::string calibrationFileName = getProperty<std::string>("CalibrationFile").getValue();
62 if (!armarx::ArmarXDataPath::getAbsolutePath(calibrationFileName, calibrationFileName))
63 {
65 calibrationFileName.c_str());
66 }
67 bool transformLeftCameraToIdentity = getProperty<bool>("LeftCameraAsIdentity").getValue();
68
69 if (!ivtStereoCalibration.LoadCameraParameters(calibrationFileName.c_str(),
70 transformLeftCameraToIdentity))
71 {
73 calibrationFileName.c_str());
74 }
75
76 stereoCalibration = visionx::tools::convert(ivtStereoCalibration);
77}
78
79visionx::StereoCalibration
81{
82 return stereoCalibration;
83}
84
85
86std::string
88{
89 return "StereoCameraProvider";
90}
91
92std::string
97
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Definition Decoupled.h:29
constexpr T c
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
Property< PropertyType > getProperty(const std::string &name)
CLinux1394CaptureThreaded2 * ieee1394Capturer
IEEE1394 Capture.
Stereo camera provider is based on IEEE1394 image provider with the restriction that the number of sp...
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
std::string getDefaultName() const override
Retrieve default name of component.
This file offers overloads of toIce() and fromIce() functions for STL container types.
CByteImage::ImageType convert(const ImageType visionxImageType)
Converts a VisionX image type into an image type of IVT's ByteImage.
ArmarX headers.