How can I divide image into 3x3 pixels?

Antworten (3)

Image Analyst
Image Analyst am 28 Okt. 2016

0 Stimmen

Depending on what you want to do with the 3x3 subimages, you might also want to look at imfilter(), conv2(), or nlfilter().
Matt J
Matt J am 28 Okt. 2016
Bearbeitet: Matt J am 28 Okt. 2016

0 Stimmen

Using mat2tiles ( Download ),
Blocks = mat2tiles(yourImage,[3,3]);

3 Kommentare

Abdullah
Abdullah am 28 Okt. 2016
Thanks for your answer but I want to divide the image into 3 pixels by 3 pixels not 3x3 blocks, your answer is nice but its 3x3 blocks, do you have any idea how to divide it into 3x3 pixels
Image Analyst
Image Analyst am 29 Okt. 2016
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
Matt J am 30 Okt. 2016
@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.

Melden Sie sich an, um zu kommentieren.

Alex Taylor
Alex Taylor am 7 Nov. 2016

0 Stimmen

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.

1 Kommentar

Abdullah
Abdullah am 27 Nov. 2016
Dear @Alex Taylor I tried it already but the processing time take so long...I am using workstation computer 8 core with 16GB Ram but it take really long...is there any other faster way ?

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 28 Okt. 2016

Kommentiert:

am 27 Nov. 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by