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
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#ifndef CALIBRATION_PROGRESS_HPP_
#define CALIBRATION_PROGRESS_HPP_
#include "libvideostitch/algorithm.hpp"
#include <mutex>
namespace VideoStitch {
namespace Calibration {
/**
* Simple helper class to ease the progress bar updating progress
* for the automatic calibration algorithm
*/
class VS_EXPORT CalibrationProgress {
public:
/**
@brief Constructor
@param progress Algorithm progress callback object
@param totalUnits number of units to report 100% progress
*/
CalibrationProgress(VideoStitch::Util::Algorithm::ProgressReporter* progress, const double totalUnits);
/**
@brief Copy constructor
@param other the source of copy
*/
CalibrationProgress(const CalibrationProgress& other);
/**
@brief Add a progress step
@param units number of progress done (respective to total units)
@param msg the description sent to the reporter
*/
Status add(double units, const std::string& msg = "Calibration");
/**
@brief Enables the progress reporting (enabled by default)
*/
void enable();
/**
@brief Disables the progress reporting (enabled by default)
*/
void disable();
private:
VideoStitch::Util::Algorithm::ProgressReporter* progress;
double progressPercentage;
double unitPercentage;
std::mutex progressLock;
bool enabled;
public:
const static double seek;
const static double kpDetect;
const static double kpMatch;
const static double fovIterate;
const static double deshuffle;
const static double filter;
const static double initGeometry;
const static double optim;
const static double optim_done;
};
} // namespace Calibration
} // namespace VideoStitch
#endif