9#include "BundleSolutionInfo.h"
18#include <QXmlStreamWriter>
19#include <QXmlStreamReader>
21#include "BundleLidarRangeConstraint.h"
22#include "BundleResults.h"
24#include "ControlList.h"
25#include "ControlMeasure.h"
26#include "ControlNet.h"
27#include "ControlPoint.h"
33#include "PvlKeyword.h"
35#include "StatCumProbDistDynCalc.h"
36#include "Statistics.h"
51 QList<ImageList *> imgList,
53 m_id =
new QUuid(QUuid::createUuid());
58 m_outputControlName=
"";
63 m_images =
new QList<ImageList *>(imgList);
80 QList<ImageList *> imgList,
82 m_id =
new QUuid(QUuid::createUuid());
87 m_outputControlName=
"";
92 m_images =
new QList<ImageList *>(imgList);
107 BundleSolutionInfo::BundleSolutionInfo(
Project *project,
108 QXmlStreamReader *xmlReader,
111 m_id =
new QUuid(QUuid::createUuid());
116 m_outputControlName =
"";
124 m_xmlHandlerProject = project;
127 readBundleSolutionInfo(xmlReader);
130 void BundleSolutionInfo::readBundleSolutionInfo(QXmlStreamReader *xmlReader) {
132 if (m_xmlHandlerProject) {
133 projectRoot = m_xmlHandlerProject->
projectRoot() +
"/";
138 Q_ASSERT(xmlReader->name() ==
"bundleSolutionInfo");
139 while(xmlReader->readNextStartElement()) {
140 if (xmlReader->qualifiedName() ==
"generalAttributes") {
141 while (xmlReader->readNextStartElement()) {
142 if (xmlReader->qualifiedName() ==
"id") {
143 m_id =
new QUuid(xmlReader->readElementText());
145 else if (xmlReader->qualifiedName() ==
"name") {
146 m_name = xmlReader->readElementText();
148 else if (xmlReader->qualifiedName() ==
"runTime") {
149 m_runTime = xmlReader->readElementText();
151 else if (xmlReader->qualifiedName() ==
"inputFileName") {
154 else if (xmlReader->qualifiedName() ==
"bundleOutTXT") {
155 m_txtBundleOutputFilename = projectRoot + xmlReader->readElementText();
157 else if (xmlReader->qualifiedName() ==
"imagesCSV") {
158 m_csvSavedImagesFilename = projectRoot + xmlReader->readElementText();
160 else if (xmlReader->qualifiedName() ==
"pointsCSV") {
161 m_csvSavedPointsFilename = projectRoot + xmlReader->readElementText();
163 else if (xmlReader->qualifiedName() ==
"residualsCSV") {
164 m_csvSavedResidualsFilename = projectRoot + xmlReader->readElementText();
167 xmlReader->skipCurrentElement();
171 else if (xmlReader->name() ==
"bundleSettings") {
174 settings->readBundleSettings(xmlReader);
177 else if (xmlReader->name() ==
"bundleResults") {
183 xmlReader->skipCurrentElement();
229 return m_txtBundleOutputFilename;
239 return m_csvSavedImagesFilename;
249 return m_csvSavedPointsFilename;
259 return m_csvSavedResidualsFilename;
303 oldInputFileName.dir().dirName() +
"/" + oldInputFileName.name());
308 oldOutputFileName.dir().dirName() +
"/" + oldOutputFileName.name());
314 m_outputControlName = newOutputFileName.expanded();
335 return m_id->toString().remove(QRegExp(
"[{}]"));
391 return m_outputControlName;
421 m_outputControlName =
name;
431 return m_outputControlName;
467 "Results for this bundle is NULL.",
524 std::vector<QString> outputColumns;
526 outputColumns.push_back(
"Image,");
527 outputColumns.push_back(
"rms,");
528 outputColumns.push_back(
"rms,");
529 outputColumns.push_back(
"rms,");
531 QStringList observationParameters = observation->parameterList();
533 for (
int i = 0; i < observationParameters.size(); i++) {
534 for (
int j = 0; j < 5; j++) {
535 outputColumns.push_back(observationParameters[i] +
",");
540 int ncolumns = outputColumns.size();
541 for (
int i = 0; i < ncolumns; i++) {
542 QString str = outputColumns.at(i);
543 snprintf(buf,
sizeof(buf),
"%s", (
const char*)str.toLatin1().data());
546 snprintf(buf,
sizeof(buf),
"\n");
549 outputColumns.clear();
551 outputColumns.push_back(
"Filename,");
552 outputColumns.push_back(
"sample res,");
553 outputColumns.push_back(
"line res,");
554 outputColumns.push_back(
"total res,");
556 for (
int i = 0; i < observationParameters.size(); i++) {
557 outputColumns.push_back(
"Initial,");
558 outputColumns.push_back(
"Correction,");
559 outputColumns.push_back(
"Final,");
560 outputColumns.push_back(
"Apriori Sigma,");
561 outputColumns.push_back(
"Adj Sigma,");
565 ncolumns = outputColumns.size();
566 for (
int i = 0; i < ncolumns; i++) {
567 QString str = outputColumns.at(i);
568 snprintf(buf,
sizeof(buf),
"%s", (
const char*)str.toLatin1().data());
571 snprintf(buf,
sizeof(buf),
"\n");
602 for (
int i = 0; i < numObservations; i++) {
607 int numValidLidarPoints = 0;
609 numValidLidarPoints = lidarData->numberLidarPoints();
612 int numInnerConstraints = 0;
613 int numDistanceConstraints = 0;
616 int convergenceCriteria = 1;
618 snprintf(buf,
sizeof(buf),
"JIGSAW: BUNDLE ADJUSTMENT\n=========================\n");
620 snprintf(buf,
sizeof(buf),
"\n Run Time: %s",
623 snprintf(buf,
sizeof(buf),
"\n Network Filename: %s",
627 snprintf(buf,
sizeof(buf),
"\n Cube List: %s",
628 m_settings->cubeList().toStdString().c_str() );
632 snprintf(buf,
sizeof(buf),
"\n Output Network Filename: %s",
635 snprintf(buf,
sizeof(buf),
"\n Output File Prefix: %s",
636 m_settings->outputFilePrefix().toStdString().c_str() );
639 snprintf(buf,
sizeof(buf),
"\n Network Id: %s",
642 snprintf(buf,
sizeof(buf),
"\n Network Description: %s",\
646 snprintf(buf,
sizeof(buf),
"\n Lidar Data Filename: %s",
650 snprintf(buf,
sizeof(buf),
"\n Target: %s",
653 snprintf(buf,
sizeof(buf),
"\n\n Linear Units: kilometers");
655 snprintf(buf,
sizeof(buf),
"\n Angular Units: decimal degrees");
657 snprintf(buf,
sizeof(buf),
"\n\nINPUT: SOLVE OPTIONS\n====================\n");
661 snprintf(buf,
sizeof(buf),
"\n OBSERVATIONS: ON"):
662 snprintf(buf,
sizeof(buf),
"\n OBSERVATIONS: OFF");
666 snprintf(buf,
sizeof(buf),
"\n RADIUS: ON"):
667 snprintf(buf,
sizeof(buf),
"\n RADIUS: OFF");
671 snprintf(buf,
sizeof(buf),
"\n TARGET BODY: ON"):
672 snprintf(buf,
sizeof(buf),
"\n TARGET BODY: OFF");
676 snprintf(buf,
sizeof(buf),
"\n UPDATE: YES"):
677 snprintf(buf,
sizeof(buf),
"\n UPDATE: NO");
681 snprintf(buf,
sizeof(buf),
"\n ERROR PROPAGATION: ON"):
682 snprintf(buf,
sizeof(buf),
"\n ERROR PROPAGATION: OFF");
686 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: LATITUDINAL"):
687 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: RECTANGULAR");
691 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: LATITUDINAL"):
692 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: RECTANGULAR");
696 snprintf(buf,
sizeof(buf),
"\n OUTLIER REJECTION: ON");
698 snprintf(buf,
sizeof(buf),
"\n REJECTION MULTIPLIER: %lf",
704 snprintf(buf,
sizeof(buf),
"\n OUTLIER REJECTION: OFF");
706 snprintf(buf,
sizeof(buf),
"\n REJECTION MULTIPLIER: N/A");
711 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: %s",
715 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: %s",
718 snprintf(buf,
sizeof(buf),
"\n\nMAXIMUM LIKELIHOOD ESTIMATION\n============================\n");
721 for (
int tier = 0; tier < 3; tier++) {
722 if (tier < m_statisticsResults->numberMaximumLikelihoodModels()) {
723 snprintf(buf,
sizeof(buf),
"\n Tier %d Enabled: TRUE", tier);
725 snprintf(buf,
sizeof(buf),
"\n Maximum Likelihood Model: %s",
728 maximumLikelihoodModelWFunc(tier).model()).toLatin1().data());
730 snprintf(buf,
sizeof(buf),
"\n Quantile used for tweaking constant: %lf",
733 snprintf(buf,
sizeof(buf),
"\n Quantile weighted R^2 Residual value: %lf",
736 snprintf(buf,
sizeof(buf),
"\n Approx. weighted Residual cutoff: %s",
740 if (tier != 2) fpOut <<
"\n";
743 snprintf(buf,
sizeof(buf),
"\n Tier %d Enabled: FALSE", tier);
748 snprintf(buf,
sizeof(buf),
"\n\nINPUT: CONVERGENCE CRITERIA\n===========================\n");
750 snprintf(buf,
sizeof(buf),
"\n SIGMA0: %e",
753 snprintf(buf,
sizeof(buf),
"\n MAXIMUM ITERATIONS: %d",
754 m_settings->convergenceCriteriaMaximumIterations());
763 int pointingSolveDegree = globalSettings.numberCameraAngleCoefficientsSolved();
764 QList<double> pointingSigmas = globalSettings.aprioriPointingSigmas();
765 int positionSolveDegree = globalSettings.numberCameraPositionCoefficientsSolved();
766 QList<double> positionSigmas = globalSettings.aprioriPositionSigmas();
768 snprintf(buf,
sizeof(buf),
"\n\nINPUT: CAMERA POINTING OPTIONS\n==============================\n");
770 switch (pointingSolveDegree) {
772 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: NONE");
775 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES");
778 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES, VELOCITIES");
781 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES, VELOCITIES, ACCELERATIONS");
784 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ALL POLYNOMIAL COEFFICIENTS (%d)"
786 "\n CKSOLVEDEGREE: %d",
788 globalSettings.ckDegree(),
789 globalSettings.ckSolveDegree());
793 globalSettings.solveTwist() ?
794 snprintf(buf,
sizeof(buf),
"\n TWIST: ON"):
795 snprintf(buf,
sizeof(buf),
"\n TWIST: OFF");
797 globalSettings.solvePolyOverPointing() ?
798 snprintf(buf,
sizeof(buf),
"\n POLYNOMIAL OVER EXISTING POINTING: ON"):
799 snprintf(buf,
sizeof(buf),
"\nPOLYNOMIAL OVER EXISTING POINTING : OFF");
802 snprintf(buf,
sizeof(buf),
"\n\nINPUT: SPACECRAFT OPTIONS\n=========================\n");
804 switch (positionSolveDegree) {
806 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: NONE");
809 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION");
812 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION, VELOCITIES");
815 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION, VELOCITIES, ACCELERATIONS");
818 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: ALL POLYNOMIAL COEFFICIENTS (%d)"
820 "\n SPKSOLVEDEGREE: %d",
822 globalSettings.spkDegree(),
823 globalSettings.spkSolveDegree());
827 globalSettings.solvePositionOverHermite() ?
828 snprintf(buf,
sizeof(buf),
"\n POLYNOMIAL OVER HERMITE SPLINE: ON"):
829 snprintf(buf,
sizeof(buf),
"\nPOLYNOMIAL OVER HERMITE SPLINE : OFF");
832 snprintf(buf,
sizeof(buf),
"\n\nINPUT: GLOBAL IMAGE PARAMETER UNCERTAINTIES\n===========================================\n");
836 switch (
m_settings->controlPointCoordTypeReports()) {
838 coord1Str =
"LATITUDE";
839 coord2Str =
"LONGITUDE";
840 coord3Str =
"RADIUS";
848 IString msg =
"Unknown surface point coordinate type enum ["
857 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: N/A", coord1Str.toLatin1().data()):
858 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: %lf (meters)", coord1Str.toLatin1().data(),
863 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: N/A", coord2Str.toLatin1().data()):
864 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: %lf (meters)", coord2Str.toLatin1().data(),
869 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: N/A", coord3Str.toLatin1().data()):
870 snprintf(buf,
sizeof(buf),
"\n POINT %s SIGMA: %lf (meters)", coord3Str.toLatin1().data(),
873 (positionSolveDegree < 1 || positionSigmas[0] ==
Isis::Null) ?
874 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT POSITION SIGMA: N/A"):
875 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT POSITION SIGMA: %lf (meters)",
879 (positionSolveDegree < 2 || positionSigmas[1] ==
Isis::Null) ?
880 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT VELOCITY SIGMA: N/A"):
881 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT VELOCITY SIGMA: %lf (m/s)",
885 (positionSolveDegree < 3 || positionSigmas[2] ==
Isis::Null) ?
886 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT ACCELERATION SIGMA: N/A"):
887 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT ACCELERATION SIGMA: %lf (m/s/s)",
891 (pointingSolveDegree < 1 || pointingSigmas[0] ==
Isis::Null) ?
892 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGLES SIGMA: N/A"):
893 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGLES SIGMA: %lf (dd)",
897 (pointingSolveDegree < 2 || pointingSigmas[1] ==
Isis::Null) ?
898 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR VELOCITY SIGMA: N/A"):
899 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR VELOCITY SIGMA: %lf (dd/s)",
903 (pointingSolveDegree < 3 || pointingSigmas[2] ==
Isis::Null) ?
904 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR ACCELERATION SIGMA: N/A"):
905 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR ACCELERATION SIGMA: %lf (dd/s/s)",
910 snprintf(buf,
sizeof(buf),
"\n\nINPUT: TARGET BODY OPTIONS\n==============================\n");
914 snprintf(buf,
sizeof(buf),
"\n POLE: RIGHT ASCENSION");
916 snprintf(buf,
sizeof(buf),
"\n : DECLINATION\n");
920 snprintf(buf,
sizeof(buf),
"\n POLE: RIGHT ASCENSION\n");
924 snprintf(buf,
sizeof(buf),
"\n POLE: DECLINATION\n");
930 snprintf(buf,
sizeof(buf),
"\n PRIME MERIDIAN: W0 (OFFSET)");
934 snprintf(buf,
sizeof(buf),
"\n : WDOT (SPIN RATE)");
938 snprintf(buf,
sizeof(buf),
"\n :W ACCELERATION");
945 snprintf(buf,
sizeof(buf),
"\n RADII: MEAN");
949 snprintf(buf,
sizeof(buf),
"\n RADII: TRIAXIAL");
955 snprintf(buf,
sizeof(buf),
"\n\nJIGSAW: RESULTS\n===============\n");
957 snprintf(buf,
sizeof(buf),
"\n Images: %6d",numImages);
959 snprintf(buf,
sizeof(buf),
"\n Points: %6d",numValidPoints);
962 if (numValidLidarPoints > 0) {
963 snprintf(buf,
sizeof(buf),
"\n Lidar Points: %6d",numValidLidarPoints);
967 snprintf(buf,
sizeof(buf),
"\n Total Measures: %6d",
972 snprintf(buf,
sizeof(buf),
"\n Total Observations: %6d",
977 snprintf(buf,
sizeof(buf),
"\n Good Observations: %6d",
981 snprintf(buf,
sizeof(buf),
"\n Rejected Observations: %6d",
986 snprintf(buf,
sizeof(buf),
"\n Constrained Point Parameters: %6d",
992 snprintf(buf,
sizeof(buf),
"\n Constrained Image Parameters: %6d",
998 snprintf(buf,
sizeof(buf),
"\n Constrained Target Parameters: %6d",
1004 snprintf(buf,
sizeof(buf),
"\n Lidar Range Constraints: %6d",
1009 snprintf(buf,
sizeof(buf),
"\n Unknowns: %6d",
1013 if (numInnerConstraints > 0) {
1014 snprintf(buf,
sizeof(buf),
"\n Inner Constraints: %6d", numInnerConstraints);
1018 if (numDistanceConstraints > 0) {
1019 snprintf(buf,
sizeof(buf),
"\n Distance Constraints: %d", numDistanceConstraints);
1023 snprintf(buf,
sizeof(buf),
"\n Degrees of Freedom: %6d", numDegreesOfFreedom);
1026 snprintf(buf,
sizeof(buf),
"\n Convergence Criteria: %6.3g",
1030 if (convergenceCriteria == 1) {
1031 snprintf(buf,
sizeof(buf),
"(Sigma0)");
1039 snprintf(buf,
sizeof(buf),
"(Maximum reached)");
1045 snprintf(buf,
sizeof(buf),
" Error Propagation Elapsed Time: %6.4lf (seconds)\n",
1048 snprintf(buf,
sizeof(buf),
" Total Elapsed Time: %6.4lf (seconds)\n",
1054 snprintf(buf,
sizeof(buf),
"\n Residual Percentiles:\n");
1060 for (
int bin = 1;bin < 34;bin++) {
1061 double cumProb = double(bin) / 100.0;
1064 residualsCumulativeProbabilityDistribution().value(cumProb);
1067 residualsCumulativeProbabilityDistribution().value(cumProb + 0.33);
1070 residualsCumulativeProbabilityDistribution().value(cumProb + 0.66);
1071 snprintf(buf,
sizeof(buf),
" Percentile %3d: %+8.3lf"
1072 " Percentile %3d: %+8.3lf"
1073 " Percentile %3d: %+8.3lf\n",
1075 bin + 33, resValue33,
1076 bin + 66, resValue66);
1081 QString msg =
"Failed to output residual percentiles for bundleout";
1085 snprintf(buf,
sizeof(buf),
"\n Residual Box Plot:");
1087 snprintf(buf,
sizeof(buf),
"\n minimum: %+8.3lf",
1090 snprintf(buf,
sizeof(buf),
"\n Quartile 1: %+8.3lf",
1093 snprintf(buf,
sizeof(buf),
"\n Median: %+8.3lf",
1096 snprintf(buf,
sizeof(buf),
"\n Quartile 3: %+8.3lf",
1099 snprintf(buf,
sizeof(buf),
"\n maximum: %+8.3lf\n",
1104 QString msg =
"Failed to output residual box plot for bundleout";
1111 int filePadding = 0;
1113 for (
int i = 0; i < numObservations; i++) {
1117 for (
int j = 0; j < numImagesInObservation; j++) {
1120 if (bundleImage->fileName().length() > filePadding) {
1121 filePadding = bundleImage->fileName().length();
1126 snprintf(buf,
sizeof(buf),
"\nIMAGE MEASURES SUMMARY\n==========================\n\n");
1131 QString header(
"Measures RMS(pixels)");
1133 header +=
" Lidar RMS(pixels)";
1136 snprintf(buf,
sizeof(buf),
"%*s\n", header.length() + 11 + filePadding, header.toLatin1().data());
1139 QString dividers(
"*************************** *******************************************");
1141 dividers +=
" *******************************************";
1143 snprintf(buf,
sizeof(buf),
"%*s\n", dividers.length() + 1 + filePadding, dividers.toLatin1().data());
1146 QString fields(
"| Accepted | Total | | Samples | Lines | Total |");
1148 fields +=
" | Samples | Lines | Total |";
1150 snprintf(buf,
sizeof(buf),
"%*s\n", fields.length() + 1 + filePadding, fields.toLatin1().data());
1153 int numMeasures, numLidarMeasures;
1154 int numRejectedMeasures, numLidarRejectedMeasures;
1155 int numUsed, numLidarUsed;
1157 Statistics rmsSamplesTotal,rmsLinesTotal,rmsTotals;
1159 for (
int i = 0; i < numObservations; i++) {
1163 for (
int j = 0; j < numImagesInObservation; j++) {
1168 rmsImageSampleResiduals()[imageIndex].Rms();
1170 rmsImageLineResiduals()[imageIndex].Rms();
1172 rmsImageResiduals()[imageIndex].Rms();
1173 rmsSamplesTotal.AddData(rmsSampleResiduals);
1174 rmsLinesTotal.AddData(rmsLineResiduals);
1175 rmsTotals.AddData(rmsLandSResiduals);
1178 (bundleImage->serialNumber());
1181 GetNumberOfJigsawRejectedMeasuresInImage(bundleImage->serialNumber());
1183 numUsed = numMeasures - numRejectedMeasures;
1185 QString filename = bundleImage->fileName();
1187 List = filename.split(
"/");
1189 snprintf(buf,
sizeof(buf),
"%-*s" ,filePadding + 1, bundleImage->fileName().toLatin1().data());
1192 snprintf(buf,
sizeof(buf),
" %12d %12d ", numUsed, numMeasures);
1195 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf",
1196 rmsSampleResiduals,rmsLineResiduals,rmsLandSResiduals);
1202 rmsLidarImageSampleResiduals()[imageIndex].Rms();
1204 rmsLidarImageLineResiduals()[imageIndex].Rms();
1206 rmsLidarImageResiduals()[imageIndex].Rms();
1209 GetNumberOfValidMeasuresInImage(bundleImage->serialNumber());
1212 GetNumberOfJigsawRejectedMeasuresInImage(bundleImage->serialNumber());
1214 numLidarUsed = numLidarMeasures - numLidarRejectedMeasures;
1216 snprintf(buf,
sizeof(buf),
" %12d %12d ", numLidarUsed, numLidarMeasures);
1219 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf",
1220 rmsLidarSampleResiduals,rmsLidarLineResiduals,rmsLidarLandSResiduals);
1225 snprintf(buf,
sizeof(buf),
" \n");
1233 snprintf(buf,
sizeof(buf),
"%*s", -(filePadding + 33),
"\nTotal RMS:");
1235 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf\n",
1236 rmsSamplesTotal.Rms(),rmsLinesTotal.Rms(),rmsTotals.Rms());
1262 bool errorProp =
false;
1267 QList<QString> outputCsvFileNames;
1270 if (instrumentIds.size() == 1) {
1271 QString ofname =
"bundleout_images.csv";
1272 ofname =
m_settings->outputFilePrefix() + ofname;
1273 m_csvSavedImagesFilename = ofname;
1274 outputCsvFileNames.push_back(ofname);
1278 for (
int i = 0; i < instrumentIds.size(); i++) {
1279 QString updatedInstrumentId = instrumentIds[i];
1283 updatedInstrumentId.replace(
"/",
"_").replace(
" ",
"_");
1284 QString ofname =
"bundleout_images_" + updatedInstrumentId +
".csv";
1285 ofname =
m_settings->outputFilePrefix() + ofname;
1286 m_csvSavedImagesFilename = ofname;
1287 outputCsvFileNames.push_back(ofname);
1291 for (
int i = 0; i < instrumentIds.size(); i++) {
1293 std::ofstream fpOut(outputCsvFileNames[i].toLatin1().data(), std::ios::out);
1298 QList<BundleObservationQsp> observations =
1301 int nObservations = observations.size();
1305 for (
int j = 0; j < nObservations; j++ ) {
1310 int observationIndex = observation->index();
1312 for (
int obsIndex = 0; obsIndex < observationIndex; obsIndex++) {
1320 int numImages = observation->size();
1322 for (
int k = 0; k < numImages; k++) {
1325 snprintf(buf,
sizeof(buf),
"%s", image->fileName().toLatin1().data());
1327 snprintf(buf,
sizeof(buf),
",");
1330 fpOut <<
toString(rmsImageSampleResiduals[imgIndex].Rms()).toLatin1().data();
1331 snprintf(buf,
sizeof(buf),
",");
1334 fpOut <<
toString(rmsImageLineResiduals[imgIndex].Rms()).toLatin1().data();
1335 snprintf(buf,
sizeof(buf),
",");
1338 fpOut <<
toString(rmsImageResiduals[imgIndex].Rms()).toLatin1().data();
1339 snprintf(buf,
sizeof(buf),
",");
1342 QString observationString =
1343 observation->bundleOutputCSV(errorProp);
1346 if (observationString.right(1)==
",") {
1347 observationString.truncate(observationString.length()-1);
1350 fpOut << (
const char*) observationString.toLatin1().data();
1352 snprintf(buf,
sizeof(buf),
"\n");
1372 QString ofname =
"bundleout.txt";
1373 ofname =
m_settings->outputFilePrefix() + ofname;
1375 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1380 m_txtBundleOutputFilename = ofname;
1389 bool berrorProp =
false;
1396 snprintf(buf,
sizeof(buf),
"\nTARGET BODY\n==========================\n");
1399 snprintf(buf,
sizeof(buf),
"\n Target Initial Total "
1400 "Final Initial Final\n"
1401 "Parameter Value Correction "
1402 "Value Accuracy Accuracy\n");
1405 QString targetString =
1406 m_settings->bundleTargetBody()->formatBundleOutputString(berrorProp);
1407 fpOut << (
const char*)targetString.toLatin1().data();
1411 snprintf(buf,
sizeof(buf),
"\nIMAGE EXTERIOR ORIENTATION\n==========================\n");
1414 QMap<QString, QStringList> imagesAndParameters;
1417 imagesAndParameters.insert(
"target",
m_settings->bundleTargetBody()->parameterList() );
1420 for (
int i = 0; i < nObservations; i++) {
1427 int numImages = observation->size();
1428 for (
int j = 0; j < numImages; j++) {
1430 snprintf(buf,
sizeof(buf),
"\nImage Full File Name: %s\n", image->fileName().toLatin1().data());
1432 snprintf(buf,
sizeof(buf),
"\nImage Serial Number: %s\n", image->serialNumber().toLatin1().data());
1435 snprintf(buf,
sizeof(buf),
"Image Initial Total Final Accuracy\n");
1437 snprintf(buf,
sizeof(buf),
"Parameter Value Correction Value Initial Final Units\n");
1440 snprintf(buf,
sizeof(buf),
" "
1441 "***************************************\n");
1444 observation->bundleOutputString(fpOut,berrorProp);
1446 foreach ( QString image, observation->imageNames() ) {
1447 imagesAndParameters.insert( image, observation->parameterList() );
1460 snprintf(buf,
sizeof(buf),
"\n\n\nPOINTS UNCERTAINTY SUMMARY\n==========================\n\n");
1467 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1470 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1474 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n\n", coordName.toLatin1().data(),
1482 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1485 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1489 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n\n", coordName.toLatin1().data(),
1496 SurfacePoint::Three);
1498 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1501 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1505 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1511 snprintf(buf,
sizeof(buf),
" RMS Sigma Radius(m) N/A\n");
1513 snprintf(buf,
sizeof(buf),
" MIN Sigma Radius(m) N/A\n");
1515 snprintf(buf,
sizeof(buf),
" MAX Sigma Radius(m) N/A\n");
1522 snprintf(buf,
sizeof(buf),
"\n\nPOINTS SUMMARY\n==============\n%103s"
1523 "Sigma Sigma Sigma\n"
1524 " Label Status Rays RMS"
1525 " Latitude Longitude Radius"
1526 " Latitude Longitude Radius\n",
"");
1529 snprintf(buf,
sizeof(buf),
"\n\nPOINTS SUMMARY\n==============\n%103s"
1530 "Sigma Sigma Sigma\n"
1531 " Label Status Rays RMS"
1532 " Point X Point Y Point Z"
1533 " Point X Point Y Point Z\n",
"");
1538 for (
int i = 0; i < nPoints; i++) {
1541 QString pointSummaryString =
1542 bundleControlPoint->formatBundleOutputSummaryString(berrorProp);
1543 fpOut << (
const char*)pointSummaryString.toLatin1().data();
1547 for (
int i = 0; i < nLidarPoints; i++) {
1551 QString pointSummaryString =
1552 lidarControlPoint->formatBundleOutputSummaryString(berrorProp);
1553 fpOut << (
const char*)pointSummaryString.toLatin1().data();
1557 snprintf(buf,
sizeof(buf),
"\n\nPOINTS DETAIL\n=============\n\n");
1560 bool solveRadius =
m_settings->solveRadius();
1562 for (
int i = 0; i < nPoints; i++) {
1566 QString pointDetailString =
1567 bundleControlPoint->formatBundleOutputDetailString(berrorProp, solveRadius);
1568 fpOut << (
const char*)pointDetailString.toLatin1().data();
1571 for (
int i = 0; i < nLidarPoints; i++) {
1575 QString pointDetailString =
1576 bundleLidarControlPoint->formatBundleOutputDetailString(berrorProp, solveRadius);
1577 fpOut << (
const char*)pointDetailString.toLatin1().data();
1594 QString ofname =
"bundleout_points.csv";
1595 ofname =
m_settings->outputFilePrefix() + ofname;
1596 m_csvSavedPointsFilename = ofname;
1598 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1605 double dLat, dLon, dRadius;
1607 double dSigmaLat, dSigmaLong, dSigmaRadius;
1612 int numMeasures, numRejectedMeasures;
1613 double dResidualRms;
1617 snprintf(buf,
sizeof(buf),
",,,,,3-d,3-d,3-d,Sigma,Sigma,Sigma,Correction,Correction,Correction,Coordinate,"
1618 "Coordinate,Coordinate\nPoint,Point,Accepted,Rejected,Residual,Latitude,Longitude,"
1619 "Radius,Latitude,Longitude,Radius,Latitude,Longitude,Radius,X,Y,Z\nLabel,Status,"
1620 "Measures,Measures,RMS,(dd),(dd),(km),(m),(m),(m),(m),(m),(m),(km),(km),(km)\n");
1623 snprintf(buf,
sizeof(buf),
",,,,,3-d,3-d,3-d,Correction,Correction,Correction,Coordinate,Coordinate,"
1624 "Coordinate\nPoint,Point,Accepted,Rejected,Residual,Latitude,Longitude,Radius,"
1625 "Latitude,Longitude,Radius,X,Y,Z\nLabel,Status,Measures,Measures,RMS,(dd),(dd),(km),"
1626 "(m),(m),(m),(km),(km),(km)\n");
1630 for (
int i = 0; i < numPoints; i++) {
1633 if (!bundlecontrolpoint) {
1637 if (bundlecontrolpoint->isRejected()) {
1641 dLat = bundlecontrolpoint->adjustedSurfacePoint().GetLatitude().degrees();
1642 dLon = bundlecontrolpoint->adjustedSurfacePoint().GetLongitude().degrees();
1643 dRadius = bundlecontrolpoint->adjustedSurfacePoint().GetLocalRadius().kilometers();
1644 dX = bundlecontrolpoint->adjustedSurfacePoint().GetX().kilometers();
1645 dY = bundlecontrolpoint->adjustedSurfacePoint().GetY().kilometers();
1646 dZ = bundlecontrolpoint->adjustedSurfacePoint().GetZ().kilometers();
1647 numMeasures = bundlecontrolpoint->numberOfMeasures();
1648 numRejectedMeasures = bundlecontrolpoint->numberOfRejectedMeasures();
1649 dResidualRms = bundlecontrolpoint->residualRms();
1652 boost::numeric::ublas::bounded_vector< double, 3 > corrections = bundlecontrolpoint->
1655 cor_lat_m = bundlecontrolpoint->adjustedSurfacePoint().LatitudeToMeters(corrections[0]);
1656 cor_lon_m = bundlecontrolpoint->adjustedSurfacePoint().LongitudeToMeters(corrections[1]);
1657 cor_rad_m = corrections[2]*1000.0;
1660 strStatus =
"FIXED";
1663 strStatus =
"CONSTRAINED";
1669 strStatus =
"UNKNOWN";
1673 dSigmaLat = bundlecontrolpoint->adjustedSurfacePoint().GetLatSigmaDistance().meters();
1674 dSigmaLong = bundlecontrolpoint->adjustedSurfacePoint().GetLonSigmaDistance().meters();
1675 dSigmaRadius = bundlecontrolpoint->adjustedSurfacePoint().GetLocalRadiusSigma().meters();
1677 snprintf(buf,
sizeof(buf),
"%s,%s,%d,%d,%6.2lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,"
1678 "%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1679 bundlecontrolpoint->id().toLatin1().data(), strStatus.toLatin1().data(),
1680 numMeasures, numRejectedMeasures, dResidualRms, dLat, dLon, dRadius, dSigmaLat,
1681 dSigmaLong, dSigmaRadius, cor_lat_m, cor_lon_m, cor_rad_m, dX, dY, dZ);
1684 snprintf(buf,
sizeof(buf),
"%s,%s,%d,%d,%6.2lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,"
1685 "%16.8lf,%16.8lf\n",
1686 bundlecontrolpoint->id().toLatin1().data(), strStatus.toLatin1().data(),
1687 numMeasures, numRejectedMeasures, dResidualRms, dLat, dLon, dRadius, cor_lat_m,
1688 cor_lon_m, cor_rad_m, dX, dY, dZ);
1707 QString ofname =
"bundleout_lidar.csv";
1708 ofname =
m_settings->outputFilePrefix() + ofname;
1709 m_csvSavedPointsFilename = ofname;
1711 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1724 snprintf(buf,
sizeof(buf),
",,measured,a priori,adjusted,adjusted\n"
1725 "point,image,range,sigma,range,sigma,residual\n"
1726 "id,name,(km),(km),(km),(km),(km)\n");
1729 snprintf(buf,
sizeof(buf),
",,measured,a priori,adjusted\n"
1730 "point,image,range,sigma,range,residual\n"
1731 "id,name,(km),(km),(km),(km)\n");
1735 for (
int i = 0; i < numPoints; i++) {
1738 if (!point || point->isRejected()) {
1742 int nRangeConstraints = point->numberRangeConstraints();
1743 for (
int j = 0; j < nRangeConstraints; j++) {
1746 QString str = rangeConstraint->formatBundleOutputString(
m_settings->errorPropagation());
1765 QString ofname =
"residuals.csv";
1766 ofname =
m_settings->outputFilePrefix() + ofname;
1767 m_csvSavedResidualsFilename = ofname;
1769 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1776 snprintf(buf,
sizeof(buf),
",,,x image,y image,Measured,Measured,sample,line,Residual Vector\n");
1778 snprintf(buf,
sizeof(buf),
"Point,Image,Image,coordinate,coordinate,"
1779 "Sample,Line,residual,residual,Magnitude\n");
1781 snprintf(buf,
sizeof(buf),
"Label,Filename,Serial Number,(mm),(mm),"
1782 "(pixels),(pixels),(pixels),(pixels),(pixels),Rejected\n");
1788 int numMeasures = 0;
1793 for (
int i = 0; i < numPoints; i++) {
1795 numMeasures = bundleControlPoint->size();
1797 if (bundleControlPoint->rawControlPoint()->IsIgnored()) {
1801 for (
int j = 0; j < numMeasures; j++) {
1802 bundleMeasure = bundleControlPoint->at(j);
1804 Camera *measureCamera = bundleMeasure->camera();
1805 if (!measureCamera) {
1809 if (bundleMeasure->isRejected()) {
1810 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,*\n",
1811 bundleControlPoint->id().toLatin1().data(),
1812 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1813 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1814 bundleMeasure->focalPlaneMeasuredX(),
1815 bundleMeasure->focalPlaneMeasuredY(),
1816 bundleMeasure->sample(),
1817 bundleMeasure->line(),
1818 bundleMeasure->sampleResidual(),
1819 bundleMeasure->lineResidual(),
1820 bundleMeasure->residualMagnitude());
1823 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1824 bundleControlPoint->id().toLatin1().data(),
1825 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1826 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1827 bundleMeasure->focalPlaneMeasuredX(),
1828 bundleMeasure->focalPlaneMeasuredY(),
1829 bundleMeasure->sample(),
1830 bundleMeasure->line(),
1831 bundleMeasure->sampleResidual(),
1832 bundleMeasure->lineResidual(),
1833 bundleMeasure->residualMagnitude());
1844 for (
int i = 0; i < numPoints; i++) {
1846 numMeasures = bundleLidarPoint->size();
1848 if (bundleLidarPoint->rawControlPoint()->IsIgnored()) {
1852 for (
int j = 0; j < numMeasures; j++) {
1853 bundleMeasure = bundleLidarPoint->at(j);
1855 Camera *measureCamera = bundleMeasure->camera();
1856 if (!measureCamera) {
1860 if (bundleMeasure->isRejected()) {
1861 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,*\n",
1862 bundleLidarPoint->id().toLatin1().data(),
1863 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1864 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1865 bundleMeasure->focalPlaneMeasuredX(),
1866 bundleMeasure->focalPlaneMeasuredY(),
1867 bundleMeasure->sample(),
1868 bundleMeasure->line(),
1869 bundleMeasure->sampleResidual(),
1870 bundleMeasure->lineResidual(),
1871 bundleMeasure->residualMagnitude());
1874 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1875 bundleLidarPoint->id().toLatin1().data(),
1876 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1877 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1878 bundleMeasure->focalPlaneMeasuredX(),
1879 bundleMeasure->focalPlaneMeasuredY(),
1880 bundleMeasure->sample(),
1881 bundleMeasure->line(),
1882 bundleMeasure->sampleResidual(),
1883 bundleMeasure->lineResidual(),
1884 bundleMeasure->residualMagnitude());
1916 QString relativePath;
1917 QString relativeBundlePath;
1926 if (oldPath != newPath) {
1928 QDir bundleDir(newPath);
1929 if (!bundleDir.mkpath(bundleDir.path())) {
1931 QString(
"Failed to create directory [%1]")
1932 .arg(bundleSolutionInfoRoot.
path()),
1937 if (!QFile::copy(oldFile, newFile)) {
1939 QString(
"Failed to copy file [%1] to new file [%2]")
1943 newFile = newPath +
"/" +
FileName(m_txtBundleOutputFilename).
name();
1944 if (!QFile::copy(m_txtBundleOutputFilename, newFile)) {
1946 QString(
"Failed to copy file [%1] to new file [%2]")
1947 .arg(m_txtBundleOutputFilename).arg(newFile),
1950 newFile = newPath +
"/" +
FileName(m_csvSavedImagesFilename).
name();
1951 if (!QFile::copy(m_csvSavedImagesFilename, newFile)) {
1953 QString(
"Failed to copy file [%1] to new file [%2]")
1954 .arg(m_csvSavedImagesFilename).arg(newFile),
1957 newFile = newPath +
"/" +
FileName(m_csvSavedPointsFilename).
name();
1958 if (!QFile::copy(m_csvSavedPointsFilename, newFile)) {
1960 QString(
"Failed to copy file [%1] to new file [%2]")
1961 .arg(m_csvSavedPointsFilename).arg(newFile),
1964 newFile = newPath +
"/" +
FileName(m_csvSavedResidualsFilename).
name();
1965 if (!QFile::copy(m_csvSavedResidualsFilename, newFile)) {
1967 QString(
"Failed to copy file [%1] to new file [%2]")
1968 .arg(m_csvSavedResidualsFilename).arg(newFile),
1976 if (relativePath.startsWith(
"/")) {
1977 relativePath.remove(0,1);
1983 if (relativeBundlePath.startsWith(
"/")) {
1984 relativeBundlePath.remove(0,1);
1986 relativeBundlePath +=
"/";
1989 stream.writeStartElement(
"bundleSolutionInfo");
1991 stream.writeStartElement(
"generalAttributes");
1992 stream.writeTextElement(
"id",
m_id->toString());
1993 stream.writeTextElement(
"name",
m_name);
1994 stream.writeTextElement(
"runTime",
runTime());
1996 stream.writeTextElement(
"inputFileName",
1998 stream.writeTextElement(
"bundleOutTXT",
1999 relativeBundlePath +
FileName(m_txtBundleOutputFilename).
name());
2000 stream.writeTextElement(
"imagesCSV",
2001 relativeBundlePath +
FileName(m_csvSavedImagesFilename).
name());
2002 stream.writeTextElement(
"pointsCSV",
2003 relativeBundlePath +
FileName(m_csvSavedPointsFilename).
name());
2004 stream.writeTextElement(
"residualsCSV",
2005 relativeBundlePath +
FileName(m_csvSavedResidualsFilename).
name());
2006 stream.writeEndElement();
2017 stream.writeStartElement(
"imageLists");
2021 stream.writeEndElement();
2025 stream.writeStartElement(
"outputControl");
2027 stream.writeEndElement();
2030 stream.writeEndElement();
2043 SurfacePoint::CoordIndex coordIdx)
const {
2045 switch (
m_settings->controlPointCoordTypeReports()) {
2048 case SurfacePoint::One:
2049 coordName =
" Latitude";
2051 case SurfacePoint::Two:
2052 coordName =
"Longitude";
2054 case SurfacePoint::Three:
2055 coordName =
" Radius";
2058 IString msg =
"Unknown surface point index enum ["
2066 case SurfacePoint::One:
2067 coordName =
"POINT X";
2069 case SurfacePoint::Two:
2070 coordName =
"POINT Y";
2072 case SurfacePoint::Three:
2073 coordName =
"POINT Z";
2076 IString msg =
"Unknown surface point index enum ["
2083 IString msg =
"Unknown surface point coordinate type enum ["
This class is used to modify and manage solve settings for 1 to many BundleObservations.
A container class for statistical results from a BundleAdjust solution.
double elapsedTimeErrorProp() const
Returns the elapsed time for error propagation.
int numberRejectedObservations() const
Returns the number of observation that were rejected.
QString minSigmaCoord2PointId() const
Returns the minimum sigma point id for coordinate 2.
QList< Statistics > rmsImageSampleResiduals() const
Returns the list of RMS image sample residuals statistics.
ControlNetQsp outputControlNet() const
Returns a shared pointer to the output control network.
int numberObservations() const
Returns the number of observations.
MaximumLikelihoodWFunctions maximumLikelihoodModelWFunc(int modelIndex) const
Returns the maximum likelihood model at the given index.
double sigmaCoord3StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 3.
double sigma0() const
Returns the Sigma0 of the bundle adjustment.
bool converged() const
Returns whether or not the bundle adjustment converged.
double maximumLikelihoodModelQuantile(int modelIndex) const
Returns the quantile of the maximum likelihood model at the given index.
int numberConstrainedPointParameters() const
Returns the number of constrained point parameters.
int iterations() const
Returns the number of iterations taken by the BundleAdjust.
QString minSigmaCoord1PointId() const
Returns the minimum sigma point id for coordinate 1.
void save(QXmlStreamWriter &stream, const Project *project) const
Saves the BundleResults object to an XML file.
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.
int numberUnknownParameters() const
Returns the number of unknown parameters.
QVector< BundleLidarControlPointQsp > & bundleLidarControlPoints()
Returns a reference to the BundleLidarControlPoint vector.
LidarDataQsp outputLidarData() const
Returns a shared pointer to the output LidarData object.
double sigmaCoord2StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 2.
Distance minSigmaCoord3Distance() const
Returns the minimum sigma distance for coordinate 3.
QString maxSigmaCoord1PointId() const
Returns the maximum sigma point id for coordinate 1.
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 > rmsImageResiduals() const
Returns the list of RMS image residuals statistics.
const BundleObservationVector & observations() const
Returns a reference to the observations used by the BundleAdjust.
Distance minSigmaCoord1Distance() const
Returns the minimum sigma distance for coordinate 1.
QString minSigmaCoord3PointId() const
Returns the minimum sigma point id for coordinate 3.
QList< Statistics > rmsImageLineResiduals() const
Returns the list of RMS image line residuals statistics.
int numberLidarRangeConstraintEquations() const
Return the number of lidar range constraint equations.
Distance maxSigmaCoord3Distance() const
Returns the maximum sigma distance for coordinate 3.
Distance maxSigmaCoord1Distance() const
Returns the maximum sigma distance for coordinate 1.
QString maxSigmaCoord3PointId() const
Returns the maximum sigma point id for coordinate 3.
QString maxSigmaCoord2PointId() const
Returns the maximum sigma point id for coordinate 2.
int numberConstrainedImageParameters() const
Returns the number of constrained image parameters.
double sigmaCoord1StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 1.
Distance minSigmaCoord2Distance() const
Returns the minimum sigma distance for coordinate 2.
int degreesOfFreedom() const
Returns the degrees of freedom.
Container class for BundleAdjustment settings.
bool outputResiduals()
Outputs image coordinate residuals to a csv file.
bool outputImagesCSV()
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observa...
BundleSettingsQsp m_settings
Bundle settings.
QString inputControlNetFileName() const
Returns the name of the input control network.
QString m_runTime
Run time of the bundle adjustment.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Saves the BundleSolutionInfo to the project.
QString inputLidarDataFileName() const
Returns name of input lidar data file (if any).
void addAdjustedImages(ImageList *images)
Adds a list of images that were adjusted (their labels were updated).
QString savedPointsFilename()
Returns filename of output bundle points csv file.
QUuid * m_id
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when savin...
BundleSettingsQsp bundleSettings()
Returns bundle settings.
void setName(QString name)
Sets the name of the bundle.
QList< ImageList * > * m_adjustedImages
Adjusted image list.
FileName * m_inputControlNetFileName
Input control network file name.
QString m_xmlHandlerCharacters
List of characters that have been handled.
void setOutputControl(Control *outputControl)
Returns the name of the output control network.
QList< ImageList * > adjustedImages() const
Returns the list of images that were adjusted after a bundle.
QList< ImageList * > * m_images
Input image list.
FileName * m_inputLidarDataFileName
Input lidar data file name.
QString surfacePointCoordName(SurfacePoint::CoordinateType type, SurfacePoint::CoordIndex coordInx) const
Determine the control point coordinate name.
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
void setOutputControlName(QString name)
Sets m_outputControlName.
BundleResults bundleResults()
Returns the bundle results.
QString id() const
Get a unique, identifying string associated with this BundleSolutionInfo object.
void setRunTime(QString runTime)
Sets the run time, and the name if a name is not already set.
bool outputPointsCSV()
Outputs point data to a csv file.
QString outputControlName() const
Returns m_outputControlName.
void updateFileName(Project *)
TODO: change description below to something more like english.
QString outputControlNetFileName() const
Returns the name of the output control network.
BundleResults * m_statisticsResults
Bundle statistical results.
~BundleSolutionInfo()
Destructor.
QString runTime() const
Returns the run time.
bool outputHeader(std::ofstream &fpOut)
Output header for bundle results file.
LidarData * m_outputLidarDataSet
QList of adjusted lidar points.
QString name() const
Returns the name of the bundle.
QString savedBundleOutputFilename()
Returns bundleout text filename.
bool outputText()
Outputs a text file with the results of the BundleAdjust.
Control * m_outputControl
Output control.
QString savedImagesFilename()
Returns filename of output bundle images csv file.
QList< ImageList * > imageList()
Returns the images used in the bundle.
void setOutputStatistics(BundleResults statisticsResults)
Sets the stat results.
QString m_name
Name of the bundle. Defaults to the id.
bool outputImagesCSVHeader(std::ofstream &fpOut, BundleObservationQsp observations)
Outputs the header for the bundleout_images.csv file.
Control * control() const
Returns bundle output Control object.
bool outputLidarCSV()
Outputs lidar data to a csv file.
This represents an ISIS control net in a project-based GUI interface.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Method to write this Control object's member data to an XML stream.
QString fileName() const
Access the name of the control network file associated with this Control.
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
double meters() const
Get the distance in meters.
File name manipulation and expansion.
QString path() const
Returns the path of the file name.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
@ 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.
Internalizes a list of images and allows for operations on the entire list.
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
QString weightedResidualCutoff()
Method to return a string represtentation of the weighted residual cutoff (if it exists) for the Maxi...
double tweakingConstant() const
Returns the current tweaking constant.
The main project for ipce.
static QString cnetRoot(QString projectRoot)
Appends the root directory name 'cnets' to the project.
QString bundleSolutionInfoRoot() const
Accessor for the root directory of the results data.
static QString bundleSolutionInfoRoot(QString projectRoot)
Appends the root directory name 'bundle' to the project results directory.
QString newProjectRoot() const
Get the top-level folder of the new project.
QString projectRoot() const
Get the top-level folder of the project.
double min()
Returns the maximum observation so far included in the dynamic calculation.
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
double max()
Returns the maximum observation so far included in the dynamic calculation.
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.
static QString coordinateTypeToString(CoordinateType type)
Converts the given SurfacePoint::CoordinateType enumeration to a string.
static QString CurrentLocalTime()
Returns the current local time This time is taken directly from the system clock, so if the system cl...
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
QSharedPointer< BundleLidarRangeConstraint > BundleLidarRangeConstraintQsp
Typdef for BundleLidarRangeConstraint QSharedPointer.
const double Null
Value for an Isis Null pixel.