Package boofcv.abst.geo.bundle
Class BundleAdjustmentSchur<Structure extends SceneStructure,M extends org.ejml.data.DMatrix>
- java.lang.Object
-
- boofcv.abst.geo.bundle.BundleAdjustmentSchur<Structure,M>
-
- All Implemented Interfaces:
BundleAdjustment<Structure>,org.ddogleg.struct.Stoppable
- Direct Known Subclasses:
BundleAdjustmentSchur_DDRM,BundleAdjustmentSchur_DSCC
public class BundleAdjustmentSchur<Structure extends SceneStructure,M extends org.ejml.data.DMatrix> extends java.lang.Object implements BundleAdjustment<Structure>
Implementation of bundle adjustment using Shur Complement and generic sparse matrices.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBundleAdjustmentSchur.Codec<Structure extends SceneStructure>static interfaceBundleAdjustmentSchur.FunctionResiduals<Structure extends SceneStructure>static interfaceBundleAdjustmentSchur.Jacobian<Structure extends SceneStructure,M extends org.ejml.data.DMatrix>
-
Constructor Summary
Constructors Constructor Description BundleAdjustmentSchur(org.ddogleg.optimization.UnconstrainedLeastSquaresSchur<M> minimizer, BundleAdjustmentSchur.FunctionResiduals<Structure> function, BundleAdjustmentSchur.Jacobian<Structure,M> jacobian, BundleAdjustmentSchur.Codec<Structure> codec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(double ftol, double gtol, int maxIterations)Configures optimization parameters.doublegetFitScore()Returns the fit score.booleanisStopRequested()booleanoptimize(Structure output)Optimises the parameters contained in 'structure' to minimize the error in the 'observations'.voidrequestStop()voidsetParameters(Structure structure, SceneObservations observations)Specifies the optimization parameters.voidsetVerbose(java.io.PrintStream out, int level)If set to a non-null output then extra information will be printed to the specified stream.
-
-
-
Constructor Detail
-
BundleAdjustmentSchur
public BundleAdjustmentSchur(org.ddogleg.optimization.UnconstrainedLeastSquaresSchur<M> minimizer, BundleAdjustmentSchur.FunctionResiduals<Structure> function, BundleAdjustmentSchur.Jacobian<Structure,M> jacobian, BundleAdjustmentSchur.Codec<Structure> codec)
-
-
Method Detail
-
configure
public void configure(double ftol, double gtol, int maxIterations)Description copied from interface:BundleAdjustmentConfigures optimization parameters. meaning of all of these parameters is implementation dependent. They might even be ignored.- Specified by:
configurein interfaceBundleAdjustment<Structure extends SceneStructure>- Parameters:
ftol- Relative threshold for change in function value between iterations. 0 ≤ ftol ≤ 1. Try 1e-12gtol- Absolute threshold for convergence based on the gradient's norm. 0 disables test. 0 ≤ gtol. Try 1e-12maxIterations- Maximum number of iterations.
-
setParameters
public void setParameters(Structure structure, SceneObservations observations)
Description copied from interface:BundleAdjustmentSpecifies the optimization parameters. After this the initial fit score will return a valid value.- Specified by:
setParametersin interfaceBundleAdjustment<Structure extends SceneStructure>- Parameters:
structure- Input: Initial parameters. Output: Optimized parametersobservations- Observation of features in each image.
-
optimize
public boolean optimize(Structure output)
Description copied from interface:BundleAdjustmentOptimises the parameters contained in 'structure' to minimize the error in the 'observations'. This function call will block until complete. Output is written back into 'structure'- Specified by:
optimizein interfaceBundleAdjustment<Structure extends SceneStructure>- Parameters:
output- Storage for optimized parameters. Can be the same structure passed intoBundleAdjustment.setParameters(Structure, boofcv.abst.geo.bundle.SceneObservations).- Returns:
- true If the cost function has been improved. If the data is perfect to start with this will return false since it has not improved
-
getFitScore
public double getFitScore()
Description copied from interface:BundleAdjustmentReturns the fit score. Meaning is implementation specific.- Specified by:
getFitScorein interfaceBundleAdjustment<Structure extends SceneStructure>- Returns:
- score
-
setVerbose
public void setVerbose(@Nullable java.io.PrintStream out, int level)Description copied from interface:BundleAdjustmentIf set to a non-null output then extra information will be printed to the specified stream.- Specified by:
setVerbosein interfaceBundleAdjustment<Structure extends SceneStructure>- Parameters:
out- Stream that is printed to. Set to null to disablelevel- (Future use) Parameter which can be used to specify level of verbose output. Set to zero for now.
-
requestStop
public void requestStop()
- Specified by:
requestStopin interfaceorg.ddogleg.struct.Stoppable
-
isStopRequested
public boolean isStopRequested()
- Specified by:
isStopRequestedin interfaceorg.ddogleg.struct.Stoppable
-
-