Difference between revisions of "Cpclean"

From PanoTools.org Wiki
Jump to navigation Jump to search
m (Add -p and -w options)
 
(6 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
===Step 1===
 
===Step 1===
optimises each pair of photos one at a time and deletes all points that can't be made to fit.
+
optimises all image pairs, calculates for each pair mean and standard deviation sigma and then deletes all control points with an error bigger then mean+n*sigma.
  
 
===Step 2===
 
===Step 2===
optimises the whole project together using more conservative assumptions and deletes another round of points.  
+
optimises the whole project together using more conservative assumptions, calculates then mean and standard deviation sigma and then deletes another round of control points with error bigger then mean+n*sigma. If there is more than one image chain present this step is not done.
  
 
===result===
 
===result===
The .pto project file is returned unoptimised, the only change is that there are less control points, this means the project doesn't have to be optimised before you start.
+
The .pto project file is returned unoptimised, the only change is that there are less control points, this means the project doesn't have to be optimised before you start.
 +
The results of the internal optimisations are only used for the calculation of the mean and cp error and for the cp error checking. At the end the optimisation results are disregarded.
  
 
By using this optimisation step '''cpclean''' is able to look not just at the current project settings and find 'bad' points, but is able to find points that are 'bad' under a range of circumstances.
 
By using this optimisation step '''cpclean''' is able to look not just at the current project settings and find 'bad' points, but is able to find points that are 'bad' under a range of circumstances.
Line 17: Line 18:
 
A typical usage would be:
 
A typical usage would be:
  
   cpclean -o output.pto project.pto
+
   cpclean --output=output.pto project.pto
  
 
===Options===
 
===Options===
Vary the threshold with the -n parameter (defaults to 2, i.e. points with a distance error greater than twice the standard deviation are deleted):
+
Vary the threshold with the <tt>--max-distance</tt> parameter (defaults to 2, i.e. points with a distance error greater than mean + 2 * sigma are deleted). E.g. when decreasing this factor to 1, then cp with error bigger than mean+1*sigma will be removed, therefore removing more control points:
  
   cpclean -n 1 -o output.pto project.pto
+
   cpclean --max-distance=1 --output=output.pto project.pto
  
Do only pairwise optimisation (skip step 2):
+
Do only image pair cp checking (skip step 2):
  
   cpclean -p -o output.pto project.pto
+
   cpclean --pairwise-checking --output=output.pto project.pto
  
Do only whole panorama optimasation (skip step 1):
+
Do only whole panorama cp checking (skip step 1):
  
   cpclean -w -o output.pto project.pto
+
   cpclean --whole-pano-checking --output=output.pto project.pto
  
 +
Do only whole panorama cp checking and use current image positions for calculation of distance errors (skip optimisation of whole panorama):
 +
 +
  cpclean --whole-pano-checking --dont-optimize --output=output.pto project.pto
 +
 +
By default line control point are ignored by the calculations for step 2. With <tt>--check-line-cp</tt> you can also include these control points into calculation
 +
 +
  cpclean --whole-pano-checking --check-line-cp --output=output.pto project.pto
 +
 +
The progress of the whole panorama optimisation can be shown with the <tt>--verbose</tt> option
 +
 +
  cpclean --verbose --output=output.pto project.pto
  
 
'''cpclean''' is based on [[ptoclean]].
 
'''cpclean''' is based on [[ptoclean]].

Latest revision as of 16:14, 22 May 2022

cpclean is a command-line tool that implements the 'bad' control points pruning available within the Hugin GUI. It is similar conceptually to apclean, but with some extra functionality. Both tools use a statistical filter to remove points with an error above a statistical threshold.

The idea is to remove all non-credible control points. To do this it uses a two step process to remove bad control points.

Step 1

optimises all image pairs, calculates for each pair mean and standard deviation sigma and then deletes all control points with an error bigger then mean+n*sigma.

Step 2

optimises the whole project together using more conservative assumptions, calculates then mean and standard deviation sigma and then deletes another round of control points with error bigger then mean+n*sigma. If there is more than one image chain present this step is not done.

result

The .pto project file is returned unoptimised, the only change is that there are less control points, this means the project doesn't have to be optimised before you start. The results of the internal optimisations are only used for the calculation of the mean and cp error and for the cp error checking. At the end the optimisation results are disregarded.

By using this optimisation step cpclean is able to look not just at the current project settings and find 'bad' points, but is able to find points that are 'bad' under a range of circumstances.

usage

A typical usage would be:

 cpclean --output=output.pto project.pto

Options

Vary the threshold with the --max-distance parameter (defaults to 2, i.e. points with a distance error greater than mean + 2 * sigma are deleted). E.g. when decreasing this factor to 1, then cp with error bigger than mean+1*sigma will be removed, therefore removing more control points:

 cpclean --max-distance=1 --output=output.pto project.pto

Do only image pair cp checking (skip step 2):

 cpclean --pairwise-checking --output=output.pto project.pto

Do only whole panorama cp checking (skip step 1):

 cpclean --whole-pano-checking --output=output.pto project.pto

Do only whole panorama cp checking and use current image positions for calculation of distance errors (skip optimisation of whole panorama):

 cpclean --whole-pano-checking --dont-optimize --output=output.pto project.pto

By default line control point are ignored by the calculations for step 2. With --check-line-cp you can also include these control points into calculation

 cpclean --whole-pano-checking --check-line-cp --output=output.pto project.pto

The progress of the whole panorama optimisation can be shown with the --verbose option

 cpclean --verbose --output=output.pto project.pto

cpclean is based on ptoclean.