Syntax for using 'blockproc' command to divide a .jpg image into blocks
Afficher commentaires plus anciens
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.
Réponses (2)
Walter Roberson
le 18 Avr 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.
Bidyut Chakraborty
le 19 Avr 2013
Modifié(e) : Bidyut Chakraborty
le 19 Avr 2013
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!