本文整理汇总了C++中UIntSet::rend方法的典型用法代码示例。如果您正苦于以下问题:C++ UIntSet::rend方法的具体用法?C++ UIntSet::rend怎么用?C++ UIntSet::rend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIntSet
的用法示例。
在下文中一共展示了UIntSet::rend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
return 1;
};
if (onlyPair && wholePano)
{
cerr << "Options -p and -w can't used together" << endl;
return 1;
};
string input=argv[optind];
Panorama pano;
ifstream prjfile(input.c_str());
if (!prjfile.good()) {
cerr << "could not open script : " << input << endl;
return 1;
}
pano.setFilePrefix(hugin_utils::getPathPrefix(input));
DocumentData::ReadWriteError err = pano.readData(prjfile);
if (err != DocumentData::SUCCESSFUL) {
cerr << "error while parsing panos tool script: " << input << endl;
cerr << "DocumentData::ReadWriteError code: " << err << endl;
return 1;
}
size_t nrImg=pano.getNrOfImages();
if (nrImg < 2)
{
cerr << "Panorama should consist of at least two images" << endl;
return 1;
}
if (pano.getNrOfCtrlPoints() < 3)
{
cerr << "Panorama should contain at least 3 control point" << endl;
};
size_t cpremoved1=0;
UIntSet CPtoRemove;
// step 1 with pairwise optimisation
if(!wholePano)
{
CPtoRemove=getCPoutsideLimit_pair(pano,n);
if (CPtoRemove.size()>0)
for(UIntSet::reverse_iterator it = CPtoRemove.rbegin(); it != CPtoRemove.rend(); ++it)
pano.removeCtrlPoint(*it);
cpremoved1=CPtoRemove.size();
};
// step 2 with optimisation of whole panorama
bool unconnected=false;
if(!onlyPair)
{
//check for unconnected images
CPGraph graph;
createCPGraph(pano, graph);
CPComponents comps;
int parts=findCPComponents(graph, comps);
if (parts > 1)
{
unconnected=true;
}
else
{
CPtoRemove.clear();
if(skipOptimisation)
{
std::cout << endl << "Skipping optimisation, current image positions will be used." << endl;
};
CPtoRemove=getCPoutsideLimit(pano,n,skipOptimisation);
if (CPtoRemove.size()>0)
for(UIntSet::reverse_iterator it = CPtoRemove.rbegin(); it != CPtoRemove.rend(); ++it)
pano.removeCtrlPoint(*it);
};
};
cout << endl;
if(!wholePano)
cout << "Removed " << cpremoved1 << " control points in step 1" << endl;
if(!onlyPair)
if(unconnected)
cout <<"Skipped step 2 because of unconnected image pairs" << endl;
else
cout << "Removed " << CPtoRemove.size() << " control points in step 2" << endl;
//write output
OptimizeVector optvec = pano.getOptimizeVector();
UIntSet imgs;
fill_set(imgs,0, pano.getNrOfImages()-1);
// Set output .pto filename if not given
if (output=="")
{
output=input.substr(0,input.length()-4).append("_clean.pto");
}
ofstream of(output.c_str());
pano.printPanoramaScript(of, optvec, pano.getOptions(), imgs, false, hugin_utils::getPathPrefix(input));
cout << endl << "Written output to " << output << endl;
return 0;
}