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 QStringView time = xmlReader->attributes().value(
"time");
98 if (!time.isEmpty()) {
102 QStringView 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").toString();
135 if (!correlationFileName.isEmpty()) {
136 FileName correlationFile(correlationFileName);
140 QString covarianceFileName = xmlReader->attributes().value(
"covarianceFileName").toString();
141 if (!covarianceFileName.isEmpty()) {
142 FileName covarianceFile(covarianceFileName);
145 while (xmlReader->readNextStartElement()) {
146 if (xmlReader->qualifiedName() ==
"image") {
147 QString correlationMatrixImageId = xmlReader->attributes().value(
"id").toString();
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 QStringView rx = xmlReader->attributes().value(
"x");
233 QStringView ry = xmlReader->attributes().value(
"y");
238 QStringView rxy = xmlReader->attributes().value(
"xy");
239 if (!rxy.isEmpty()) {
242 xmlReader->skipCurrentElement();
244 else if (xmlReader->qualifiedName() ==
"sigmas")
246 QStringView lat = xmlReader->attributes().value(
"lat");
251 QStringView lon = xmlReader->attributes().value(
"lon");
256 QStringView rad = xmlReader->attributes().value(
"rad");
261 QStringView x = xmlReader->attributes().value(
"x");
266 QStringView y = xmlReader->attributes().value(
"y");
271 QStringView 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");
351 list.append(
new Statistics(xmlReader));
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");
365 vec.append(
new Statistics(xmlReader));
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 QStringView sigmaValue = xmlReader->attributes().value(
"value");
408 if (!sigmaValue.isEmpty()) {
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 QStringView maximumLikelihoodIndex = xmlReader->attributes().value(
"maximumLikelihoodIndex");
422 if (!maximumLikelihoodIndex.isEmpty()) {
427 xmlReader->attributes().value(
"maximumLikelihoodMedianR2Residuals");
432 while (xmlReader->readNextStartElement()) {
433 if (xmlReader->qualifiedName() ==
"cumulativeProbabilityCalculator") {
435 xmlReader->readNextStartElement();
436 if (xmlReader->qualifiedName() ==
"statCumProbDistDynCalc") {
437 m_cumPro =
new StatCumProbDistDynCalc(xmlReader);
438 xmlReader->skipCurrentElement();
439 xmlReader->skipCurrentElement();
442 m_cumPro =
new StatCumProbDistDynCalc();
445 else if (xmlReader->qualifiedName() ==
"residualsCumulativeProbabilityCalculator") {
447 xmlReader->readNextStartElement();
448 if (xmlReader->qualifiedName() ==
"statCumProbDistDynCalc") {
449 m_cumProRes =
new StatCumProbDistDynCalc(xmlReader);
450 xmlReader->skipCurrentElement();
451 xmlReader->skipCurrentElement();
457 else if (xmlReader->qualifiedName() ==
"model") {
458 QString model = xmlReader->attributes().value(
"modelSelection").toString();
459 QStringView tweakingConstant = xmlReader->attributes().value(
"tweakingConstant");
460 QStringView quantile = xmlReader->attributes().value(
"quantile");
461 bool validModel =
true;
464 if (tweakingConstant.isEmpty())
466 if (quantile.isEmpty())
471 qMakePair(MaximumLikelihoodWFunctions(
472 MaximumLikelihoodWFunctions::stringToModel(model),
473 tweakingConstant.toDouble()),
474 quantile.toDouble()));
476 xmlReader->skipCurrentElement();
479 xmlReader->skipCurrentElement();
514 m_converged(src.m_converged),
516 m_bundleLidarPoints(src.m_bundleLidarPoints),
527 m_rmsImageXSigmas(src.m_rmsImageXSigmas),
608 m_converged = src.m_converged;
610 m_bundleLidarPoints = src.m_bundleLidarPoints;
621 m_rmsImageXSigmas = src.m_rmsImageXSigmas;
681 m_rmsImageXSigmas.clear();
765 m_rmsImageXSigmas.resize(numberImages);
815 QString minCoord1PointId, QString maxCoord1PointId) {
832 QString minCoord2PointId, QString maxCoord2PointId) {
849 QString minCoord3PointId, QString maxCoord3PointId) {
865 double rmsFromSigmaCoord1Stats,
866 double rmsFromSigmaCoord2Stats,
867 double rmsFromSigmaCoord3Stats) {
882 QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles) {
896 for (
int i = 0; i < modelsWithQuantiles.size(); i++) {
909 modelsWithQuantiles[i].second));
930 double tc =
m_cumPro->value(quantile);
1262 throw IException(IException::Io, msg, _FILEINFO_);
1335 m_bundleLidarPoints = lidarPoints;
1448 return m_rmsImageXSigmas;
1858 return m_bundleLidarPoints;
1871 throw IException(IException::Programmer,
1872 "Output Control Network has not been set.",
2004 throw IException(IException::Unknown,
2005 "Correlation matrix for this bundle is NULL.",
2059 stream.writeStartElement(
"bundleResults");
2060 stream.writeStartElement(
"correlationMatrix");
2061 stream.writeAttribute(
"correlationFileName",
2063 stream.writeAttribute(
"covarianceFileName",
2065 stream.writeStartElement(
"imagesAndParameters");
2066 QMapIterator<QString, QStringList> imgParamIt(*
correlationMatrix().imagesAndParameters());
2067 while (imgParamIt.hasNext()) {
2069 stream.writeStartElement(
"image");
2070 stream.writeAttribute(
"id", imgParamIt.key());
2072 for (
int i = 0; i < parameters.size(); i++) {
2073 stream.writeTextElement(
"parameter", parameters[i]);
2075 stream.writeEndElement();
2078 stream.writeEndElement();
2079 stream.writeEndElement();
2081 stream.writeStartElement(
"generalStatisticsValues");
2092 stream.writeTextElement(
"numberConstrainedPointParameters",
2094 stream.writeTextElement(
"numberConstrainedImageParameters",
2096 stream.writeTextElement(
"numberConstrainedTargetParameters",
2103 stream.writeEndElement();
2105 stream.writeStartElement(
"rms");
2106 stream.writeStartElement(
"residuals");
2110 stream.writeEndElement();
2111 stream.writeStartElement(
"sigmas");
2114 switch (coordType) {
2126 IString msg =
"Unknown surface point coordinate type enum [" +
toString(coordType) +
"]." ;
2127 throw IException(IException::Programmer, msg, _FILEINFO_);
2129 stream.writeEndElement();
2131 stream.writeStartElement(
"imageResidualsLists");
2132 stream.writeStartElement(
"residualsList");
2135 stream.writeStartElement(
"statisticsItem");
2137 stream.writeEndElement();
2139 stream.writeEndElement();
2140 stream.writeStartElement(
"sampleList");
2143 stream.writeStartElement(
"statisticsItem");
2145 stream.writeEndElement();
2147 stream.writeEndElement();
2149 stream.writeStartElement(
"lineList");
2152 stream.writeStartElement(
"statisticsItem");
2154 stream.writeEndElement();
2156 stream.writeEndElement();
2158 stream.writeStartElement(
"lidarResidualsList");
2161 stream.writeStartElement(
"statisticsItem");
2163 stream.writeEndElement();
2165 stream.writeEndElement();
2167 stream.writeStartElement(
"lidarSampleList");
2170 stream.writeStartElement(
"statisticsItem");
2172 stream.writeEndElement();
2174 stream.writeEndElement();
2176 stream.writeStartElement(
"lidarLineList");
2179 stream.writeStartElement(
"statisticsItem");
2181 stream.writeEndElement();
2183 stream.writeEndElement();
2184 stream.writeEndElement();
2186 stream.writeStartElement(
"imageSigmasLists");
2187 stream.writeStartElement(
"xSigmas");
2189 for (
int i = 0; i < m_rmsImageXSigmas.size(); i++) {
2190 stream.writeStartElement(
"statisticsItem");
2191 m_rmsImageXSigmas[i].save(stream, project);
2192 stream.writeEndElement();
2195 stream.writeEndElement();
2197 stream.writeStartElement(
"ySigmas");
2200 stream.writeStartElement(
"statisticsItem");
2202 stream.writeEndElement();
2204 stream.writeEndElement();
2206 stream.writeStartElement(
"zSigmas");
2209 stream.writeStartElement(
"statisticsItem");
2211 stream.writeEndElement();
2213 stream.writeEndElement();
2215 stream.writeStartElement(
"raSigmas");
2218 stream.writeStartElement(
"statisticsItem");
2220 stream.writeEndElement();
2222 stream.writeEndElement();
2224 stream.writeStartElement(
"decSigmas");
2227 stream.writeStartElement(
"statisticsItem");
2229 stream.writeEndElement();
2231 stream.writeEndElement();
2233 stream.writeStartElement(
"twistSigmas");
2236 stream.writeStartElement(
"statisticsItem");
2238 stream.writeEndElement();
2240 stream.writeEndElement();
2241 stream.writeEndElement();
2242 stream.writeEndElement();
2244 stream.writeStartElement(
"elapsedTime");
2247 stream.writeEndElement();
2249 stream.writeStartElement(
"minMaxSigmas");
2252 switch (coordType) {
2254 stream.writeStartElement(
"minLat");
2257 stream.writeEndElement();
2258 stream.writeStartElement(
"maxLat");
2261 stream.writeEndElement();
2262 stream.writeStartElement(
"minLon");
2265 stream.writeEndElement();
2266 stream.writeStartElement(
"maxLon");
2269 stream.writeEndElement();
2270 stream.writeStartElement(
"minRad");
2273 stream.writeEndElement();
2274 stream.writeStartElement(
"maxRad");
2277 stream.writeEndElement();
2280 stream.writeStartElement(
"minX");
2283 stream.writeEndElement();
2284 stream.writeStartElement(
"maxX");
2287 stream.writeEndElement();
2288 stream.writeStartElement(
"minY");
2291 stream.writeEndElement();
2292 stream.writeStartElement(
"maxY");
2295 stream.writeEndElement();
2296 stream.writeStartElement(
"minZ");
2299 stream.writeEndElement();
2300 stream.writeStartElement(
"maxZ");
2303 stream.writeEndElement();
2306 IString msg =
"Unknown surface point coordinate type enum [" +
toString(coordType) +
"]." ;
2307 throw IException(IException::Programmer, msg, _FILEINFO_);
2309 stream.writeEndElement();
2312 stream.writeStartElement(
"maximumLikelihoodEstimation");
2315 stream.writeAttribute(
"maximumLikelihoodMedianR2Residuals",
2318 stream.writeStartElement(
"cumulativeProbabilityCalculator");
2320 stream.writeEndElement();
2322 stream.writeStartElement(
"residualsCumulativeProbabilityCalculator");
2324 stream.writeEndElement();
2327 stream.writeStartElement(
"model");
2328 stream.writeAttribute(
"modelNumber",
toString(i+1));
2329 stream.writeAttribute(
"modelSelection",
2331 stream.writeAttribute(
"tweakingConstant",
2334 stream.writeEndElement();
2336 stream.writeEndElement();
2337 stream.writeEndElement();
This class is a container class for BundleObservations.
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.
Distance measurement, usually in meters.
void setMeters(double distanceInMeters)
Set the distance in meters.
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...
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.
This is free and unencumbered software released into the public domain.
QSharedPointer< LidarData > LidarDataQsp
Definition for a shared pointer to a LidarData object.
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
QSharedPointer< ControlNet > ControlNetQsp
Typedef for QSharedPointer to control network. This typedef is for future implementation of target bo...