-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCvHelper.cpp
More file actions
51 lines (46 loc) · 865 Bytes
/
CvHelper.cpp
File metadata and controls
51 lines (46 loc) · 865 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* CvHelper.cpp
*
* Created on: May 12, 2015
* Author: tobias
*/
#include "util/CvHelper.h"
namespace BioTracker {
namespace Core {
namespace CvHelper {
std::string cvDataType2str(int type) {
const int depth = CV_MAT_DEPTH(type);
const int cn = CV_MAT_CN(type);
std::string result = "CV_";
switch (depth) {
case CV_8U:
result += "8U";
break;
case CV_8S:
result += "8S";
break;
case CV_16U:
result += "16U";
break;
case CV_16S:
result += "16S";
break;
case CV_32S:
result += "32S";
break;
case CV_32F:
result += "32F";
break;
case CV_64F:
result += "64F";
break;
default:
result += "UNKOWN";
break;
}
result += "C" + std::to_string(cn);
return result;
}
}
}
}