-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathCommFunc.h
76 lines (73 loc) · 2.43 KB
/
CommFunc.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
///////////////////////////////////////////////////////
// File: CommonFunc
// Desc: Common function + Hearder files
//
// Author: Zhang Kang
// Date: 2013/09/06
///////////////////////////////////////////////////////
#pragma once
#define DOUBLE_MAX 1e10
// #define COMPUTE_RIGHT
#include<opencv2/opencv.hpp>
#include<string>
#include<iostream>
#include<bitset>
using namespace std;
using namespace cv;
//
// Opencv Lib 2.4.6
//
#ifdef _DEBUG
#pragma comment( lib, "opencv_calib3d246d.lib" )
#pragma comment( lib, "opencv_contrib246d.lib" )
#pragma comment( lib, "opencv_core246d.lib" )
#pragma comment( lib, "opencv_features2d246d.lib" )
#pragma comment( lib, "opencv_flann246d.lib" )
#pragma comment( lib, "opencv_gpu246d.lib" )
#pragma comment( lib, "opencv_highgui246d.lib" )
#pragma comment( lib, "opencv_imgproc246d.lib" )
#pragma comment( lib, "opencv_legacy246d.lib" )
#pragma comment( lib, "opencv_ml246d.lib" )
#pragma comment( lib, "opencv_nonfree246d.lib" )
#pragma comment( lib, "opencv_objdetect246d.lib" )
#pragma comment( lib, "opencv_photo246d.lib" )
#pragma comment( lib, "opencv_stitching246d.lib" )
#pragma comment( lib, "opencv_superres246d.lib" )
#pragma comment( lib, "opencv_ts246d.lib" )
#pragma comment( lib, "opencv_video246d.lib" )
#pragma comment( lib, "opencv_videostab246d.lib" )
#else
#pragma comment( lib, "opencv_calib3d246.lib" )
#pragma comment( lib, "opencv_contrib246.lib" )
#pragma comment( lib, "opencv_core246.lib" )
#pragma comment( lib, "opencv_features2d246.lib" )
#pragma comment( lib, "opencv_flann246.lib" )
#pragma comment( lib, "opencv_gpu246.lib" )
#pragma comment( lib, "opencv_highgui246.lib" )
#pragma comment( lib, "opencv_imgproc246.lib" )
#pragma comment( lib, "opencv_legacy246.lib" )
#pragma comment( lib, "opencv_ml246.lib" )
#pragma comment( lib, "opencv_nonfree246.lib" )
#pragma comment( lib, "opencv_objdetect246.lib" )
#pragma comment( lib, "opencv_photo246.lib" )
#pragma comment( lib, "opencv_stitching246.lib" )
#pragma comment( lib, "opencv_superres246.lib" )
#pragma comment( lib, "opencv_ts246.lib" )
#pragma comment( lib, "opencv_video246.lib" )
#pragma comment( lib, "opencv_videostab246.lib" )
#endif
// output matrix
template<class T>
void PrintMat( const Mat& mat )
{
int rows = mat.rows;
int cols = mat.cols;
printf( "\n%d x %d Matrix\n", rows, cols );
for( int r = 0; r < rows; r ++ ) {
for( int c = 0; c < cols; c ++ ) {
cout << mat.at<T>( r, c ) << "\t";
}
printf( "\n" );
}
printf( "\n" );
}