How to create low resolution images using high resolution image..??
Afficher commentaires plus anciens
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.
Réponses (2)
Image Analyst
le 22 Fév 2013
1 vote
Try using imresize().
6 commentaires
prasad
le 22 Fév 2013
Image Analyst
le 22 Fév 2013
Um, you call it 16 times. With different sizes each time.
prasad
le 22 Fév 2013
prasad
le 22 Fév 2013
Image Analyst
le 22 Fév 2013
Modifié(e) : Image Analyst
le 22 Fév 2013
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.
Image Analyst
le 22 Fév 2013
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.
Youssef Khmou
le 22 Fév 2013
Modifié(e) : Youssef Khmou
le 22 Fév 2013
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 commentaires
prasad
le 22 Fév 2013
Youssef Khmou
le 22 Fév 2013
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 .
Adnan Farooq Awan
le 12 Déc 2017
Hi If i changed the value of 16 to 32. it just apply on some part of the image. . Why is it so?
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!