Split RGB Image into blocks (24-bit)
1 次查看(过去 30 天)
显示 更早的评论
Eg a 630x538 24-bit image
Would be 630x538x3.
How would I:
Chnage dimensions of image so that exactly divisible
Split into blocks of e.g 3x3x3 or 8x8x3 or 16x16x3
And then access each block in turn?
0 个评论
回答(2 个)
Image Analyst
2020-11-21
Try blockproc(). I'm attaching some demos that you can adapt as needed.
8 个评论
Image Analyst
2020-11-22
编辑:Image Analyst
2020-11-22
If you don't want to scan and process your image in the normal raster-scan style of blockproc(), then exactly what order to you want to do it in? Again, why can't you make up that list of coordinates in advance? Even if the upper left of the block was some kind of knights tour, you could do it. Surely you must know the route or a recipe for building it. If you don't, then what's wrong with a raster scan?
I don't do private consulting via email. I don't have the time and no one could afford me.
Rik
2020-11-21
The better solution would be to use blockproc, but you can also use mat2cell and use a loop.
2 个评论
Rik
2020-11-21
If you want a specific order (i.e. the blocks don't have an independent outcome) you can't use blockproc. Otherwise I don't see why splitting into cells will not suit your needs.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!