forked from aclapes/segmenthreetion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Validation.h
59 lines (36 loc) · 1.4 KB
/
Validation.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
//
// Validation.h
// segmenthreetion
//
// Created by Cristina Palmero Cantariño on 21/03/14.
//
//
#ifndef __segmenthreetion__Validation__
#define __segmenthreetion__Validation__
#include <iostream>
#include <vector>
#include <set>
#include <numeric>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "ModalityData.hpp"
#include "ModalityGridData.hpp"
using namespace std;
class Validation {
public:
Validation();
Validation(vector<int> dcRange);
void setDontCareRange(vector<int> dcRange);
vector<int>& getDontCareRange();
void getOverlap(ModalityData& md, cv::Mat& overlapIDs);
void getOverlap(vector<cv::Mat>& predictedMasks, vector<cv::Mat>& gtMasks, vector<int>& dcRange, cv::Mat& overlapIDs);
void getMeanOverlap(vector<cv::Mat> partitionedOverlapIDs, cv::Mat& partitionedMeanOverlap);
void createOverlapPartitions(cv::Mat& partitions, cv::Mat& overlapIDs, vector<cv::Mat>& partitionedOverlapIDs);
void save(vector<cv::Mat> overlapIDs, cv::Mat meanOverlap, string filename);
private:
vector<int> m_DontCareRange;
float getMaskOverlap(cv::Mat& predictedMask, cv::Mat& gtMask, cv::Mat& dontCareRegion);
void createDontCareRegion(cv::Mat& inputMask, cv::Mat& outputMask, int dcRange);
};
#endif /* defined(__segmenthreetion__Validation__) */