40static void usage(
const char* name)
42 std::cout << name <<
": remove wrong control points by statistic method" << std::endl
45 <<
"Usage: " << name <<
" [options] input.pto" << std::endl
47 <<
"CPClean uses statistical methods to remove wrong control points" << std::endl << std::endl
48 <<
"Step 1 optimises all images pairs, calculates for each pair mean " << std::endl
49 <<
" and standard deviation and removes all control points " << std::endl
50 <<
" with error bigger than mean+n*sigma" << std::endl
51 <<
"Step 2 optimises the whole panorama, calculates mean and standard deviation" << std::endl
52 <<
" for all control points and removes all control points with error" << std::endl
53 <<
" bigger than mean+n*sigma" << std::endl << std::endl
54 <<
" Options:" << std::endl
55 <<
" --output|-o file.pto Output Hugin PTO file." << std::endl
56 <<
" Default: '<filename>_clean.pto'." << std::endl
57 <<
" --max-distance|-n num distance factor for checking (default: 2)" << std::endl
58 <<
" (cps with an error > mean + this factor*sigma" << std::endl
59 <<
" will be removed)" << std::endl
60 <<
" --pairwise-checking|-p do only images pairs cp checking (skip step 2)" << std::endl
61 <<
" --whole-pano-checking|-w do only whole panorama cp checking (skip step 1)" << std::endl
62 <<
" --dont-optimize|-s skip optimisation step when checking the" << std::endl
63 <<
" whole panorama (only step 2)" << std::endl
64 <<
" --check-line-cp|-l also include line control points for calculation" << std::endl
65 <<
" and filtering in step 2" << std::endl
66 <<
" --verbose|-v verbose output during optimisation"<<std::endl
67 <<
" --help|-h shows help" << std::endl
104 bool verbose =
false;
185 std::cerr <<
"Panorama should consist of at least two images" << std::endl;
191 std::cerr <<
"Panorama should contain at least 3 control point" << std::endl;
206 std::cout <<
"Step 1: Do image pair control point checking..." << std::endl;
226 std::cout <<
"Step 2: Do whole panorama control point checking..." << std::endl;
229 std::cout <<
" Skipping optimisation, current image positions will be used." << std::endl;
240 std::cout <<
"Skipping whole panorama checking because of unconnected image groups" << std::endl;
244 std::cout << std::endl;
247 std::cout <<
"Removed " <<
cpremoved1 <<
" control points in step 1" << std::endl;
253 std::cout <<
"Skipped step 2 because of unconnected image pairs" << std::endl;
257 std::cout <<
"Removed " <<
CPtoRemove.size() <<
" control points in step 2" << std::endl;
266 std::cout << std::endl <<
"Written output to " <<
output << std::endl;
algorithms for remove control points by statistic method
!! from PTOptimise.h 1951
Dummy progress display, without output.
bool ReadPTOFile(const std::string &filename, const std::string &prefix="")
read pto file from the given filename into Panorama object it does some checks on the file and issues...
std::size_t getNrOfCtrlPoints() const
number of control points
bool WritePTOFile(const std::string &filename, const std::string &prefix="")
write data to given pto file
void removeCtrlPoint(unsigned int pNr)
remove a control point.
std::size_t getNrOfImages() const
number of images.
class to work with images graphs created from a HuginBase::Panorama class it creates a graph based on...
static int ptProgress(int command, char *argument)
int main(int argc, char *argv[])
static int ptinfoDlg(int command, char *argument)
std::set< unsigned int > UIntSet
std::string GetHuginVersion()
return a string with version numbers
std::string GetOutputFilename(const std::string &out, const std::string &in, const std::string &suffix)
construct output filename, if ouput is known return this value otherwise use the input filename and a...
std::string stripPath(const std::string &filename)
remove the path of a filename (mainly useful for gui display of filenames)
std::string getPathPrefix(const std::string &filename)
Get the path to a filename.
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.