公告板
版本库
filestore
活动
搜索
登录
孙天宇
/
baseDetector
派生自
Algorithm/baseDetector
概况
提交次数
目录
文档
派生
对比
blame
|
历史
|
原始文档
add yolov4
Scheaven
2021-01-05
6ae75cc17b2952c63a79ff2c86da841f0dbbf3c6
[~suntianyu/baseDetector.git]
/
lib
/
utils
/
result_util.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
// Created by Scheaven on 2020/4/20.
//
#include "result_util.h"
float cul_overlap_area(int Ax, int Ay, int Bx, int By, int Cx, int Cy, int Dx, int Dy)
{
long x1 = Ax>Cx?Ax:Cx;
long y1 = Ay>Cy?Ay:Cy;
long x2 = Bx<Dx?Bx:Dx;
long y2 = By<Dy?By:Dy;
float w = 0.0>(x2-x1)?0.0:(x2-x1);
float h = 0.0>(y2-y1)?0.0:(y2-y1);
float inter_area = w*h;
float lap_rate = inter_area/((Dx-Cx)*(Dy-Cy));
return lap_rate;
}