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
27#include <iostream>
28#include <string>
29#include <vector>
30
31// VisionXTools
33
34// IVT
36
39#include <Calibration/Calibration.h>
40
41void
43{
45
46 using namespace armarx;
47 using namespace visionx;
48 using namespace visionx::tools;
49
50 // verify number of cameras
51
52 if (ieee1394Capturer->GetNumberOfCameras() != 2)
53 {
55 ieee1394Capturer->GetNumberOfCameras());
56 }
57
58 std::string calibrationFileName = getProperty<std::string>("CalibrationFile").getValue();
59 if (!armarx::ArmarXDataPath::getAbsolutePath(calibrationFileName, calibrationFileName))
60 {
62 calibrationFileName.c_str());
63 }
64 bool transformLeftCameraToIdentity = getProperty<bool>("LeftCameraAsIdentity").getValue();
65
66 if (!ivtStereoCalibration.LoadCameraParameters(calibrationFileName.c_str(),
67 transformLeftCameraToIdentity))
68 {
70 calibrationFileName.c_str());
71 }
72
73 stereoCalibration = visionx::tools::convert(ivtStereoCalibration);
74}
75
76visionx::StereoCalibration
78{
79 return stereoCalibration;
80}
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.
visionx::StereoCalibration getStereoCalibration(const Ice::Current &c=Ice::emptyCurrent) override
Part of visionx::StereoCalibrationProvider interface.
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.