Hello,
That's true. You can use blockproc from Matlab.
It's simple to use.
B = blockproc(A,[M N],fun)
A is input image, [M N] is size of block, and fun is function handle
If you want to divide image into 100 equal block, then
you can divide image width and height by 10. This is for size of the block.
Here my sample code :
I = imread('peppers.png');
I = I(1:300,1:500,:);
[m n o] = size(I);
r = m/10;
c = n/10;
fun = @(block_struct) max(block_struct.data(:));
J = blockproc(I,[r c],fun)
J will returns 10x10 array that represent maximum value of each corresponding block.
J =
75 78 77 84 84 82 80 87 82 73
77 83 79 82 83 83 84 135 81 75
77 83 84 90 254 174 157 250 119 74
82 150 215 207 255 255 212 249 194 165
77 136 247 191 225 239 170 255 255 255
76 169 190 255 255 255 255 255 255 251
255 255 245 255 255 255 255 255 250 233
255 255 255 255 255 255 255 216 255 255
255 255 255 255 255 255 255 255 255 255
255 255 255 254 202 197 173 177 255 255
I hope this will helps you.
Best Answer