Hugin trunk 0.1
Loading...
Searching...
No Matches
CalculateCPStatistics.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
26#ifndef _BASICALGORITHMS_CALCULATECPSTSTISTICS_H
27#define _BASICALGORITHMS_CALCULATECPSTSTISTICS_H
28
29#include <hugin_shared.h>
31
32
33
34namespace HuginBase {
35
36
39{
40
41 protected:
44 : PanoramaAlgorithm(panorama), o_imageNumber(imgNr), o_resultMin(0), o_resultMax(0), o_resultMean(0), o_resultVar(0)
45 {};
46
47 public:
50
51
52 public:
54 virtual bool modifiesPanoramaData() const
55 { return false; }
56
58 virtual bool runAlgorithm() =0;
59
60
61 public:
63 virtual double getResultMin()
64 {
65 // [TODO] if(!hasRunSuccessfully()) DEBUG;
66 return o_resultMin;
67 }
68
70 virtual double getResultMax()
71 {
72 // [TODO] if(!hasRunSuccessfully()) DEBUG;
73 return o_resultMax;
74 }
75
77 virtual double getResultMean()
78 {
79 // [TODO] if(!hasRunSuccessfully()) DEBUG;
80 return o_resultMean;
81 }
82
84 virtual double getResultVariance()
85 {
86 // [TODO] if(!hasRunSuccessfully()) DEBUG;
87 return o_resultVar;
88 }
89
90 protected:
92 double o_resultMin, o_resultMax, o_resultMean, o_resultVar;
93};
94
95
96
97
99{
100
101 public:
107 :CalculateCPStatistics(panorama, -1), m_onlyActiveImages(onlyActive), m_ignoreLineCps(ignoreLineCps)
108 {};
109
112
113
114 public:
116 static void calcCtrlPntsErrorStats(const PanoramaData& pano,
117 double & min, double & max, double & mean,
118 double & var,
119 const int& imgNr=-1,
120 const bool onlyActive=false,
121 const bool ignoreLineCp=false);
122
123
124 public:
126 virtual bool runAlgorithm()
127 {
128 calcCtrlPntsErrorStats(o_panorama,
129 o_resultMin, o_resultMax, o_resultMean,
130 o_resultVar,
131 o_imageNumber, m_onlyActiveImages, m_ignoreLineCps);
132 return true; // let's hope so.
133 }
134 private:
135 bool m_onlyActiveImages = false;
136 bool m_ignoreLineCps = false;
137};
138
139
141{
142
143 public:
146 : CalculateCPStatistics(panorama, imgNr), o_resultQ10(0), o_resultQ90(0)
147 {};
148
151
152
153 public:
155 static void calcCtrlPntsRadiStats(const PanoramaData& pano,
156 double & min, double & max, double & mean, double & var,
157 double & q10, double & q90,
158 const int& imgNr=-1);
159
161 virtual double getResultPercentile10()
162 {
163 // [TODO] if(!hasRunSuccessfully()) DEBUG;
164 return o_resultQ10;
165 }
166
168 virtual double getResultPercentile90()
169 {
170 // [TODO] if(!hasRunSuccessfully()) DEBUG;
171 return o_resultQ90;
172 }
173
174
175 public:
177 virtual bool runAlgorithm()
178 {
179 calcCtrlPntsRadiStats(o_panorama,
180 o_resultMin, o_resultMax, o_resultMean, o_resultVar,
181 o_resultQ10, o_resultQ90,
182 o_imageNumber);
183 return true; // let's hope so.
184 }
185
186
187 protected:
188 double o_resultQ10, o_resultQ90;
189
190};
191
192} //namespace
193#endif //_H
CalculateCPStatisticsError(PanoramaData &panorama, const bool onlyActive, const bool ignoreLineCps=false)
CalculateCPStatisticsError(PanoramaData &panorama, const int &imgNr=-1)
virtual bool runAlgorithm()
implementation of the algorithm.
virtual bool runAlgorithm()
implementation of the algorithm.
CalculateCPStatisticsRadial(PanoramaData &panorama, const int &imgNr=-1)
just some common implementation; probably not so useful
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
virtual bool runAlgorithm()=0
implementation of the algorithm.
CalculateCPStatistics(PanoramaData &panorama, const int &imgNr=-1)
Model for a panorama.
#define IMPEX
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
Definition wxcms.cpp:39
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41