function J=zoomcolor(I,d); close all; I1=I(:,:,1);I2=I(:,:,2);I3=I(:,:,3); J1=samplingzoom(I1,d);[n,m]=size(J1); J2=samplingzoom(I2,d); J3=samplingzoom(I3,d); J(:,:,1)=J1; J(:,:,2)=J2; J(:,:,3)=J3; figure;imshow(J); function Irec = samplingzoom(I,d); close all; I=double(I)./255; s=size(I); m=s(1);n=s(2); n=min([n,m]); r=floor(n/(2*d)); b=r; for i=1:d:(d*n);for j=1:d:(d*n); Y(i,j)=I(1+(i-1)/(d),1+(j-1)/(d)); end end Ibanda=Y; n=d*n; r=(n/d)-1; AA=ones(r+1,r+1); for i=0:1:r; for j=0:1:r AA(i+1,j+1)=Y(d*i+1,d*j+1); end end sincvector=discretsincvector(b,n); Irec=Y; V1 = ones(r+1,r+1); V2 = ones(r+1,r+1); v = ones(1, r+1); aux = n - d*(0:r); for s=0:(n-1); v = sincvector(aux+s); V1(s+1, :) = v; end V2=V1'; Irec = d.^2 * V1 * AA * V2; function SM = discretsincvector(M,N) t = (-N+1):(N-1); SM = repmat(double(0), size(t)); SM( t>0 ) = sin(pi*(2*M+1)*t(t>0)/N)./(N*sin(pi*t(t>0)/N)); SM( t<0 ) = sin(pi*(2*M+1)*(t(t<0)+N)/N)./(N*sin(pi*(t(t<0)+N)/N)); SM( t==0 ) = (2*M+1)/N;