Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- lena = imread('lena.tiff');
- lena_gray = rgb2gray(lena);
- lena_gray_downsampled = imresize(lena_gray, 0.25, 'bilinear');
- lena_gray_upsampled_nearest = imresize(lena_gray_downsampled, 4, 'nearest');
- lena_gray_upsampled_bilinear = imresize(lena_gray_downsampled, 4, 'bilinear');
- lena_gray_upsampled_bicubic = imresize(lena_gray_downsampled, 4, 'bicubic');
- cameraman = imread('cameraman.tiff');
- imshow(lena)
- title('Lena')
- figure
- imshow(lena_gray)
- title('Lena Gray')
- figure
- imshow(lena_gray_downsampled)
- title('Lena Gray Downsampled 4x Bilinear')
- figure
- imshow(lena_gray_upsampled_nearest)
- title('Lena Gray Upsampled 4x Nearest')
- lena_gray_psnr_nearest = calculate_psnr(lena_gray, lena_gray_upsampled_nearest)
- figure
- imshow(lena_gray_upsampled_bilinear)
- title('Lena Gray Upsampled 4x Bilinear')
- lena_gray_psnr_bilinear = calculate_psnr(lena_gray, lena_gray_upsampled_bilinear)
- figure
- imshow(lena_gray_upsampled_bicubic)
- title('Lena Gray Upsampled 4x Bicubic')
- lena_gray_psnr_bicubic = calculate_psnr(lena_gray, lena_gray_upsampled_bicubic)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement