RobotsIO
Loading...
Searching...
No Matches
iCubCameraDepth.h
1/*
2 * Copyright (C) 2019 Istituto Italiano di Tecnologia (IIT)
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
8#ifndef ROBOTSIO_ICUBCAMERADEPTH_H
9#define ROBOTSIO_ICUBCAMERADEPTH_H
10
11#include <RobotsIO/Camera/iCubCameraRelative.h>
12
13#include <Eigen/Dense>
14
15#include <opencv2/opencv.hpp>
16
17#include <string>
18
19namespace RobotsIO {
20 namespace Camera {
21 class iCubCameraDepth;
22 }
23}
24
25
27{
28public:
29
30 iCubCameraDepth(const std::string& robot_name, const std::string& port_prefix, const bool& use_calibration = false, const std::string& calibration_path = "");
31
32 iCubCameraDepth(const std::string& data_path_left, const std::string& data_path_right, const std::size_t& width, const std::size_t& height, const double& fx_l, const double& cx_l, const double& fy_l, const double& cy_l, const double& fx_r, const double& cx_r, const double& fy_r, const double& cy_r, const bool& load_encoders_data, const bool& use_calibration = false, const std::string& calibration_path = "");
33
35
40 std::pair<bool, Eigen::MatrixXd> deprojection_matrix() const override;
41
46 std::pair<bool, Eigen::MatrixXf> depth(const bool& blocking) override;
47
48 std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>> pose(const bool& blocking) override;
49
50 std::pair<bool, cv::Mat> rgb(const bool& blocking) override;
51
52private:
57 void configure_sgbm();
58
59 cv::Mat intrinsic_left_;
60
61 cv::Mat distortion_left_;
62
63 cv::Mat intrinsic_right_;
64
65 cv::Mat distortion_right_;
66
67 cv::Ptr<cv::StereoSGBM> sgbm_;
68
73 int uniqueness_ratio_ = 15;
74
75 int speckle_window_size_ = 50;
76
77 int speckle_range_ = 1;
78
79 int number_of_disparities_ = 96;
80
81 int block_size_ = 7;
82
83 int min_disparity_ = 0;
84
85 int pre_filter_cap_ = 63;
86
87 int disp_12_max_diff_ = 0;
88
93 const std::string log_name_ = "iCubCameraDepth";
94};
95
96#endif /* ROBOTSIO_ICUBCAMERADEPTH_H */
std::pair< bool, Eigen::MatrixXd > deprojection_matrix() const override
std::pair< bool, Eigen::MatrixXf > depth(const bool &blocking) override