@Override public HomographyModel2D copy() { final HomographyModel2D m = new HomographyModel2D(); m.m00 = m00; m.m01 = m01; m.m02 = m02; m.m10 = m10; m.m11 = m11; m.m12 = m12; m.m20 = m20; m.m21 = m21; m.m22 = m22; m.i00 = i00; m.i01 = i01; m.i02 = i02; m.i10 = i10; m.i11 = i11; m.i12 = i12; m.i20 = i20; m.i21 = i21; m.i22 = i22; m.cost = getCost(); return m; }
applyInPlace( l ); applyInPlace( l ); applyInPlace( l ); applyInPlace( l );
applyInverseInPlace( l ); applyInverseInPlace( l ); applyInverseInPlace( l ); applyInverseInPlace( l );
final static public AbstractModel< ? > createModel( final int modelIndex ) { switch ( modelIndex ) { case 0: return new TranslationModel2D(); case 1: return new RigidModel2D(); case 2: return new SimilarityModel2D(); case 3: return new AffineModel2D(); case 4: return new HomographyModel2D(); default: return null; } } }
return null; params.model = new HomographyModel2D(); break; default: final HomographyModel2D model = new HomographyModel2D(); model.set( (float)m00, (float)m01, (float)m02, (float)m10, (float)m11, (float)m12, (float)m20, (float)m21, (float)m22 ); params.initialModel = model;
matches.toArray( p ); final double[] h1 = fitToUnitSquare( p[ 0 ].getP1().getL(), p[ 1 ].getP1().getL(), p[ 2 ].getP1().getL(), p[ 3 ].getP1().getL() ); final double[] h2 = fitToUnitSquare( p[ 0 ].getP2().getW(), p[ 1 ].getP2().getW(), m22 = h2[ 6 ] * h1[ 2 ] + h2[ 7 ] * h1[ 5 ] + h2[ 8 ] * h1[ 8 ]; invert(); m22 = v.get( 8, 8 ); invert();
public void set( final double m00, final double m01, final double m02, final double m10, final double m11, final double m12, final double m20, final double m21, final double m22 ) { this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m10 = m10; this.m11 = m11; this.m12 = m12; this.m20 = m20; this.m21 = m21; this.m22 = m22; invert(); }
@Override final public void set( final HomographyModel2D m ) { m00 = m.m00; m01 = m.m01; m02 = m.m02; m10 = m.m10; m11 = m.m11; m12 = m.m12; m20 = m.m20; m21 = m.m21; m22 = m.m22; i00 = m.i00; i01 = m.i01; i02 = m.i02; i10 = m.i10; i11 = m.i11; i12 = m.i12; i20 = m.i20; i21 = m.i21; i22 = m.i22; cost = m.getCost(); }
break; case 4: model = new HomographyModel2D(); break; default:
matches.toArray( p ); final double[] h1 = fitToUnitSquare( p[ 0 ].getP1().getL(), p[ 1 ].getP1().getL(), p[ 2 ].getP1().getL(), p[ 3 ].getP1().getL() ); final double[] h2 = fitToUnitSquare( p[ 0 ].getP2().getW(), p[ 1 ].getP2().getW(), m22 = h2[ 6 ] * h1[ 2 ] + h2[ 7 ] * h1[ 5 ] + h2[ 8 ] * h1[ 8 ]; invert(); m22 = v.get( 8, 8 ); invert();
public void set( final double m00, final double m01, final double m02, final double m10, final double m11, final double m12, final double m20, final double m21, final double m22 ) { this.m00 = m00; this.m01 = m01; this.m02 = m02; this.m10 = m10; this.m11 = m11; this.m12 = m12; this.m20 = m20; this.m21 = m21; this.m22 = m22; invert(); }
@Override final public void set( final HomographyModel2D m ) { m00 = m.m00; m01 = m.m01; m02 = m.m02; m10 = m.m10; m11 = m.m11; m12 = m.m12; m20 = m.m20; m21 = m.m21; m22 = m.m22; i00 = m.i00; i01 = m.i01; i02 = m.i02; i10 = m.i10; i11 = m.i11; i12 = m.i12; i20 = m.i20; i21 = m.i21; i22 = m.i22; cost = m.getCost(); }
final static public AbstractModel< ? > createModel( final int modelIndex ) { switch ( modelIndex ) { case 0: return new TranslationModel2D(); case 1: return new RigidModel2D(); case 2: return new SimilarityModel2D(); case 3: return new AffineModel2D(); case 4: return new HomographyModel2D(); default: return null; } }
@Override public HomographyModel2D copy() { final HomographyModel2D m = new HomographyModel2D(); m.m00 = m00; m.m01 = m01; m.m02 = m02; m.m10 = m10; m.m11 = m11; m.m12 = m12; m.m20 = m20; m.m21 = m21; m.m22 = m22; m.i00 = i00; m.i01 = i01; m.i02 = i02; m.i10 = i10; m.i11 = i11; m.i12 = i12; m.i20 = i20; m.i21 = i21; m.i22 = i22; m.cost = getCost(); return m; }
applyInPlace( l ); applyInPlace( l ); applyInPlace( l ); applyInPlace( l );
applyInverseInPlace( l ); applyInverseInPlace( l ); applyInverseInPlace( l ); applyInverseInPlace( l );
final static public AbstractModel< ? > createModel( final int modelIndex ) { switch ( modelIndex ) { case 0: return new TranslationModel2D(); case 1: return new RigidModel2D(); case 2: return new SimilarityModel2D(); case 3: return new AffineModel2D(); case 4: return new HomographyModel2D(); default: return null; } }
final public HomographyModel2D createInverse() final HomographyModel2D m = new HomographyModel2D(); m.i22 = m22; m.cost = getCost();
@Override final public double[] apply( final double[] point ) { assert point.length >= 2 : "2d homographies can be applied to 2d points only."; final double[] t = point.clone(); applyInPlace( t ); return t; }
break; case 4: model = new HomographyModel2D(); break; default: