aboutsummaryrefslogtreecommitdiff
path: root/samples/ObjectDetection/src/DetectedObject.cpp
blob: 95f99a07d60889a8b2a1b29cd7b83e5b671c91b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "DetectedObject.hpp"

namespace od
{

DetectedObject::DetectedObject() :
        DetectedObject(0u, "", BoundingBox(), 0u)
{}

DetectedObject::DetectedObject(
        unsigned int id,
        std::string label,
        const BoundingBox &boundingBox,
        float score) :
        m_Id(id),
        m_Label(std::move(label)),
        m_BoundingBox(boundingBox),
        m_Score(score)
{}

unsigned int DetectedObject::GetId() const
{
    return m_Id;
}

const std::string &DetectedObject::GetLabel() const
{
    return m_Label;
}

const BoundingBox &DetectedObject::GetBoundingBox() const
{
    return m_BoundingBox;
}

float DetectedObject::GetScore() const
{
    return m_Score;
}

void DetectedObject::SetId(unsigned int id)
{
    m_Id = id;
}

void DetectedObject::SetLabel(const std::string &label)
{
    m_Label = label;
}

void DetectedObject::SetBoundingBox(const BoundingBox &boundingBox)
{
    m_BoundingBox = boundingBox;
}

void DetectedObject::SetScore(float score)
{
    m_Score = score;
}
}// namespace od