If there is a 512*512 image which has to be sampled into 16*16 image patches?how
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hamed abdulaziz
le 31 Déc 2013
Commenté : Image Analyst
le 1 Jan 2014
If there is a 512*512 image which has to be sampled into 16*16 image patches,how can I do that?
3 commentaires
Réponse acceptée
Matt J
le 1 Jan 2014
Modifié(e) : Matt J
le 1 Jan 2014
patches = mat2tiles(YourImage,[16,16]);
4 commentaires
Image Analyst
le 1 Jan 2014
The shapes are rectangles. Do you mean you want to see where the rectangles are, say in lines superimposed over the original image where the patches were extracted from? Or do you want to see every patch as a separate sub image like the FAQ does?
Plus de réponses (3)
Image Analyst
le 31 Déc 2013
Modifié(e) : Image Analyst
le 1 Jan 2014
There are nice demos for this in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F
It does it two different ways. One using mat2cell(), and one using just simple indexing. It's a full blown demo with sample images and display of each sub-image that it extracted so you can see what it did.
0 commentaires
Jan
le 31 Déc 2013
The easiest way would be to let two FOR loops crop the parts from the original array. The details depend on what you want as output.
Walter Roberson
le 31 Déc 2013
patch_cell = mat2cell( I, 16*ones(1,size(I,1)/16), 16*ones(1,size(I,2)/16), size(I,3) );
0 commentaires
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!