RobotsIO
Loading...
Searching...
No Matches
DatasetCamera.cpp
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#include <RobotsIO/Camera/DatasetCamera.h>
9
10using namespace RobotsIO::Camera;
11
12
13DatasetCamera::DatasetCamera
14(
15 const std::string& data_path,
16 const std::string& data_prefix,
17 const std::string& rgb_prefix,
18 const std::string& depth_prefix,
19 const std::string& data_format,
20 const std::string& rgb_format,
21 const std::string& depth_format,
22 const std::size_t& heading_zeros,
23 const std::size_t& index_offset,
24 const std::size_t& width,
25 const double& height,
26 const double& fx,
27 const double& cx,
28 const double& fy,
29 const double& cy
30) :
31 Camera(data_path, width, height, fx, cx, fy, cy)
32{
33 /* Set dataset parameters. */
34 dataset_parameters_.data_prefix(data_prefix);
35 dataset_parameters_.rgb_prefix(rgb_prefix);
36 dataset_parameters_.depth_prefix(depth_prefix);
37 dataset_parameters_.data_format(data_format);
38 dataset_parameters_.rgb_format(rgb_format);
39 dataset_parameters_.depth_format(depth_format);
40 dataset_parameters_.heading_zeros(heading_zeros);
41 dataset_parameters_.index_offset(index_offset);
42
43 Camera::initialize();
44}
45
46
47DatasetCamera::~DatasetCamera()
48{ }
49
50
51std::pair<bool, Eigen::MatrixXf> DatasetCamera::depth(const bool& blocking)
52{
53 return depth_offline();
54}
55
56
57std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>> DatasetCamera::pose(const bool& blocking)
58{
59 return pose_offline();
60}
61
62
63std::pair<bool, cv::Mat> DatasetCamera::rgb(const bool& blocking)
64{
65 return rgb_offline();
66}
67
68
69std::pair<bool, double> DatasetCamera::time_stamp_rgb() const
70{
71 return time_stamp_rgb_offline();
72}
73
74
75std::pair<bool, double> DatasetCamera::time_stamp_depth() const
76{
77 return time_stamp_depth_offline();
78}
virtual std::pair< bool, Eigen::MatrixXf > depth_offline()
Definition: Camera.cpp:392
virtual std::pair< bool, Eigen::MatrixXf > depth(const bool &blocking) override