code for sampling an image to form patches

조회 수: 12 (최근 30일)
ANCY
ANCY 2013년 12월 31일
답변: Image Analyst 2013년 12월 31일
If any one knows the code for sampling an image to make the larg image into small sections then please share it with me.

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 31일
patch_cell = mat2cell( 8*ones(1,size(IMAGE,1)/8), 8*ones(1,size(IMAGE,2)/8), size(IMAGE,3) );
for 8 x 8 patches.
Then patch_cell{5,19} would be the 5th row of patches, 19th patch over.
  댓글 수: 2
ANCY
ANCY 2013년 12월 31일
I mean how to make small subdivisions of image from a large image.That is how to make small samples from large sample?If u know the full matlab code for subsampling the image then please share it with me
Walter Roberson
Walter Roberson 2013년 12월 31일
This code does exactly that, using 8 x 8 pixel subdivisions of the image array named IMAGE. If you want to use a different size such as 64 x 64, replace the 8's by 64's.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 12월 31일

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by