Syntax for using 'blockproc' command to divide a .jpg image into blocks
1 view (last 30 days)
Show older comments
I have a problem where I need to subdivide the image into smaller blocks. While this is quite easy for gray image by using mat2cell command (input image being 2D array or matrix), same is not true (at least for me now) for color image (being 3D array). I find that 'blockproc' is the proper way to use 'mat2cell' for each layer of the color image. But somehow I am not very comfortable with the explanation of the syntax for using 'blockproc'. It will be very help full if the proper syntax is given to me.
0 Comments
Answers (2)
Walter Roberson
on 18 Apr 2013
B = 8; %e.g., 8 x 8
ImageBlocks = mat2cell( YourRGBImage, B * ones(1, size(YourRGBImage,1)/B), B * ones(1, size(YourRGBImage,2)/B), size(YourRGBImage,3) );
Note: this will also work for grayscale images.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!