"sayed" wrote in message <l8ng4u$73g$1@newscl01ah.mathworks.com>...
> How can transfer the contents of an image"DN value" to another image using interpolation algorithm.I mahed the folowing code but cubic spline generate this massege"Error using ./
> Integers can only be combined with integers of the same
> class, or scalar doubles.
>
> Error in spline (line 59)
> dd = ones(yd,1); dx = diff(x); divdif =
> diff(y,[],2)./dx(dd,:);
>
> Error in splncore (line 40)
> values =
> spline(x{i},reshape(values,prod(nv(1:d1)),nv(d)),xi{i}).';
>
> Error in interp2>spline2 (line 579)
> F = splncore(varargin(2:1:1),varargin{3},{yyi(:).'
> xxi},'gridded');
>
> Error in interp2 (line 238)
> zi = spline2(x,y,z,xi,yi,ExtrapVal);
>
> Error in interpolation (line 26)
> I(i,j)= interp2(f,j,i,'spline'); "
>
> \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
>
> clear all; close all; clc;
> %I = imread('F:\phase2\imm\1.tif');
> I = imread('image_shift.tif');
> %imshow(I);
> [n m] =size(I);
> for i=1:n;
> for j=1:m;
> I(i,j)=0;
> end
> end
> %imwrite(I, 'F:\phase2\11_t.tif');
> %imshow(I)
> %h = imread('F:\phase2\11_t.tif');
> %[x y]=size(h);
> %f = imread('F:\phase2\imm\2.tif');
> f = imread('original.tif');
> %[x1 y1]=size(f);
> %g =interp2(x,y,z,x1,y1,'cubic');
> %imwrite(g, 'F:\phase2\12.tif');
> %imshow(f)
>
> %nerest naber
> for i=1:n1;
> for j=1:m1;
> I(i,j)= interp2(f,j,i,'spline');
> end
> end
> imwrite(I, 'interpolation.tif');
> %d = imread('F:\phase2\t.tif');
>
> imshow(I);
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Dear members : thanks a lot
I have solved in my problem in my code . it was needed convert my image from integer to double, because cubic spline select many points .
sayed
