@Override public int getNumOfInputsN() { return param.getParamLength(); }
@Override public int getNumOfInputsN() { return param.getParamLength(); }
@Override public int getNumOfInputsN() { return param.getParamLength(); }
@Override public int getNumOfInputsN() { return codec.getParamLength(); }
@Override public int getNumOfInputsN() { return param.getParamLength(); }
@Override public int getNumOfInputsN() { return param.getParamLength(); }
@Override public int getNumOfInputsN() { return param.getParamLength(); }
/** * Specifies algorithms for computing he distance between the shape and a point, refining the shape parameters, * and converting the model parameters into an array. * * @param fitter Uses a set of points and an initial guess to estimate the shape's parameters * @param distance Computes the distance between a shape and a point * @param codec Converts the shape parameter to and from double array * @param threshold Threshold which defined an inlier. inlier <= threshold */ public void configure(ModelFitter<Model, PointVectorNN> fitter, DistanceFromModel<Model, PointVectorNN> distance, CheckShapeParameters<Model> checkParam, ModelCodec<Model> codec, double threshold) { this.fitter = fitter; this.checkParam = checkParam; this.codec = codec; this.distanceThreshold = threshold; findMatchSet.setModelDistance(distance); if (paramPrev.length < codec.getParamLength()) { paramPrev = new double[codec.getParamLength()]; paramCurr = new double[codec.getParamLength()]; } }
/** * Computes the difference between the two parameters. */ protected double computeDiff(Model modelA, Model modelB ) { double paramA[] = new double[ codec.getParamLength() ]; double paramB[] = new double[ codec.getParamLength() ]; codec.encode(modelA,paramA); codec.encode(modelB,paramB); double total = 0; for (int i = 0; i < paramA.length; i++) { total += Math.abs(paramA[i] - paramB[i]); } return total / paramA.length; }
/** * Computes the difference between the two parameters. */ protected double computeDiff(Model modelA, Model modelB ) { double paramA[] = new double[ codec.getParamLength() ]; double paramB[] = new double[ codec.getParamLength() ]; codec.encode(modelA,paramA); codec.encode(modelB,paramB); double total = 0; for (int i = 0; i < paramA.length; i++) { total += Math.abs(paramA[i] - paramB[i]); } return total / paramA.length; }
for (int i = 0; i < codec.getParamLength(); i++) { double d = paramCurr[i] - paramPrev[i]; change += Math.abs(d); change /= codec.getParamLength();
public LeastSquaresFundamental(ModelCodec<DenseMatrix64F> paramModel, double convergenceTol, int maxIterations, boolean useSampson) { this.paramModel = paramModel; this.maxIterations = maxIterations; this.convergenceTol = convergenceTol; param = new double[paramModel.getParamLength()]; ModelObservationResidual<DenseMatrix64F,AssociatedPair> residual; if( useSampson ) residual = new FundamentalResidualSampson(); else residual = new FundamentalResidualSimple(); func = new ResidualsEpipolarMatrix(paramModel,residual); minimizer = FactoryOptimization.leastSquareLevenberg(1e-3); }
public LeastSquaresFundamental(ModelCodec<DMatrixRMaj> paramModel, double convergenceTol, int maxIterations, boolean useSampson) { this.paramModel = paramModel; this.maxIterations = maxIterations; this.convergenceTol = convergenceTol; param = new double[paramModel.getParamLength()]; ModelObservationResidual<DMatrixRMaj,AssociatedPair> residual; if( useSampson ) residual = new FundamentalResidualSampson(); else residual = new FundamentalResidualSimple(); func = new ResidualsEpipolarMatrix(paramModel,residual); minimizer = FactoryOptimization.levenbergMarquardt(null,false); }
public PnPRefineRodrigues(double convergenceTol, int maxIterations ) { this.maxIterations = maxIterations; this.convergenceTol = convergenceTol; this.minimizer = FactoryOptimization.levenbergMarquardt(null,false); func = new ResidualsCodecToMatrix<>(paramModel, new PnPResidualReprojection(), new Se3_F64()); param = new double[paramModel.getParamLength()]; }
public PnPRefineRodrigues(double convergenceTol, int maxIterations ) { this.maxIterations = maxIterations; this.convergenceTol = convergenceTol; this.minimizer = FactoryOptimization.leastSquareLevenberg(1e-3); func = new ResidualsCodecToMatrix<>(paramModel, new PnPResidualReprojection(), new Se3_F64()); param = new double[paramModel.getParamLength()]; }