Division of a color image into blocks in MATLAB -
i have rgb image of size 256x256.i need divide rgb image blocks of size 32x32.each block must in turn rgb image.how can in matlab.please provide me code in matlab.
you can use mat2cell this.
out = mat2cell(image,ones(256/32,1)*32,ones(256/32,1)*32,3);
out
8-by-8 cell array, each cell containing 32-by-32-by-3 rgb image.
you can access first block out{1,1}
.
edit
changed repmat
ones
make code faster.
Comments
Post a Comment