Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Practical 3 Date: 18 / 03 / 2011 Aim: To read an 8-bit image and to see the effect of each bit on the image.

Solution: clc; clear all; close all; i = imread('onion.png'); j = imresize(i, 0.5); %Shrink by factor of two using by default bicubic %interpolation. figure; imshow(i); title('Image-1:Original Image'); j1 = imresize(i, 0.5,'bilinear'); j2 = imresize(i, 0.5,'nearest'); figure; imshow(j);title('Image-2:Resized by 0.5 the Image-1 using bydefault bicubic interpolation'); figure; imshow(j1); title('Image-3:Resized by 0.5 the Image-1 using bilinear interpolation'); figure; imshow(j2); title('Image-4:Resized by 0.5 the Image-1 using nearest interpolation'); k = imresize(j, 2); figure; imshow(k); title('Image-5:Resized by 2 the Image-2'); Result:

<135x198x3 uint8>

<68x99x3 uint8>

<68x99x3 uint8>

<68x99x3 uint8>

<136x198x3 uint8>

You might also like