Let us consider an image Y of size 512x512.
The code below serves to segment the image Y into blocks where each block take the size 8x8.
Matlab Code:
for m = 1:64
for n = 1:64
subX = Y(8*(m-1)+1:8*m,8*(n-1)+1:8*n);
end
end
What i need in this question is to resolve my two problems below:
1) to segment the image X into 8 x 8 number of blocks (not the size is 8x8 but the number of blocks must be 8x8). In this case the image will become segmented into 64 blocks where each block being contain 512/64 pixels =8 pixels.
2) it is the same concept of 1), but in this case, i want to segment the image into 10x10 number of blocks. therefore the image will become segmented into 100 blocks. But we can now notice that each block being containing 512/100 = 5.12 pixels!! so it's float!
PLEASE help me to write a unique code which can be resolve my two problems at the same time.
Best Regards,
Christina.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…