RobotsIO
Loading...
Searching...
No Matches
DatasetDetection.cpp
1/*
2 * Copyright (C) 2020 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/Utils/DatasetDetection.h>
9
10using namespace Eigen;
11using namespace RobotsIO::Utils;
12
13
14DatasetDetection::DatasetDetection(const std::string& file_path) :
15 DatasetDataStream(file_path, 0, 0, 4)
16{}
17
18
19DatasetDetection::~DatasetDetection()
20{}
21
22
23bool DatasetDetection::freeze(const bool blocking)
24{
25 if (!DatasetDataStream::freeze())
26 return false;
27
28 VectorXd bounding_box_data = data();
29
30 detection_ = cv::Rect(bounding_box_data(0), bounding_box_data(1), bounding_box_data(2), bounding_box_data(3));
31
32 return true;
33}
34
35
36cv::Rect DatasetDetection::detection() const
37{
38 return detection_;
39}