Given two sets of corresponding points, calculates warp between them. Uses booksteins PAMI89 method. Can then apply warp to a new set of points (tps_interpolate), or even an image (tps_interpolateiamge). INPUTS lambda - contolls rigidity of warp (lambda->inf means warp becomes affine) xs_source, ys_source - correspondence points from source image xs_dest, ys_dest - correspondence points from destination image OUTPUTS wx, affinex, wy, affiney - booksteain warping parameters L, Ln_inv - see bookstein bend_energy - bending energy EXAMPLE % example 1 xs = [ 0 -1 0 1 ]; ys = [1 0 -1 0]; xs_dest = xs; ys_dest = [3/4 1/4 -5/4 1/4]; [grid_xs, grid_ys] = meshgrid( -1.25:.25:1.25, -1.25:.25:1.25 ); [wx,ax,wy,ay,L,Ln_inv,benden] = tps_getwarp( 0, xs, ys, xs_dest, ys_dest ); tps_interpolate( xs, ys, xs_dest, ys_dest, wx, ax, wy, ay, grid_xs, grid_ys, 1 ); % example 2 xs = [3.6929 6.5827 6.7756 4.8189 5.6969 ]; ys = [10.3819 8.8386 12.0866 11.2047 10.0748 ]; xs_dest = [ 3.9724 6.6969 6.5394 5.4016 5.7756 ]; ys_dest = [ 6.5354 4.1181 7.2362 6.4528 5.1142 ]; [grid_xs, grid_ys] = meshgrid( 3.5:.25:7, 8.5:.25: 12.5 ); [wx,ax,wy,ay,L,Ln_inv,benden] = tps_getwarp( 0, xs, ys, xs_dest, ys_dest ); tps_interpolate( xs, ys, xs_dest, ys_dest, wx, ax, wy, ay, grid_xs, grid_ys, 1 ); DATESTAMP 29-Sep-2005 2:00pm See also TPS_INTERPOLATE, TPS_INTERPOLATEIMAGE, TPS_RANDOM