8#ifndef ROBOTSIO_ICUBCAMERADEPTH_H
9#define ROBOTSIO_ICUBCAMERADEPTH_H
11#include <RobotsIO/Camera/iCubCameraRelative.h>
15#include <opencv2/opencv.hpp>
21 class iCubCameraDepth;
30 iCubCameraDepth(
const std::string& robot_name,
const std::string& port_prefix,
const bool& use_calibration =
false,
const std::string& calibration_path =
"");
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 =
"");
46 std::pair<bool, Eigen::MatrixXf>
depth(
const bool& blocking)
override;
48 std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>> pose(
const bool& blocking)
override;
50 std::pair<bool, cv::Mat> rgb(
const bool& blocking)
override;
57 void configure_sgbm();
59 cv::Mat intrinsic_left_;
61 cv::Mat distortion_left_;
63 cv::Mat intrinsic_right_;
65 cv::Mat distortion_right_;
67 cv::Ptr<cv::StereoSGBM> sgbm_;
73 int uniqueness_ratio_ = 15;
75 int speckle_window_size_ = 50;
77 int speckle_range_ = 1;
79 int number_of_disparities_ = 96;
83 int min_disparity_ = 0;
85 int pre_filter_cap_ = 63;
87 int disp_12_max_diff_ = 0;
93 const std::string log_name_ =
"iCubCameraDepth";
std::pair< bool, Eigen::MatrixXd > deprojection_matrix() const override
std::pair< bool, Eigen::MatrixXf > depth(const bool &blocking) override