-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathUtil.h
More file actions
76 lines (51 loc) · 1.83 KB
/
Util.h
File metadata and controls
76 lines (51 loc) · 1.83 KB
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
//
// Created by zhuoqunc on 12/02/17.
//
#pragma once
#include "opencv2/opencv.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include "brief.h"
#include "filter.h"
#include "keyPointDetector.h"
#include "stitcher.h"
class Util
{
public:
Util();
virtual ~Util();
double get_time_elapsed(clock_t& start);
bool readImage(std::string im_name, cv::Mat& im);
void cleanPointerArray(float** arr, int num_levels);
int readTestPattern(cv::Point*& compareA, cv::Point*& compareB,
std::string test_pattern_filename);
void plotMatches(std::string im1_name, std::string im2_name,
std::vector<cv::Point>& pts1, std::vector<cv::Point>& pts2,
MatchResult& match);
cv::Mat computeHomography(std::string im1_name, std::string im2_name,
BriefResult brief_result1, BriefResult brief_result2);
BriefResult BriefLite(std::string im_name, cv::Point* compareA,
cv::Point* compareB);
void stitch(std::vector<cv::Mat> images, std::vector<cv::Mat> homographies, int width, int height);
void printImage(float* img, int h, int w) const;
void displayImg(cv::Mat& im) const;
void printTiming() const;
private:
clock_t gaussian_pyramid_start;
double gaussian_pyramid_elapsed;
clock_t dog_pyramid_start;
double dog_pyramid_elapsed;
clock_t keypoint_detection_start;
double keypoint_detection_elapsed;
clock_t compute_brief_start;
double compute_brief_elapsed;
clock_t find_match_start;
double find_match_elapsed;
clock_t compute_homography_start;
double compute_homography_elapsed;
clock_t stitching_start;
double stitching_elapsed;
};