@Override public double[] apply( final double[] location ) { final double[] copy = location.clone(); applyInPlace( copy ); return copy; }
@Override public double[] applyInverse( final double[] point ) throws NoninvertibleModelException { final double[] copy = point.clone(); applyInverseInPlace( copy ); return copy; }
public InterpolatedAffineModel2D( final A model, final B regularizer, final double lambda ) { super( model, regularizer, lambda ); interpolate(); }
@Override public InterpolatedAffineModel2D< A, B > copy() { final InterpolatedAffineModel2D< A, B > copy = new InterpolatedAffineModel2D< A, B >( a.copy(), b.copy(), lambda ); copy.cost = cost; return copy; }
@Override final protected void onReturn() { final double[] flatmatrix = new double[ 6 ]; myModel().toArray( flatmatrix ); IJ.log( "Matrix: " + Arrays.toString( flatmatrix ) ); } }
models.add( ((InterpolatedAffineModel2D)tile.getModel()).createAffineModel2D() ); else models.add( ((InterpolatedAffineModel3D)tile.getModel()).createAffineModel3D() ); models.add( ((InterpolatedAffineModel2D)params.model.copy()).createAffineModel2D() ); else models.add( ((InterpolatedAffineModel3D)params.model.copy()).createAffineModel3D() );
@SuppressWarnings( "rawtypes" ) @Override protected void initModel() { final AffineTransform a = patch.getAffineTransform(); if ( AffineModel2D.class.isInstance( model ) ) ( ( AffineModel2D )( Object )model ).set( a ); else if ( SimilarityModel2D.class.isInstance( model ) ) ( ( SimilarityModel2D )( Object )model ).set( a.getScaleX(), a.getShearY(), a.getTranslateX(), a.getTranslateY() ); else if ( RigidModel2D.class.isInstance( model ) ) ( ( RigidModel2D )( Object )model ).set( a.getScaleX(), a.getShearY(), a.getTranslateX(), a.getTranslateY() ); else if ( TranslationModel2D.class.isInstance( model ) ) ( ( TranslationModel2D )( Object )model ).set( a.getTranslateX(), a.getTranslateY() ); else if ( InterpolatedAffineModel2D.class.isInstance( model ) ) ( ( InterpolatedAffineModel2D )( Object )model ).set( a ); }
@Override public InterpolatedAffineModel2D< A, B > copy() { final InterpolatedAffineModel2D< A, B > copy = new InterpolatedAffineModel2D< A, B >( a.copy(), b.copy(), lambda ); copy.cost = cost; return copy; }
@Override final protected void onReturn() { final double[] flatmatrix = new double[ 6 ]; myModel().toArray( flatmatrix ); IJ.log( "Matrix: " + Arrays.toString( flatmatrix ) ); } }
model1 = ((InterpolatedAffineModel2D)model1).createAffineModel2D(); model2 = ((InterpolatedAffineModel2D)model2).createAffineModel2D();
@Override public InterpolatedAffineModel2D< A, B > createInverse() { final InterpolatedAffineModel2D< A, B > inverse = new InterpolatedAffineModel2D< A, B >( a.createInverse(), b.createInverse(), lambda ); inverse.cost = cost; return inverse; }
public InterpolatedAffineModel2D( final A model, final B regularizer, final double lambda ) { super( model, regularizer, lambda ); interpolate(); }
@Override public double[] applyInverse( final double[] point ) throws NoninvertibleModelException { final double[] copy = point.clone(); applyInverseInPlace( copy ); return copy; }
@Override public double[] apply( final double[] location ) { final double[] copy = location.clone(); applyInPlace( copy ); return copy; }
@Override public InterpolatedAffineModel2D< A, B > createInverse() { final InterpolatedAffineModel2D< A, B > inverse = new InterpolatedAffineModel2D< A, B >( a.createInverse(), b.createInverse(), lambda ); inverse.cost = cost; return inverse; }
@Override public < P extends PointMatch > void fit( final Collection< P > matches ) throws NotEnoughDataPointsException, IllDefinedDataPointsException { super.fit( matches ); interpolate(); }
final static public class Param extends AbstractLayerAlignmentParam implements Serializable { /** * Regularization */ public boolean regularize = false; public int regularizerIndex = 1; public double lambda = 0.1; public boolean setup( final Rectangle box ) { if ( !setupSIFT( "Elastically align layers: " ) ) return false; /* Geometric filters */ final GenericDialog gd = new GenericDialog( "Align layers: Geometric filters" ); gd.addNumericField( "maximal_alignment_error :", maxEpsilon, 2, 6, "px" ); gd.addNumericField( "minimal_inlier_ratio :", minInlierRatio, 2 ); gd.addNumericField( "minimal_number_of_inliers :", minNumInliers, 0 ); gd.addChoice( "expected_transformation :", Param.modelStrings, Param.modelStrings[ expectedModelIndex ] ); gd.addCheckbox( "test_multiple_hypotheses", multipleHypotheses ); gd.addCheckbox( "widest_set_only", widestSetOnly ); gd.addCheckbox( "ignore constant background", rejectIdentity ); gd.addNumericField( "tolerance :", identityTolerance, 2, 6, "px" ); gd.addMessage( "Layer neighbor range:" ); gd.addNumericField( "test_maximally :", maxNumNeighbors, 0, 6, "layers" ); gd.addNumericField( "give_up_after :", maxNumFailures, 0, 6, "failures" );
@Override public < P extends PointMatch > void fit( final Collection< P > matches ) throws NotEnoughDataPointsException, IllDefinedDataPointsException { super.fit( matches ); interpolate(); }
final InterpolatedAffineModel2D< ?, ? > interpolatedModel = new InterpolatedAffineModel2D( m, r, p.lambda );
params.model = new InterpolatedAffineModel2D( params.model, new TranslationModel2D(), (float)params.lambda ); break; case 1: params.model = new InterpolatedAffineModel2D( params.model, new RigidModel2D(), (float)params.lambda ); break; case 2: params.model = new InterpolatedAffineModel2D( params.model, new SimilarityModel2D(), (float)params.lambda ); break; case 3: params.model = new InterpolatedAffineModel2D( params.model, new AffineModel2D(), (float)params.lambda ); break; case 4: return null; default: params.model = new InterpolatedAffineModel2D( params.model, new RigidModel2D(), (float)params.lambda ); break;