public static double maxError( double[][] sourcePoints, double[][] targetPoints, ThinPlateR2LogRSplineKernelTransform xfm ) { return maxError( sourcePoints, targetPoints, xfm, false ); }
public static double maxError( double[][] sourcePoints, double[][] targetPoints, ThinPlateR2LogRSplineKernelTransform xfm, boolean debug ) { double maxError = 0.0; int D = sourcePoints.length; int N = sourcePoints[ 0 ].length; double[] spt = new double[ sourcePoints.length ]; double[] tpt = new double[ sourcePoints.length ]; for( int i = 0; i < N; i++ ) { for( int n = 0; n < D; n++ ) { spt[ n ] = sourcePoints[ n ][ i ]; tpt[ n ] = targetPoints[ n ][ i ]; } double[] result = xfm.apply( spt ); double distance = distance( tpt, result ); if( debug ) System.out.println( "distance at: " + i + " is " + distance ); if( distance > maxError ) maxError = distance; } return maxError; }
error = inv.getError(); logger.trace( "guess : " + XfmUtils.printArray( guess ) ); logger.trace( "guessXfm : " + XfmUtils.printArray( guessXfm ) ); logger.trace( "error vector: " + XfmUtils.printArray( inv.getErrorVector().data ) ); logger.trace( "error : " + NormOps.normP2( inv.getErrorVector() ) ); logger.trace( "abs error : " + error );