How to create low resolution images using high resolution image..??

1. Using the cameraman image, create a sequence of 16 low resolution image frames (lores01 to lores16). You must average a (m/16)x(n/16) block of your high resolution image (cameraman) to create each pixel of the low resolution image.

Answers (2)

Try using imresize().

6 Comments

if i do that i will get only one low resolution image... but here i need to get 16 low resolution images..
Um, you call it 16 times. With different sizes each time.
nope.. it should be same size... see, by taking 1st 4*4 pixel on top most corner u will get the 1st pixel in low resolution image.. for second pixel u need to move one row to right.. this is for 1st resolution image.. For 2nd resolution image u need to skip 1st column then repeat same process
all the 16 images should be 32*32
Those aren't low resolution images! That is merely cropping chunks out of the image. The spatial resolution will remain the same, though the pixel dimensions (rows, columns) will change because it's only part of the image. You can crop like this:
croppedImage = grayImage(row1:row2, col1:col2);
You just need to increment the rows and columns as you march across the image.
The 3 things you said here, plus your original post, all describe different things. I think you need to give the exact wording of your assignment so we can see what it means. By the way, cameraman is 256x256 so 15 * 32 is 512 not 256 so either your math is wrong, or there is some overlap of the blocks. And I don't know if you want the 256x256 image divided up into 4 by 4 array of images where each of those 16 pixels is the average of 64 by 64 chunk of the full image, or if you want something else. That would give you 16 (4x4) images but then each of those images is averaged down to give just one mean value. Your postings could be interpreted multiple ways. Your first post says "...create each pixel of the low resolution image." which indicates that there should be just one low res image, though it might be made up of several cropped images where we take the mean value of each cropped image chunk to produce just one value from the cropped image, and that one value is a pixel in the final low res image.

Sign in to comment.

hi, In the code below there is one incomplete line , it is the core of this task, Mathematically it is :
16 16
_ _
1 \ \
Lores(x,y)= ----- /_ /_ I(i,j) .
16² i j
Hint : try to use mean and the instruction that maps matrix to vect{} .
-----------------------------------------------------------------------------
I=im2double(imread('cameraman.tif'));
N=size(I);
for x=1:N(1)-16
for y=1:N(2)-16
Sample=I(x:x+16,y:y+16);
Lores(x,y)=m..................!!! Incomplete line,
end
end
figure,imshow(I), title(' Original');
figure, imshow(Lores), title(' Low resolution')

3 Comments

can i get 16 images using this... ?
hi, the incomplete line is :
Lores(x,y)=mean(Sample(:));
No you wont get 16 samples, you will get One low resolution Image that eaach pixel (x,y) is average of ( i+16,j+16) of the original Image.
Try it and see .
Hi If i changed the value of 16 to 32. it just apply on some part of the image. . Why is it so?

Sign in to comment.

Asked:

on 22 Feb 2013

Commented:

on 12 Dec 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!