00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <qvsfm.h>
00026
00027 #include <QFile>
00028 #include <QTextStream>
00029 bool writeMatchingsToBundlerMatchingsFile(const QString &fileName, const QVDirectedGraph< QVector<QVIndexPair> > &keyFrameCorrespondences)
00030 {
00031 QFile matchingsFile(fileName);
00032
00033 matchingsFile.open(QIODevice::WriteOnly | QIODevice::Text);
00034
00035 QTextStream outFile(&matchingsFile);
00036
00037 bool cond = false;
00038
00039 foreach(QVGraphLink link, keyFrameCorrespondences.keys())
00040 {
00041 if (cond)
00042 outFile << "\n";
00043
00044 outFile << link.x() << " " << link.y();
00045 outFile << "\n" << keyFrameCorrespondences[link].count();
00046 foreach(QVIndexPair pair, keyFrameCorrespondences[link])
00047 outFile << "\n" << pair.first << " " << pair.second;
00048
00049 cond = true;
00050 }
00051
00052 matchingsFile.close();
00053 }
00054