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)
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

Answers (2)

Chad Greene
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(:))

Azzi Abdelmalek
Azzi Abdelmalek on 5 Apr 2016
A=randi(255,300,300);
imshow(A)
out=blockproc(A,[10 10],@(x) mean(x.data(:)))
  1 Comment
sand refai
sand refai on 5 Apr 2016
sorry i didnt understand, the name of my image is job.jpg. so plz can u writhe the full code for me bcoz acually i dont know a lot about matlab. anyway, thanks a lot brother

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!