9#include "BundleResults.h"
17#include <QXmlStreamWriter>
18#include <QXmlStreamReader>
20#include <boost/lexical_cast.hpp>
21#include <boost/numeric/ublas/io.hpp>
22#include <boost/numeric/ublas/matrix_sparse.hpp>
23#include <boost/numeric/ublas/vector_proxy.hpp>
26#include "ControlMeasure.h"
27#include "ControlPoint.h"
28#include "CorrelationMatrix.h"
32#include "MaximumLikelihoodWFunctions.h"
34#include "PvlKeyword.h"
36#include "SerialNumberList.h"
37#include "StatCumProbDistDynCalc.h"
38#include "Statistics.h"
42using namespace boost::numeric::ublas;
80 readBundleResults(xmlReader);
83 void BundleResults::readBundleResults(QXmlStreamReader *xmlReader) {
84 Q_ASSERT(xmlReader->name() ==
"bundleResults");
85 while(xmlReader->readNextStartElement()) {
86 if (xmlReader->qualifiedName() ==
"correlationMatrix") {
87 readCorrelationMatrix(xmlReader);
89 else if (xmlReader->qualifiedName() ==
"generalStatisticsValues") {
90 readGenStatsValues(xmlReader);
92 else if (xmlReader->qualifiedName() ==
"rms") {
95 else if (xmlReader->qualifiedName() ==
"elapsedTime") {
97 QStringRef time = xmlReader->attributes().value(
"time");
98 if (!time.isEmpty()) {
102 QStringRef errorProp = xmlReader->attributes().value(
"errorProp");
103 if (!errorProp.isEmpty()) {
106 xmlReader->skipCurrentElement();
108 else if (xmlReader->qualifiedName() ==
"minMaxSigmas") {
109 readMinMaxSigmas(xmlReader);
111 else if (xmlReader->qualifiedName() ==
"maximumLikelihoodEstimation") {
112 readMaxLikelihoodEstimation(xmlReader);
124 xmlReader->skipCurrentElement();
129 void BundleResults::readCorrelationMatrix(QXmlStreamReader *xmlReader) {
130 Q_ASSERT(xmlReader->name() ==
"correlationMatrix");
134 QString correlationFileName = *(xmlReader->attributes().value(
"correlationFileName").string());
135 if (!correlationFileName.isEmpty()) {
136 FileName correlationFile(correlationFileName);
140 QString covarianceFileName = *(xmlReader->attributes().value(
"covarianceFileName").string());
141 if (!covarianceFileName.isEmpty()) {
142 FileName covarianceFile(covarianceFileName);
145 while (xmlReader->readNextStartElement()) {
146 if (xmlReader->qualifiedName() ==
"image") {
147 QString correlationMatrixImageId = *(xmlReader->attributes().value(
"id").string());
148 if (!correlationMatrixImageId.isEmpty()) {
149 m_xmlHandlerCorrelationImageId = correlationMatrixImageId;
153 xmlReader->skipCurrentElement();
158 void BundleResults::readGenStatsValues(QXmlStreamReader *xmlReader) {
159 Q_ASSERT(xmlReader->name() ==
"generalStatisticsValues");
160 while (xmlReader->readNextStartElement()) {
161 if (xmlReader->qualifiedName() ==
"numberFixedPoints") {
164 else if (xmlReader->qualifiedName() ==
"numberIgnoredPoints") {
167 else if (xmlReader->qualifiedName() ==
"numberHeldImages") {
170 else if (xmlReader->qualifiedName() ==
"rejectionLimit") {
173 else if (xmlReader->qualifiedName() ==
"numberRejectedObservations") {
176 else if (xmlReader->qualifiedName() ==
"numberLidarRangeConstraintEquations") {
179 else if (xmlReader->qualifiedName() ==
"numberObservations") {
182 else if (xmlReader->qualifiedName() ==
"numberImageObservations") {
185 else if (xmlReader->qualifiedName() ==
"numberLidarImageObservations") {
188 else if (xmlReader->qualifiedName() ==
"numberImageParameters") {
191 else if (xmlReader->qualifiedName() ==
"numberConstrainedPointParameters") {
193 xmlReader->readElementText().toInt();
195 else if (xmlReader->qualifiedName() ==
"numberConstrainedImageParameters") {
197 xmlReader->readElementText().toInt();
199 else if (xmlReader->qualifiedName() ==
"numberConstrainedTargetParameters") {
201 xmlReader->readElementText().toInt();
203 else if (xmlReader->qualifiedName() ==
"numberUnknownParameters") {
206 else if (xmlReader->qualifiedName() ==
"degreesOfFreedom") {
209 else if (xmlReader->qualifiedName() ==
"sigma0") {
210 m_sigma0 = xmlReader->readElementText().toDouble();
212 else if (xmlReader->qualifiedName() ==
"converged") {
213 m_converged =
toBool(xmlReader->readElementText());
215 else if (xmlReader->qualifiedName() ==
"iterations") {
219 xmlReader->skipCurrentElement();
224 void BundleResults::readRms(QXmlStreamReader *xmlReader) {
225 Q_ASSERT(xmlReader->name() ==
"rms");
226 while (xmlReader->readNextStartElement()) {
227 if (xmlReader->qualifiedName() ==
"residuals") {
228 QStringRef rx = xmlReader->attributes().value(
"x");
233 QStringRef ry = xmlReader->attributes().value(
"y");
238 QStringRef rxy = xmlReader->attributes().value(
"xy");
239 if (!rxy.isEmpty()) {
242 xmlReader->skipCurrentElement();
244 else if (xmlReader->qualifiedName() ==
"sigmas")
246 QStringRef lat = xmlReader->attributes().value(
"lat");
251 QStringRef lon = xmlReader->attributes().value(
"lon");
256 QStringRef rad = xmlReader->attributes().value(
"rad");
261 QStringRef x = xmlReader->attributes().value(
"x");
266 QStringRef y = xmlReader->attributes().value(
"y");
271 QStringRef z = xmlReader->attributes().value(
"z");
275 xmlReader->skipCurrentElement();
277 else if (xmlReader->qualifiedName() ==
"imageResidualsLists") {
278 readImageResidualsLists(xmlReader);
280 else if (xmlReader->qualifiedName() ==
"imageSigmasLists") {
281 readSigmasLists(xmlReader);
284 xmlReader->skipCurrentElement();
289 void BundleResults::readImageResidualsLists(QXmlStreamReader *xmlReader) {
290 Q_ASSERT(xmlReader->name() ==
"imageResidualsLists");
291 while (xmlReader->readNextStartElement()) {
292 if (xmlReader->qualifiedName() ==
"residualsList") {
295 else if (xmlReader->qualifiedName() ==
"sampleList") {
298 else if (xmlReader->qualifiedName() ==
"lineList") {
301 else if (xmlReader->qualifiedName() ==
"lidarResidualsList") {
304 else if (xmlReader->qualifiedName() ==
"lidarSampleList") {
307 else if (xmlReader->qualifiedName() ==
"lidarLineList") {
311 xmlReader->skipCurrentElement();
316 void BundleResults::readSigmasLists(QXmlStreamReader *xmlReader) {
317 Q_ASSERT(xmlReader->name() ==
"imageSigmasLists");
318 while (xmlReader->readNextStartElement()) {
319 if (xmlReader->qualifiedName() ==
"xSigmas") {
320 readStatsToVector(m_rmsImageXSigmas, xmlReader);
322 else if (xmlReader->qualifiedName() ==
"ySigmas") {
325 else if (xmlReader->qualifiedName() ==
"zSigmas") {
328 else if (xmlReader->qualifiedName() ==
"raSigmas") {
331 else if (xmlReader->qualifiedName() ==
"decSigmas") {
334 else if (xmlReader->qualifiedName() ==
"twistSigmas") {
338 xmlReader->skipCurrentElement();
343 void BundleResults::readStatsToList(QList<Statistics> &list, QXmlStreamReader *xmlReader) {
344 Q_ASSERT(xmlReader->attributes().hasAttribute(
"listSize"));
345 int listSize = xmlReader->attributes().value(
"listSize").toInt();
346 for (
int i = 0; i < listSize; i++) {
347 xmlReader->readNextStartElement();
348 Q_ASSERT(xmlReader->name() ==
"statisticsItem");
349 xmlReader->readNextStartElement();
350 Q_ASSERT(xmlReader->name() ==
"statistics");
352 xmlReader->readNextStartElement();
354 xmlReader->readNextStartElement();
357 void BundleResults::readStatsToVector(QVector<Statistics> &vec, QXmlStreamReader *xmlReader) {
358 Q_ASSERT(xmlReader->attributes().hasAttribute(
"listSize"));
359 int listSize = xmlReader->attributes().value(
"listSize").toInt();
360 for (
int i = 0; i < listSize; i++) {
361 xmlReader->readNextStartElement();
362 Q_ASSERT(xmlReader->name() ==
"statisticsItem");
363 xmlReader->readNextStartElement();
364 Q_ASSERT(xmlReader->name() ==
"statistics");
366 xmlReader->readNextStartElement();
368 xmlReader->readNextStartElement();
371 void BundleResults::readMinMaxSigmas(QXmlStreamReader *xmlReader) {
372 Q_ASSERT(xmlReader->name() ==
"minMaxSigmas");
373 while (xmlReader->readNextStartElement()) {
374 if (xmlReader->qualifiedName() ==
"minLat" ||
375 xmlReader->qualifiedName() ==
"minX") {
378 else if (xmlReader->qualifiedName() ==
"maxLat" ||
379 xmlReader->qualifiedName() ==
"maxX") {
382 else if (xmlReader->qualifiedName() ==
"minLon" ||
383 xmlReader->qualifiedName() ==
"minY") {
386 else if (xmlReader->qualifiedName() ==
"maxLon" ||
387 xmlReader->qualifiedName() ==
"maxY") {
390 else if (xmlReader->qualifiedName() ==
"minRad" ||
391 xmlReader->qualifiedName() ==
"minZ") {
394 else if (xmlReader->qualifiedName() ==
"maxRad" ||
395 xmlReader->qualifiedName() ==
"maxZ") {
399 xmlReader->skipCurrentElement();
404 void BundleResults::readSigma(
Distance &dist, QString &pointId, QXmlStreamReader *xmlReader) {
405 Q_ASSERT(xmlReader->attributes().hasAttribute(
"value"));
406 Q_ASSERT(xmlReader->attributes().hasAttribute(
"pointId"));
407 QStringRef sigmaValue = xmlReader->attributes().value(
"value");
408 if (!sigmaValue.isEmpty()) {
409 dist.setMeters(sigmaValue.toDouble());
412 QString sigmaPointId = xmlReader->attributes().value(
"pointId").toString();
413 if (!sigmaPointId.isEmpty()) {
414 pointId = sigmaPointId;
416 xmlReader->skipCurrentElement();
419 void BundleResults::readMaxLikelihoodEstimation(QXmlStreamReader *xmlReader) {
420 Q_ASSERT(xmlReader->name() ==
"maximumLikelihoodEstimation");
421 QStringRef maximumLikelihoodIndex = xmlReader->attributes().value(
"maximumLikelihoodIndex");
422 if (!maximumLikelihoodIndex.isEmpty()) {
427 xmlReader->attributes().value(
"maximumLikelihoodMedianR2Residuals");
432 while (xmlReader->readNextStartElement()) {
433 if (xmlReader->qualifiedName() ==
"cumulativeProbabilityCalculator") {
437 else if (xmlReader->qualifiedName() ==
"residualsCumulativeProbabilityCalculator") {
442 else if (xmlReader->qualifiedName() ==
"model") {
443 QString model = xmlReader->attributes().value(
"modelSelection").toString();
444 QStringRef tweakingConstant = xmlReader->attributes().value(
"tweakingConstant");
445 QStringRef quantile = xmlReader->attributes().value(
"quantile");
446 bool validModel =
true;
449 if (tweakingConstant.isEmpty())
451 if (quantile.isEmpty())
457 MaximumLikelihoodWFunctions::stringToModel(model),
458 tweakingConstant.toDouble()),
459 quantile.toDouble()));
461 xmlReader->skipCurrentElement();
464 xmlReader->skipCurrentElement();
477 m_numberFixedPoints(src.m_numberFixedPoints),
478 m_numberIgnoredPoints(src.m_numberIgnoredPoints),
479 m_numberHeldImages(src.m_numberHeldImages),
480 m_rmsXResiduals(src.m_rmsXResiduals),
481 m_rmsYResiduals(src.m_rmsYResiduals),
482 m_rmsXYResiduals(src.m_rmsXYResiduals),
483 m_rejectionLimit(src.m_rejectionLimit),
484 m_numberObservations(src.m_numberObservations),
485 m_numberImageObservations(src.m_numberImageObservations),
486 m_numberLidarImageObservations(src.m_numberLidarImageObservations),
487 m_numberRejectedObservations(src.m_numberRejectedObservations),
488 m_numberLidarRangeConstraintEquations(src.m_numberLidarRangeConstraintEquations),
489 m_numberUnknownParameters(src.m_numberUnknownParameters),
490 m_numberImageParameters(src.m_numberImageParameters),
491 m_numberConstrainedImageParameters(src.m_numberConstrainedImageParameters),
492 m_numberConstrainedPointParameters(src.m_numberConstrainedPointParameters),
493 m_numberConstrainedLidarPointParameters(src.m_numberConstrainedLidarPointParameters),
494 m_numberConstrainedTargetParameters(src.m_numberConstrainedTargetParameters),
495 m_degreesOfFreedom(src.m_degreesOfFreedom),
496 m_sigma0(src.m_sigma0),
497 m_elapsedTime(src.m_elapsedTime),
498 m_elapsedTimeErrorProp(src.m_elapsedTimeErrorProp),
499 m_converged(src.m_converged),
500 m_bundleControlPoints(src.m_bundleControlPoints),
501 m_bundleLidarPoints(src.m_bundleLidarPoints),
502 m_outNet(src.m_outNet),
503 m_outLidarData(src.m_outLidarData),
504 m_iterations(src.m_iterations),
505 m_observations(src.m_observations),
506 m_rmsImageSampleResiduals(src.m_rmsImageSampleResiduals),
507 m_rmsImageLineResiduals(src.m_rmsImageLineResiduals),
508 m_rmsImageResiduals(src.m_rmsImageResiduals),
509 m_rmsLidarImageSampleResiduals(src.m_rmsLidarImageSampleResiduals),
510 m_rmsLidarImageLineResiduals(src.m_rmsLidarImageLineResiduals),
511 m_rmsLidarImageResiduals(src.m_rmsLidarImageResiduals),
512 m_rmsImageXSigmas(src.m_rmsImageXSigmas),
513 m_rmsImageYSigmas(src.m_rmsImageYSigmas),
514 m_rmsImageZSigmas(src.m_rmsImageZSigmas),
515 m_rmsImageRASigmas(src.m_rmsImageRASigmas),
516 m_rmsImageDECSigmas(src.m_rmsImageDECSigmas),
517 m_rmsImageTWISTSigmas(src.m_rmsImageTWISTSigmas),
518 m_minSigmaCoord1Distance(src.m_minSigmaCoord1Distance),
519 m_maxSigmaCoord1Distance(src.m_maxSigmaCoord1Distance),
520 m_minSigmaCoord2Distance(src.m_minSigmaCoord2Distance),
521 m_maxSigmaCoord2Distance(src.m_maxSigmaCoord2Distance),
522 m_minSigmaCoord3Distance(src.m_minSigmaCoord3Distance),
523 m_maxSigmaCoord3Distance(src.m_maxSigmaCoord3Distance),
524 m_minSigmaCoord1PointId(src.m_minSigmaCoord1PointId),
525 m_maxSigmaCoord1PointId(src.m_maxSigmaCoord1PointId),
526 m_minSigmaCoord2PointId(src.m_minSigmaCoord2PointId),
527 m_maxSigmaCoord2PointId(src.m_maxSigmaCoord2PointId),
528 m_minSigmaCoord3PointId(src.m_minSigmaCoord3PointId),
529 m_maxSigmaCoord3PointId(src.m_maxSigmaCoord3PointId),
530 m_rmsSigmaCoord1Stats(src.m_rmsSigmaCoord1Stats),
531 m_rmsSigmaCoord2Stats(src.m_rmsSigmaCoord2Stats),
532 m_rmsSigmaCoord3Stats(src.m_rmsSigmaCoord3Stats),
533 m_maximumLikelihoodFunctions(src.m_maximumLikelihoodFunctions),
534 m_maximumLikelihoodIndex(src.m_maximumLikelihoodIndex),
537 m_maximumLikelihoodMedianR2Residuals(src.m_maximumLikelihoodMedianR2Residuals)
593 m_converged = src.m_converged;
595 m_bundleLidarPoints = src.m_bundleLidarPoints;
606 m_rmsImageXSigmas = src.m_rmsImageXSigmas;
666 m_rmsImageXSigmas.clear();
750 m_rmsImageXSigmas.resize(numberImages);
761 QVector<Statistics> rmsImageSampleResiduals,
762 QVector<Statistics> rmsImageResiduals) {
779 QList<Statistics> rmsImageSampleResiduals,
780 QList<Statistics> rmsImageResiduals) {
795 QList<Statistics> rmsLidarImageSampleResiduals,
796 QList<Statistics> rmsLidarImageResiduals) {
812 QString minCoord1PointId, QString maxCoord1PointId) {
829 QString minCoord2PointId, QString maxCoord2PointId) {
846 QString minCoord3PointId, QString maxCoord3PointId) {
862 double rmsFromSigmaCoord1Stats,
863 double rmsFromSigmaCoord2Stats,
864 double rmsFromSigmaCoord3Stats) {
879 QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles) {
893 for (
int i = 0; i < modelsWithQuantiles.size(); i++) {
906 modelsWithQuantiles[i].second));
1332 m_bundleLidarPoints = lidarPoints;
1445 return m_rmsImageXSigmas;
1855 return m_bundleLidarPoints;
1869 "Output Control Network has not been set.",
2002 "Correlation matrix for this bundle is NULL.",
2056 stream.writeStartElement(
"bundleResults");
2057 stream.writeStartElement(
"correlationMatrix");
2058 stream.writeAttribute(
"correlationFileName",
2060 stream.writeAttribute(
"covarianceFileName",
2062 stream.writeStartElement(
"imagesAndParameters");
2063 QMapIterator<QString, QStringList> imgParamIt(*
correlationMatrix().imagesAndParameters());
2064 while (imgParamIt.hasNext()) {
2066 stream.writeStartElement(
"image");
2067 stream.writeAttribute(
"id", imgParamIt.key());
2069 for (
int i = 0; i < parameters.size(); i++) {
2070 stream.writeTextElement(
"parameter", parameters[i]);
2072 stream.writeEndElement();
2075 stream.writeEndElement();
2076 stream.writeEndElement();
2078 stream.writeStartElement(
"generalStatisticsValues");
2089 stream.writeTextElement(
"numberConstrainedPointParameters",
2091 stream.writeTextElement(
"numberConstrainedImageParameters",
2093 stream.writeTextElement(
"numberConstrainedTargetParameters",
2100 stream.writeEndElement();
2102 stream.writeStartElement(
"rms");
2103 stream.writeStartElement(
"residuals");
2107 stream.writeEndElement();
2108 stream.writeStartElement(
"sigmas");
2111 switch (coordType) {
2123 IString msg =
"Unknown surface point coordinate type enum [" +
toString(coordType) +
"]." ;
2126 stream.writeEndElement();
2128 stream.writeStartElement(
"imageResidualsLists");
2129 stream.writeStartElement(
"residualsList");
2132 stream.writeStartElement(
"statisticsItem");
2134 stream.writeEndElement();
2136 stream.writeEndElement();
2137 stream.writeStartElement(
"sampleList");
2140 stream.writeStartElement(
"statisticsItem");
2142 stream.writeEndElement();
2144 stream.writeEndElement();
2146 stream.writeStartElement(
"lineList");
2149 stream.writeStartElement(
"statisticsItem");
2151 stream.writeEndElement();
2153 stream.writeEndElement();
2155 stream.writeStartElement(
"lidarResidualsList");
2158 stream.writeStartElement(
"statisticsItem");
2160 stream.writeEndElement();
2162 stream.writeEndElement();
2164 stream.writeStartElement(
"lidarSampleList");
2167 stream.writeStartElement(
"statisticsItem");
2169 stream.writeEndElement();
2171 stream.writeEndElement();
2173 stream.writeStartElement(
"lidarLineList");
2176 stream.writeStartElement(
"statisticsItem");
2178 stream.writeEndElement();
2180 stream.writeEndElement();
2181 stream.writeEndElement();
2183 stream.writeStartElement(
"imageSigmasLists");
2184 stream.writeStartElement(
"xSigmas");
2186 for (
int i = 0; i < m_rmsImageXSigmas.size(); i++) {
2187 stream.writeStartElement(
"statisticsItem");
2188 m_rmsImageXSigmas[i].save(stream, project);
2189 stream.writeEndElement();
2192 stream.writeEndElement();
2194 stream.writeStartElement(
"ySigmas");
2197 stream.writeStartElement(
"statisticsItem");
2199 stream.writeEndElement();
2201 stream.writeEndElement();
2203 stream.writeStartElement(
"zSigmas");
2206 stream.writeStartElement(
"statisticsItem");
2208 stream.writeEndElement();
2210 stream.writeEndElement();
2212 stream.writeStartElement(
"raSigmas");
2215 stream.writeStartElement(
"statisticsItem");
2217 stream.writeEndElement();
2219 stream.writeEndElement();
2221 stream.writeStartElement(
"decSigmas");
2224 stream.writeStartElement(
"statisticsItem");
2226 stream.writeEndElement();
2228 stream.writeEndElement();
2230 stream.writeStartElement(
"twistSigmas");
2233 stream.writeStartElement(
"statisticsItem");
2235 stream.writeEndElement();
2237 stream.writeEndElement();
2238 stream.writeEndElement();
2239 stream.writeEndElement();
2241 stream.writeStartElement(
"elapsedTime");
2244 stream.writeEndElement();
2246 stream.writeStartElement(
"minMaxSigmas");
2249 switch (coordType) {
2251 stream.writeStartElement(
"minLat");
2254 stream.writeEndElement();
2255 stream.writeStartElement(
"maxLat");
2258 stream.writeEndElement();
2259 stream.writeStartElement(
"minLon");
2262 stream.writeEndElement();
2263 stream.writeStartElement(
"maxLon");
2266 stream.writeEndElement();
2267 stream.writeStartElement(
"minRad");
2270 stream.writeEndElement();
2271 stream.writeStartElement(
"maxRad");
2274 stream.writeEndElement();
2277 stream.writeStartElement(
"minX");
2280 stream.writeEndElement();
2281 stream.writeStartElement(
"maxX");
2284 stream.writeEndElement();
2285 stream.writeStartElement(
"minY");
2288 stream.writeEndElement();
2289 stream.writeStartElement(
"maxY");
2292 stream.writeEndElement();
2293 stream.writeStartElement(
"minZ");
2296 stream.writeEndElement();
2297 stream.writeStartElement(
"maxZ");
2300 stream.writeEndElement();
2303 IString msg =
"Unknown surface point coordinate type enum [" +
toString(coordType) +
"]." ;
2306 stream.writeEndElement();
2309 stream.writeStartElement(
"maximumLikelihoodEstimation");
2312 stream.writeAttribute(
"maximumLikelihoodMedianR2Residuals",
2315 stream.writeStartElement(
"cumulativeProbabilityCalculator");
2317 stream.writeEndElement();
2319 stream.writeStartElement(
"residualsCumulativeProbabilityCalculator");
2321 stream.writeEndElement();
2324 stream.writeStartElement(
"model");
2325 stream.writeAttribute(
"modelNumber",
toString(i+1));
2326 stream.writeAttribute(
"modelSelection",
2328 stream.writeAttribute(
"tweakingConstant",
2331 stream.writeEndElement();
2333 stream.writeEndElement();
2334 stream.writeEndElement();
This class is a container class for BundleObservations.
A container class for statistical results from a BundleAdjust solution.
void addProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of |R^2 residuals|.
void incrementNumberConstrainedImageParameters(int incrementAmount)
Increase the number of constrained image parameters.
~BundleResults()
Destroys this BundleResults object.
QString m_minSigmaCoord1PointId
The minimum sigma coordinate 1 point id.
QVector< Statistics > m_rmsImageTWISTSigmas
< The root mean square image twist sigmas.
double elapsedTimeErrorProp() const
Returns the elapsed time for error propagation.
int numberRejectedObservations() const
Returns the number of observation that were rejected.
int m_numberUnknownParameters
total number of parameters to solve for
QString minSigmaCoord2PointId() const
Returns the minimum sigma point id for coordinate 2.
void setSigma0(double sigma0)
Sets the sigma0.
double rejectionLimit() const
Returns the rejection limit.
int m_degreesOfFreedom
degrees of freedom
QList< Statistics > m_rmsLidarImageResiduals
RMS image lidar sample & line residual stats for each image in the bundle
int m_numberFixedPoints
number of 'fixed' (ground) points (define)
void incrementNumberConstrainedPointParameters(int incrementAmount)
Increase the number of contrained point parameters.
double rmsRxy() const
Returns the RMS of the x and y residuals.
QList< Statistics > rmsImageSampleResiduals() const
Returns the list of RMS image sample residuals statistics.
QList< Statistics > m_rmsLidarImageSampleResiduals
List of RMS lidar sample residual stats for each image in the bundle
int m_numberConstrainedTargetParameters
number of constrained target parameters
BundleObservationVector m_observations
The vector of BundleObservations from BundleAdjust.
BundleResults(QObject *parent=0)
Constructs a BundleResults object.
ControlNetQsp outputControlNet() const
Returns a shared pointer to the output control network.
int numberObservations() const
Returns the number of observations.
void setElapsedTime(double time)
Sets the elapsed time for the bundle adjustment.
Distance m_maxSigmaCoord3Distance
The maximum sigma radius distance.
MaximumLikelihoodWFunctions maximumLikelihoodModelWFunc(int modelIndex) const
Returns the maximum likelihood model at the given index.
void incrementHeldImages()
Increases the number of 'held' images.
int m_numberLidarImageObservations
lidar image coords. (2 per measure)
double m_maximumLikelihoodMedianR2Residuals
Median of R^2 residuals.
double sigmaCoord3StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 3.
double m_rmsXResiduals
rms of x residuals
double m_rmsSigmaCoord3Stats
rms of adjusted Radius sigmas
void initializeProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of |R^2 residuals|.
void incrementIgnoredPoints()
Increase the number of ignored points.
void incrementFixedPoints()
Increase the number of 'fixed' (ground) points.
void setBundleControlPoints(QVector< BundleControlPointQsp > controlPoints)
Sets the bundle control point vector.
void setNumberConstrainedPointParameters(int numberParameters)
Set number of contrained point parameters.
void setBundleLidarPoints(QVector< BundleLidarControlPointQsp > lidarPoints)
Sets the bundle lidar point vector.
double sigma0() const
Returns the Sigma0 of the bundle adjustment.
QVector< Statistics > m_rmsImageZSigmas
< The root mean square image z sigmas.
void setIterations(int iterations)
Sets the number of iterations taken by the BundleAdjust.
bool converged() const
Returns whether or not the bundle adjustment converged.
Distance m_maxSigmaCoord1Distance
The maximum sigma latitude distance.
double maximumLikelihoodModelQuantile(int modelIndex) const
Returns the quantile of the maximum likelihood model at the given index.
int m_numberImageObservations
photogrammetry image coords. (2 per measure)
void setSigmaCoord1Range(Distance minCoord1Dist, Distance maxCoord1Dist, QString minCoord1PointId, QString maxCoord1PointId)
Sets the min and max sigma distances and point ids for coordinate 1.
void incrementMaximumLikelihoodModelIndex()
Increases the value that indicates which stage the maximum likelihood adjustment is currently on.
QVector< Statistics > rmsImageDECSigmas() const
Returns the list of RMS image declination sigma statistics.
QString m_maxSigmaCoord1PointId
The maximum sigma coordinate 1 point id.
QVector< Statistics > m_rmsImageYSigmas
< The root mean square image y sigmas.
QList< Statistics > rmsLidarImageSampleResiduals() const
Returns the list of RMS image lidar sample residuals statistics.
void setOutputControlNet(ControlNetQsp outNet)
Sets the output ControlNet.
int m_iterations
The number of iterations taken by BundleAdjust.
double m_rmsXYResiduals
rms of all x and y residuals
int m_numberLidarRangeConstraintEquations
void setSigmaCoord2Range(Distance minCoord2Dist, Distance maxCoord2Dist, QString minCoord2PointId, QString maxCoord2PointId)
Sets the min and max sigma distances and point ids for coordinate 2.
int numberConstrainedPointParameters() const
Returns the number of constrained point parameters.
double rmsRy() const
Returns the RMS of the y residuals.
void resetNumberConstrainedImageParameters()
Resets the number of constrained image parameters to 0.
int m_numberIgnoredPoints
number of ignored points
void computeDegreesOfFreedom()
Computes the degrees of freedom of the bundle adjustment and stores it internally.
Distance m_minSigmaCoord2Distance
The minimum sigma longitude distance.
int iterations() const
Returns the number of iterations taken by the BundleAdjust.
CorrelationMatrix correlationMatrix() const
Returns the Correlation Matrix.
void setNumberRejectedObservations(int numberObservations)
Sets the number of rejected observations.
QString minSigmaCoord1PointId() const
Returns the minimum sigma point id for coordinate 1.
double m_rejectionLimit
current rejection limit
QVector< Statistics > rmsImageYSigmas() const
Returns the list of RMS image y sigma statistics.
QString m_minSigmaCoord2PointId
The minimum sigma coordinate 2 point id.
void maximumLikelihoodSetUp(QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles)
This method steps up the maximum likelihood estimation solution.
void save(QXmlStreamWriter &stream, const Project *project) const
Saves the BundleResults object to an XML file.
int m_numberConstrainedImageParameters
number of constrained image parameters
int numberIgnoredPoints() const
Returns the number of ignored points.
QVector< BundleControlPointQsp > & bundleControlPoints()
Returns a reference to the BundleControlPoint vector.
void setCorrMatImgsAndParams(QMap< QString, QStringList > imgsAndParams)
Set the images and their associated parameters of the correlation matrix.
Distance maxSigmaCoord2Distance() const
Returns the maximum sigma distance for coordinate 2.
QString m_minSigmaCoord3PointId
The minimum sigma coordinate 3 point id.
int numberUnknownParameters() const
Returns the number of unknown parameters.
void addResidualsProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of residuals used for reporting.
QVector< BundleLidarControlPointQsp > & bundleLidarControlPoints()
Returns a reference to the BundleLidarControlPoint vector.
int m_numberImageParameters
number of image parameters
double m_sigma0
std deviation of unit weight
int numberImageParameters() const
Returns the total number of image parameters.
QList< Statistics > rmsLidarImageLineResiduals() const
Returns the list of RMS image lidar line residuals statistics.
int m_maximumLikelihoodIndex
This count keeps track of which stage of the maximum likelihood adjustment the bundle is currently on...
QList< Statistics > m_rmsImageLineResiduals
List of RMS image line residual statistics for each image in the bundle
int numberMaximumLikelihoodModels() const
Returns how many maximum likelihood models were used in the bundle adjustment.
StatCumProbDistDynCalc * m_cumProRes
This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels)...
void setNumberLidarRangeConstraints(int numberLidarRangeConstraints)
Sets the total number of lidar range constraints.
int maximumLikelihoodModelIndex() const
Returns which step the bundle adjustment is on.
LidarDataQsp outputLidarData() const
Returns a shared pointer to the output LidarData object.
int m_numberConstrainedPointParameters
number of constrained point parameters
int m_numberConstrainedLidarPointParameters
lidar points
int m_numberRejectedObservations
number of rejected image coordinate observations
int numberHeldImages() const
Returns the number of 'held' images.
double sigmaCoord2StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 2.
StatCumProbDistDynCalc * m_cumPro
This class will be used to calculate the cumulative probability distribution of |R^2 residuals|,...
int m_numberObservations
number of image coordinate observations
void setRejectionLimit(double rejectionLimit)
Sets the rejection limit.
Distance minSigmaCoord3Distance() const
Returns the minimum sigma distance for coordinate 3.
int numberLidarImageObservations() const
Returns the number of lidar observations.
void incrementNumberConstrainedTargetParameters(int incrementAmount)
Increases the number of constrained target parameters.
QVector< BundleControlPointQsp > m_bundleControlPoints
The vector of BundleControlPoints from BundleAdjust.
void setOutputLidarData(LidarDataQsp outLidarData)
Sets the output LidarData object.
double m_rmsSigmaCoord2Stats
rms of adjusted Longitude sigmas
void setNumberImageObservations(int numberObservations)
Sets the number of photogrammetric image observations.
void setRmsImageResidualLists(QList< Statistics > rmsImageLineResiduals, QList< Statistics > rmsImageSampleResiduals, QList< Statistics > rmsImageResiduals)
Sets the root mean square image residual Statistics lists.
double maximumLikelihoodMedianR2Residuals() const
Returns the median of the |R^2 residuals|.
int numberFixedPoints() const
Returns the number of 'fixed' (ground) points.
QString maxSigmaCoord1PointId() const
Returns the maximum sigma point id for coordinate 1.
int numberImageObservations() const
Returns the number of observations.
LidarDataQsp m_outLidarData
Output lidar data from BundleAdjust.
void setNumberLidarImageObservations(int numberLidarObservations)
Sets the number of lidar observations.
void resetNumberConstrainedPointParameters()
Resets the number of contrained point parameters to 0.
void setNumberImageParameters(int numberParameters)
Sets the number of image parameters.
int numberConstrainedTargetParameters() const
Return the number of constrained target parameters.
StatCumProbDistDynCalc residualsCumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the residuals used for reporting.
double elapsedTime() const
Returns the elapsed time for the bundle adjustment.
QList< Statistics > m_rmsLidarImageLineResiduals
List of RMS lidar line residual stats for each image in the bundle
QList< Statistics > rmsImageResiduals() const
Returns the list of RMS image residuals statistics.
Distance m_maxSigmaCoord2Distance
The maximum sigma longitude distance.
QVector< Statistics > m_rmsImageRASigmas
< The root mean square image right ascension sigmas.
const BundleObservationVector & observations() const
Returns a reference to the observations used by the BundleAdjust.
Distance m_minSigmaCoord3Distance
The minimum sigma radius distance.
ControlNetQsp m_outNet
The output control net from BundleAdjust.
void initialize()
Initializes the BundleResults to a default state where all numeric members are set to 0 or another de...
Distance minSigmaCoord1Distance() const
Returns the minimum sigma distance for coordinate 1.
void setNumberUnknownParameters(int numberParameters)
Sets the total number of parameters to solve for.
void setSigmaCoord3Range(Distance minCoord3Dist, Distance maxCoord3Dist, QString minCoord3PointId, QString maxCoord3PointId)
Sets the min and max sigma distances and point ids for coordinate 3.
QString minSigmaCoord3PointId() const
Returns the minimum sigma point id for coordinate 3.
void setNumberConstrainedLidarPointParameters(int numberParameters)
Set number of contrained point parameters.
double rmsRx() const
Returns the RMS of the x residuals.
void setObservations(BundleObservationVector observations)
Sets the vector of BundleObservations.
void initializeResidualsProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of residuals used for reporting.
void setRmsFromSigmaStatistics(double rmsFromSigmaCoord1Stats, double rmsFromSigmaCoord2Stats, double rmsFromSigmaCoord3Stats)
Sets the root mean square values of the adjusted sigmas for all three coordinates.
void setRmsXYResiduals(double rx, double ry, double rxy)
Sets the root mean square of the x and y residuals.
QList< Statistics > rmsImageLineResiduals() const
Returns the list of RMS image line residuals statistics.
double m_elapsedTime
elapsed time for bundle
double m_elapsedTimeErrorProp
elapsed time for error propagation
QVector< Statistics > rmsImageRASigmas() const
Returns the list of RMS image right ascension sigma statistics.
void setNumberObservations(int numberObservations)
Sets the number of observations.
int numberLidarRangeConstraintEquations() const
Return the number of lidar range constraint equations.
QVector< Statistics > rmsImageXSigmas() const
Returns the list of RMS image x sigma statistics.
void printMaximumLikelihoodTierInformation()
Prints out information about which tier the solution is in and the status of the residuals.
BundleResults & operator=(const BundleResults &src)
Assignment operator for BundleResults.
void resizeSigmaStatisticsVectors(int numberImages)
Resizes all image sigma vectors.
CorrelationMatrix * m_correlationMatrix
The correlation matrix from the BundleAdjust.
void setDegreesOfFreedom(double degreesOfFreedom)
Sets the degrees of freedom.
Distance m_minSigmaCoord1Distance
The minimum sigma latitude distance.
Distance maxSigmaCoord3Distance() const
Returns the maximum sigma distance for coordinate 3.
Distance maxSigmaCoord1Distance() const
Returns the maximum sigma distance for coordinate 1.
double m_rmsYResiduals
rms of y residuals
QString m_maxSigmaCoord2PointId
The maximum sigma coordinate2 point id.
QList< QPair< MaximumLikelihoodWFunctions, double > > m_maximumLikelihoodFunctions
< The maximum likelihood models and their quantiles.
void setCorrMatCovFileName(FileName name)
Set the covariance file name for the matrix used to calculate the correlation matrix.
QString m_maxSigmaCoord3PointId
The maximum sigma coordinate 3 point id.
QList< Statistics > m_rmsImageSampleResiduals
List of RMS image sample residual statistics for each image in the bundle
QVector< Statistics > rmsImageTWISTSigmas() const
Returns the list of RMS image twist sigma statistics.
void setRmsLidarImageResidualLists(QList< Statistics > rmsLidarImageLineResiduals, QList< Statistics > rmsLidarImageSampleResiduals, QList< Statistics > rmsLidarImageResiduals)
Sets the root mean square lidar image residual Statistics lists.
QString maxSigmaCoord3PointId() const
Returns the maximum sigma point id for coordinate 3.
void computeSigma0(double dvtpv, BundleSettings::ConvergenceCriteria criteria)
Computes the sigma0 and stores it internally.
QList< Statistics > m_rmsImageResiduals
RMS image sample and line residual statistics for each image in the bundle
QString maxSigmaCoord2PointId() const
Returns the maximum sigma point id for coordinate 2.
int numberConstrainedImageParameters() const
Returns the number of constrained image parameters.
void setElapsedTimeErrorProp(double time)
Sets the elapsed time for error propegation.
QVector< Statistics > rmsImageZSigmas() const
Returns the list of RMS image z sigma statistics.
QList< Statistics > rmsLidarImageResiduals() const
Returns the list of RMS image lidar residuals statistics.
int m_numberHeldImages
number of 'held' images (define)
double sigmaCoord1StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 1.
void setConverged(bool converged)
Sets if the bundle adjustment converged.
Distance minSigmaCoord2Distance() const
Returns the minimum sigma distance for coordinate 2.
void resetNumberConstrainedTargetParameters()
Resets the number of constrained target parameters to 0.
double m_rmsSigmaCoord1Stats
rms of adjusted Latitude sigmas
StatCumProbDistDynCalc cumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the |R^2 residuals|.
int degreesOfFreedom() const
Returns the degrees of freedom.
QVector< Statistics > m_rmsImageDECSigmas
< The root mean square image declination sigmas.
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
@ ParameterCorrections
All parameter corrections will be used to determine that the bundle adjustment has converged.
This is a container for the correlation matrix that comes from a bundle adjust.
void setCovarianceFileName(FileName covarianceFileName)
Set the qmap of images and parameters.
void setImagesAndParameters(QMap< QString, QStringList > imagesAndParameters)
Set the qmap of images and parameters.
void setCorrelationFileName(FileName correlationFileName)
Set the qmap of images and parameters.
Distance measurement, usually in meters.
void setMeters(double distanceInMeters)
Set the distance in meters.
File name manipulation and expansion.
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ Programmer
This error is for when a programmer made an API call that was illegal.
@ Io
A type of error that occurred when performing an actual I/O operation.
Adds specific functionality to C++ strings.
Class provides maximum likelihood estimation functions for robust parameter estimation,...
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
The main project for ipce.
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added.
This class is used to accumulate statistics on double arrays.
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
int toInt(const QString &string)
Global function to convert from a string to an integer.
bool toBool(const QString &string)
Global function to convert from a string to a boolean.