-
Notifications
You must be signed in to change notification settings - Fork 2
/
Detection.h
39 lines (28 loc) · 1.41 KB
/
Detection.h
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
#ifndef DETECTION_H
#define DETECTION_H
#include "Common.h"
class Detection
{
public:
Detection();
//Detection(double x, double y, double resp, double width, double height);
Detection(cv::Rect rect, float resp);
void draw(cv::Mat &img) const;
double relativeOverlap(const Detection &other) const;
double area() const;
cv::Rect rect;
// double x, y; // Coordinates of the center of the detection
float response; // Response of the detector at (x, y) in the response image
// double width, height; // Width and height of the support of the feature vector
};
std::ostream &operator<<(std::ostream &s, const Detection &d);
void drawDetections(cv::Mat &img, const std::vector<Detection> &dets);
// Determine if each detection in found is a match or not. Returns label and response,
// both with the same number of elements as found. Each entry in the vector label is -1
// if detection is not matched and 1 otherwise. The response vector simply
// copies the response from each detection.
void computeLabels(const std::vector<Detection> >, const std::vector<Detection> &found,
std::vector<float> &label, std::vector<float> &response);
void computeLabels(const std::vector<std::vector<Detection> > >, const std::vector<std::vector<Detection> > &found,
std::vector<float> &label, std::vector<float> &response, int& nDets);
#endif // DETECTION_H