i have an image with a size of 300x300. how can i divide the image into 10x10 and then save it and take the average of 100 pixels ? thanks a lot guys
1 view (last 30 days)
Show older comments
i have an image with a size of 300x300. how can i divide the image into 10x10 and then save it and take the average of 100 pixels ? thanks a lot guys
0 Comments
Answers (2)
Chad Greene
on 5 Apr 2016
If you have the image processing toolbox,
% Create a 300x300 image:
I = peaks(300);
% Resize the image to a scale of 10/300:
Ireduced = imresize(I,10/300);
% Get the average value of the 10x10 image:
Imean = mean(Ireduced(:))
2 Comments
Azzi Abdelmalek
on 5 Apr 2016
A=randi(255,300,300);
imshow(A)
out=blockproc(A,[10 10],@(x) mean(x.data(:)))
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!