Example for generating synthetic matches using rigs of cameras
- Author
- MIP
#include <iostream>
#include <Base/Common/BIASpragma.hh>
#include <Utils/GenSynthMatchesRig.hh>
#include <Base/Image/ImageIO.hh>
#include <sstream>
#include <string>
using namespace BIAS;
using namespace std;
#define DEFAULT_PARA_FILE_NAME "GenSynthMatchesRig.ini"
#define DEBUG true
int main(int argc, char *argv[])
{
bool FoundDefaultParaFile=true;
ifstream is(DEFAULT_PARA_FILE_NAME);
if (!is){
is.close();
if (DEBUG) cerr << "reading "<<DEFAULT_PARA_FILE_NAME<<" failed"<<endl;
FoundDefaultParaFile=false;
} else {
if (DEBUG) cerr << "reading "<<DEFAULT_PARA_FILE_NAME<<endl;
}
if (argind<0){
BIASERR("error parsing command line");
return -1;
}
if ((!FoundDefaultParaFile) && (*para.
GetParamString(
"readconfig")==
"")) {
cerr << "no parameter file found, writing default to "
<<DEFAULT_PARA_FILE_NAME<<"\n";
}
gsm.CreateMatches();
cout << gsm <<endl;
std::vector<Image<unsigned char> >im;
gsm.DrawTrue(im, 0, 1);
std::vector<Image<unsigned char> >::iterator imIt;
stringstream oss;
int i;
for (imIt = im.begin(), i = 0; imIt != im.end(); imIt++, i++) {
oss << i;
oss.str("");
}
return 0;
}