iCub-main
Loading...
Searching...
No Matches
FisheyeCalibTool.h
Go to the documentation of this file.
1// Copyright (C) 2026 Istituto Italiano di Tecnologia (IIT)
2// All rights reserved.
3//
4// This software may be modified and distributed under the terms of the
5// BSD-3-Clause license. See the accompanying LICENSE file for details.
6
7#ifndef __FISHEYECALIBTOOL__
8#define __FISHEYECALIBTOOL__
9
10#include <string>
11
12#include <opencv2/core.hpp>
13
14#include <yarp/os/Searchable.h>
15#include <yarp/sig/Image.h>
16
17#include <iCub/ICalibTool.h>
18
20{
21private:
22 struct CameraCalibration
23 {
24 cv::Mat K;
25 cv::Mat D;
26 cv::Size calibrationSize;
27 };
28
29 CameraCalibration leftCamera;
30 CameraCalibration rightCamera;
31 cv::Mat rotation;
32 cv::Mat translation;
33 cv::Mat leftMap1;
34 cv::Mat leftMap2;
35 cv::Mat rightMap1;
36 cv::Mat rightMap2;
37 cv::Size previousImageSize;
38 std::string groupName;
39 bool needInitialization;
40 double balance;
41 double fovScale;
42 bool drawEpipolars;
43 int epipolarLineStep;
44
45 bool loadCameraCalibration(const yarp::os::Searchable& group,
46 CameraCalibration& camera,
47 const std::string& groupName);
48 bool loadStereoCalibration(const yarp::os::Searchable& config);
49 bool initializeMaps(const cv::Size& imageSize);
50 cv::Mat scaledCameraMatrix(const CameraCalibration& camera,
51 const cv::Size& imageSize) const;
52 void drawEpipolarLines(cv::Mat& image) const;
53
54public:
56 ~FisheyeCalibTool() = default;
57
58 bool open(yarp::os::Searchable& config) override;
59 bool close() override;
60 bool configure(yarp::os::Searchable& config) override;
61
62 void apply(const yarp::sig::ImageOf<yarp::sig::PixelRgb>& in,
63 yarp::sig::ImageOf<yarp::sig::PixelRgb>& out) override;
64};
65
66#endif
bool configure(yarp::os::Searchable &config) override
~FisheyeCalibTool()=default
bool open(yarp::os::Searchable &config) override
bool close() override
void apply(const yarp::sig::ImageOf< yarp::sig::PixelRgb > &in, yarp::sig::ImageOf< yarp::sig::PixelRgb > &out) override
Interface to calibrate and project input image based on camera's internal parameters and projection m...
Definition ICalibTool.h:19
out
Definition sine.m:8