hi all.. if i have value of each block 8×8 pixels. i'm looking for how to random each block? any idea for it? but it's not effective. here's my codes.. could you fix it?
B=imread('filename');a = reshape(B(1:128, 1:128), 8, 16, 8, 16);a = permute(a, [1,3,2,4]);%example for scramble positions
a(:,:,1,1)=a(:,:,16,2);a(:,:,1,2)=a(:,:,2,1);a(:,:,1,3)=a(:,:,4,1);a(:,:,1,4)=a(:,:,6,1);a(:,:,1,5)=a(:,:,7,4);a(:,:,1,6)=a(:,:,9,16);a(:,:,1,7)=a(:,:,5,10);a(:,:,1,8)=a(:,:,7,1);a(:,:,1,9)=a(:,:,5,1);a(:,:,1,10)=a(:,:,5,1);a(:,:,1,11)=a(:,:,4,4);a(:,:,1,12)=a(:,:,3,1);a(:,:,1,13)=a(:,:,2,3);a(:,:,1,14)=a(:,:,2,5);a(:,:,1,15)=a(:,:,5,4);a(:,:,1,16)=a(:,:,15,2);a(:,:,2,1)=...a(:,:,..,..)=...
and so on until a(:,:,16,16). so we have 256 blocks to random without any change in the value of each block.
how to scramble it? i hope it'll easier
thanks..
Best Answer