How can I divide image into 3x3 pixels?
1 次查看(过去 30 天)
显示 更早的评论
I want to divide image into none-overlapping blocks into size of 3x3 pixels
0 个评论
回答(3 个)
Image Analyst
2016-10-28
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F
Depending on what you want to do with the 3x3 subimages, you might also want to look at imfilter(), conv2(), or nlfilter().
0 个评论
Matt J
2016-10-28
编辑:Matt J
2016-10-28
Blocks = mat2tiles(yourImage,[3,3]);
3 个评论
Image Analyst
2016-10-29
What for? What do you want to do once you have the 3x3 window? Maybe you can use conv2(), imfilter(), or nlfilter() without ever directly splitting up the image yourself (like I suggested in my answer).
And what is the difference whether you call them blocks or tiles? Either way, it's a sliding window of a 3-by-3 sub-image (window) of the full image. I don't understand your comment about this.
Matt J
2016-10-30
@Abdullah,
I'm also not clear on the distinction "3 pixels by 3 pixels not 3x3 blocks". Bear in mind though, that mat2tiles is a general tool for dividing up the image into non-overlapping sub-images. You can divide the image up into blocks of other sizes, if it suits you.
Alex Taylor
2016-11-7
The Image Processing Toolbox function blockproc can be used to execute any generic operation on blocked regions of your image.
I'm not sure what the distinction "3x3 pixels" vs. blocks vs. tiles is, as other users have posted.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!