If there is a 512*512 image which has to be sampled into 16*16 image patches?how
Show older comments
If there is a 512*512 image which has to be sampled into 16*16 image patches,how can I do that?
3 Comments
Walter Roberson
on 31 Dec 2013
How does this question differ from your earlier http://www.mathworks.co.uk/matlabcentral/answers/111016-how-to-chop-the-region-of-interest-of-segmented-image-to-patches-samll-region-say-16-16 ?
hamed abdulaziz
on 31 Dec 2013
Edited: hamed abdulaziz
on 31 Dec 2013
hamed abdulaziz
on 31 Dec 2013
Accepted Answer
More Answers (3)
Image Analyst
on 31 Dec 2013
Edited: Image Analyst
on 1 Jan 2014
1 vote
There are nice demos for this in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F
It does it two different ways. One using mat2cell(), and one using just simple indexing. It's a full blown demo with sample images and display of each sub-image that it extracted so you can see what it did.
Jan
on 31 Dec 2013
0 votes
The easiest way would be to let two FOR loops crop the parts from the original array. The details depend on what you want as output.
1 Comment
hamed abdulaziz
on 31 Dec 2013
Walter Roberson
on 31 Dec 2013
patch_cell = mat2cell( I, 16*ones(1,size(I,1)/16), 16*ones(1,size(I,2)/16), size(I,3) );
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!