divide an image to overlapped blocks
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Image Analyst
2016년 7월 30일
0 개 추천
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
nadia
2016년 7월 31일
Image Analyst
2016년 7월 31일
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.
카테고리
도움말 센터 및 File Exchange에서 Neighborhood and Block Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!