divide an image to overlapped blocks
Afficher commentaires plus anciens
I have an image with size 512*512 and I want to extract all blocks with size 31*31 in this image by sliding this window on each pixel of it,now how can I do it?
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 30 Juil 2016
0 votes
It's not memory efficient to keep all of these blocks in memory at the same time. What do you want to do with them? Can't you just extract the block and "use" it right then and there so that you don't have all those in memory at the same time? This is what blockproc() would do, or you could do it manually with a double for loop.
2 commentaires
nadia
le 31 Juil 2016
Image Analyst
le 31 Juil 2016
How is the database being constructed? Are you just saving sub-images to files in a folder? Or are you using a regular database, like Oracle or SAS or something, and the Database Toolbox? Either way, I don't see any need to process them all into a single cell array instead of just processing one sub-image at a time. If you want all those in memory at one time, then 31*31 is about a kilobyte. And if you have a megapixel image with a kilobyte at every pixel, that's a gigabyte. Not huge but getting up there, and, I think, wasteful because you don't need to do it.
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!