If there is a 512*512 image which has to be sampled into 16*16 image patches?how
조회 수: 3 (최근 30일)
이전 댓글 표시
If there is a 512*512 image which has to be sampled into 16*16 image patches,how can I do that?
댓글 수: 3
채택된 답변
Matt J
2014년 1월 1일
편집: Matt J
2014년 1월 1일
patches = mat2tiles(YourImage,[16,16]);
댓글 수: 4
Image Analyst
2014년 1월 1일
The shapes are rectangles. Do you mean you want to see where the rectangles are, say in lines superimposed over the original image where the patches were extracted from? Or do you want to see every patch as a separate sub image like the FAQ does?
추가 답변 (3개)
Image Analyst
2013년 12월 31일
편집: Image Analyst
2014년 1월 1일
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.
댓글 수: 0
Jan
2013년 12월 31일
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.
Walter Roberson
2013년 12월 31일
patch_cell = mat2cell( I, 16*ones(1,size(I,1)/16), 16*ones(1,size(I,2)/16), size(I,3) );
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!