-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathUtilities.hpp
35 lines (26 loc) · 1.06 KB
/
Utilities.hpp
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
// ---------------------------------------------------------------------
// Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
// SPDX-License-Identifier: BSD-3-Clause
// ---------------------------------------------------------------------
#pragma once
#include <opencv2/core.hpp>
#include <string>
namespace Utils
{
class BoxCornerEncoding
{
public:
int x1;
int y1;
int x2;
int y2;
float score;
std::string obj_label;
BoxCornerEncoding(int a, int b, int c, int d, float sc, std::string name = "default");
};
std::vector<float>
LoadImageFile(const std::string& image_path, uint32_t input_image_height, uint32_t input_image_width);
float ComputeIntersectionOverUnion(const BoxCornerEncoding& box_i, const BoxCornerEncoding& box_j);
std::vector<BoxCornerEncoding> NonMaxSuppression(std::vector<BoxCornerEncoding> boxes, const float iou_threshold);
void AddBoundingBoxAndLabel(cv::Mat& image, const BoxCornerEncoding& result, const float ratio_h, const float ratio_w);
} // namespace Utils