-
Notifications
You must be signed in to change notification settings - Fork 38
/
util.h
43 lines (38 loc) · 1.25 KB
/
util.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
#pragma once
#include <iostream>
#include <fstream>
#include <iomanip>
#include <Windows.h>
#include "cv.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace std;
using namespace cv;
namespace Utils
{
// ********** global variable list ********** //
static string baseDir = "C:/Users/Richard/Desktop/AutoMosaic/Source/Data/";
struct TreeNode
{
TreeNode(){};
TreeNode(int im, int re, int le)
{
imgNo = im;
refNo = re;
level = le;
};
int level; //! the level of node in the tree
int imgNo; //! node no.
int refNo; //! parent node no.
};
vector<string> get_filelist(string foldname);
Mat_<double> buildCostGraph(const Mat_<int> &similarMat);
bool loadMatchPts(int imgIndex1, int imgIndex2, vector<Point2d> &pointSet1, vector<Point2d> &pointSet2);
Point2d pointTransform(Mat_<double> homoMat, Point2d srcPt);
void pointTransform(Mat_<double> homoMat, Point2d srcPt, Point2d &dstPt);
void pointTransform(Mat_<double> homoMat, vector<Point2d> &pointSet);
double calPointDist(Point2d point1, Point2d point2);
double calVecDot(Point2d vec1, Point2d vec2);
//! convert gray image to pesudo-color image
Mat grayToPesudoColor(Mat grayMap);
}