package pl.wroc.pwr.imagechannel.moment; import pl.wroc.pwr.IOperator; public class InvariantMoments implements IOperator< double [] > { /** * */ private static final long serialVersionUID = 2418621555973063406L; /*private IImageChannel imageChannel; private NormalizedMoment moment11; private NormalizedMoment moment20; private NormalizedMoment moment02;*/ //private NormalizedMoment moment21; //private NormalizedMoment moment12; //private NormalizedMoment moment30; //private NormalizedMoment moment03; /*private double [ ] invariantMoments; public InvariantMoments( IImageChannel imageChannel ) { this.imageChannel = imageChannel; }*/ public double [ ] apply( ) { /*this.moment11 = new NormalizedMoment( this.imageChannel, 1, 1 ); this.moment02 = new NormalizedMoment( this.imageChannel, 0, 2 ); this.moment20 = new NormalizedMoment( this.imageChannel, 2, 0 ); //this.moment12 = new NormalizedMoment( this.imageChannel, 1, 2 ); //this.moment21 = new NormalizedMoment( this.imageChannel, 2, 1 ); //this.moment30 = new NormalizedMoment( this.imageChannel, 3, 0 ); //this.moment03 = new NormalizedMoment( this.imageChannel, 0, 3 ); if ( this.moment11.apply( ) == null ) return null; if ( this.moment02.apply( ) == null ) return null; if ( this.moment20.apply( ) == null ) return null; //if ( this.moment12.apply( ) == null ) return null; //if ( this.moment21.apply( ) == null ) return null; //if ( this.moment03.apply( ) == null ) return null; //if ( this.moment30.apply( ) == null ) return null; // FIRST this.invariantMoments[ 0 ] = this.moment20.getResult( ) + this.moment02.getResult( ); // SECOND this.invariantMoments[ 1 ] = Math.pow( this.moment20.getResult( ) - this.moment02.getResult( ), 2 ) + 4 * Math.pow( this.moment11.getResult( ), 2 ); this.invariantMoments[ 2 ] = 0; this.invariantMoments[ 3 ] = 0; this.invariantMoments[ 4 ] = 0; this.invariantMoments[ 5 ] = 0; this.invariantMoments[ 6 ] = 0; return this.getResult( );*/ return null; } public double [ ] getResult() { return null; //return this.invariantMoments; } }