-
Notifications
You must be signed in to change notification settings - Fork 0
/
reporting.h
144 lines (123 loc) · 5.2 KB
/
reporting.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef CAMERA_FUSION_REPORTING_H
#define CAMERA_FUSION_REPORTING_H
#include <iostream>
#include "dataStructures.h"
using namespace std;
// Performance Evaluation 1
// Count the number of keypoints on the preceding vehicle for all 10 images and take note of the distribution
// of their neighborhood size. Do this for all the detectors you have implemented.
struct KeypointCountResult
{
KeypointCountResult()= default;
string imageName = "No image name specified";
unsigned int totalKeypoints = 0;
double descriptorMatchingTime = 0.0;
unsigned int precedingVehicleKeypoints = 0;
};
// Performance Evaluation 2
// Count the number of matched keypoints for all 10 images using all possible
// combinations of detectors and descriptors.
struct KeypointMatchResult
{
KeypointMatchResult()= default;
std::pair<unsigned int, unsigned int> matchedImagePair = {0,0};
unsigned int totalMatches = 0;
unsigned int knnMatches = 0;
unsigned int removed = 0;
double percentageRemoved = 0.0;
};
struct ExperimentResult
{
ExperimentResult()= default;
KeypointCountResult keypointCount;
KeypointMatchResult keypointMatch;
// Performance Evaluation 3
// Log the time it takes for keypoint detection and descriptor extraction.
double descriptorExtractionTime = 0.0;
};
struct Experiment
{
Experiment()= default;
std::vector<ExperimentResult> result;
Hyperparameters hyperparameters;
// Visualization and image saving options
bool displayImageWindows = false; // visualize matches between current and previous image?
bool isFocusOnPrecedingVehicleOnly = true; // only keep keypoints on the preceding vehicle?
bool saveKeypointDetectionImagesToFile = false; // save keypoint detection images to file
bool saveKeypointMatchImagesToFile = false; // save keypoint matching images to file
};
struct TotalKeypoints
{
TotalKeypoints()= default;
unsigned int SHI_TOMASI_totalKeypointsInImage = 0;
unsigned int HARRIS_totalKeypointsInImage = 0;
unsigned int FAST_totalKeypointsInImage = 0;
unsigned int BRISK_totalKeypointsInImage = 0;
unsigned int ORB_totalKeypointsInImage = 0;
unsigned int AKAZE_totalKeypointsInImage = 0;
unsigned int SIFT_totalKeypointsInImage = 0;
unsigned int SHI_TOMASI_totalKeypointsOnPrecedingVehicle = 0;
unsigned int HARRIS_totalKeypointsOnPrecedingVehicle = 0;
unsigned int FAST_totalKeypointsOnPrecedingVehicle = 0;
unsigned int BRISK_totalKeypointsOnPrecedingVehicle = 0;
unsigned int ORB_totalKeypointsOnPrecedingVehicle = 0;
unsigned int AKAZE_totalKeypointsOnPrecedingVehicle = 0;
unsigned int SIFT_totalKeypointsOnPrecedingVehicle = 0;
double SHI_TOMASI_percentageRepresentedByVehicleKeypoints = 0.0;
double HARRIS_percentageRepresentedByVehicleKeypoints = 0.0;
double FAST_percentageRepresentedByVehicleKeypoints = 0.0;
double BRISK_percentageRepresentedByVehicleKeypoints = 0.0;
double ORB_percentageRepresentedByVehicleKeypoints = 0.0;
double AKAZE_percentageRepresentedByVehicleKeypoints = 0.0;
double SIFT_percentageRepresentedByVehicleKeypoints = 0.0;
};
struct TotalKeypointMatches
{
TotalKeypointMatches()= default;
string detector;
unsigned int BRISK = 0;
unsigned int BRIEF = 0;
unsigned int ORB = 0;
unsigned int FREAK = 0;
unsigned int AKAZE = 0;
unsigned int SIFT = 0;
};
struct AverageProcessingTimes
{
AverageProcessingTimes()= default;
string detector;
double detectionTimeBRISK = 0.0;
double detectionTimeBRIEF = 0.0;
double detectionTimeORB = 0.0;
double detectionTimeFREAK = 0.0;
double detectionTimeAKAZE = 0.0;
double detectionTimeSIFT = 0.0;
double extractionTimeBRISK = 0.0;
double extractionTimeBRIEF = 0.0;
double extractionTimeORB = 0.0;
double extractionTimeFREAK = 0.0;
double extractionTimeAKAZE = 0.0;
double extractionTimeSIFT = 0.0;
};
struct PerformanceEvaluationSummary
{
PerformanceEvaluationSummary()= default;
TotalKeypoints keypoints;
std::vector<TotalKeypointMatches> keypointMatches;
std::vector<AverageProcessingTimes> processingTimes;
};
void ProcessExperimentResults(Experiment &experiment, PerformanceEvaluationSummary &summary);
void PerformanceEvaluation1(Experiment &experiment, TotalKeypoints &keypointsData, const string &separator);
void PerformanceEvaluation2(Experiment &experiment,
std::vector<TotalKeypointMatches> &keypointsMatches,
const string &separator);
void PerformanceEvaluation3(Experiment &experiment,
std::vector<AverageProcessingTimes> &processingTimes,
const string &separator);
string DetectorNameAsString(const KeypointDetector detector);
void ReportKeypointDetectionSummary(const TotalKeypoints &keypointsData);
void ReportKeypointMatchingSummary(const std::vector<TotalKeypointMatches> &keypointMatches);
void ReportProcessingTimesSummary(const std::vector<AverageProcessingTimes> &processingTimes);
void ReportKeypointDetectionImages();
void ReportKeypointMatchImages(const std::vector<KeypointDetector> &detectors, const std::vector<string> &descriptors);
#endif //CAMERA_FUSION_REPORTING_H