-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolys.h
More file actions
31 lines (24 loc) · 806 Bytes
/
Copy pathpolys.h
File metadata and controls
31 lines (24 loc) · 806 Bytes
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
#include <deque>
#include <algorithm>
#include <vector>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tuple.hpp>
namespace bg = boost::geometry;
typedef bg::model::point<float, 2, bg::cs::cartesian> Point;
typedef bg::model::polygon<Point, false, false> Polygon; // ccw, open polygon
struct poly_with_score{
poly_with_score(){
}
poly_with_score(Polygon poly_, float score_){
poly = poly_;
score = score_;
}
Polygon poly;
float score;
};
std::vector<poly_with_score> nonmax_suppresion(const float* data,
int num_box, float nms_th);
float poly_iou(Polygon a, Polygon b);
bool should_merge(poly_with_score a, poly_with_score b, float threshold);