Question: Can some one help me with matlab code below to get the correct this to get the better result please?(URGENT) X=imread('Original.tif','tif'); % iminfo(('jetplaneF16.tif','tif'); X=double(X); figure;
Can some one help me with matlab code below to get the correct this to get the better result please?(URGENT)

X=imread('Original.tif','tif'); % iminfo(('jetplaneF16.tif','tif'); X=double(X); figure; colormap(gray(255)); % subplot(2,2,1); image(X); axis('image'); % axis normal h_t=title('Original'); set(h_t,'FontName','Times', ... 'FontSize',12); N=8; M=8; N2=N/2; M2=M/2; X_downsampled=[ 1 2 2 1 2 3 3 3 1 4 4 2 1 2 4 3]; % Step 1: The filling at all (odd,odd) pixels Y_upsampling=zeros(N,M); Y_upsampling(1:2:N,1:2:M)=X_downsampled; % Step 2: The Interpolation at all (odd,even) pixels for n=1:2:N-1 for m=2:2:M-2 T=Y_upsampling(n,m-1)+Y_upsampling(n,m+1); Y_upsampling(n,m)=T/2; end end % The filling of the last column of the image Y_upsampling(1:2:N,M)=Y_upsampling(1:2:N,M-1) % Step 3. Interpolation at (even,odd) pixels for n=2:2:N-1 for m=1:2:M-1 T=Y_upsampling(n-1,m)+Y_upsampling(n+1,m); Y_upsampling(n,m)=T/2; end end % The filling of the last row of the image Y_upsampling(N,1:2:M)=Y_upsampling(N-1,1:2:M); % Step 4. Interpolation at (even,even) pixels for n=2:2:N-1 for m=2:2:M-2 T=Y_upsampling(n,m-1)+Y_upsampling(n,m+1); Y_upsampling(n,m)=T/2; end end % The filling of the last column and row of the image Y_upsampling(N,2:2:M)=Y_upsampling(N-1,2:2:M); % The rounding of the result Y_upsampling=ceil(Y_upsampling); % round(Y_upsampling); can also be used % ------------------------------------------------------------------------ % Step 5. Difference and error of up-sampling Diff=X-Y_upsampling; Err = sqrt( sum(sum( Diff.*Diff ))/N/M); % 1.8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
