aboutsummaryrefslogtreecommitdiff
path: root/samples/ObjectDetection/src/DetectedObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'samples/ObjectDetection/src/DetectedObject.cpp')
-rw-r--r--samples/ObjectDetection/src/DetectedObject.cpp65
1 files changed, 65 insertions, 0 deletions
diff --git a/samples/ObjectDetection/src/DetectedObject.cpp b/samples/ObjectDetection/src/DetectedObject.cpp
new file mode 100644
index 0000000000..95f99a07d6
--- /dev/null
+++ b/samples/ObjectDetection/src/DetectedObject.cpp
@@ -0,0 +1,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 \ No newline at end of file