sub divide the image with overlaps

조회 수: 1 (최근 30일)
mahesh chathuranga
mahesh chathuranga 2013년 10월 4일
댓글: Image Analyst 2013년 10월 4일
my image is a =
[0 0 1 1;
0 0 1 1;
0 2 2 2;
2 2 3 3];(this is only example image actual image is larger than this) i want to sub divide this into 4*4 blocks with overlaps.then i want to call each individual nine blocks.(B1,B2,........,B9);
B(1,1)=[0 0;0 0];
B(1,2)=[0 1;0 1];
B(1,3)=[1 1;1 1];
B(2,1)=[0 0;0 2];
B(2,2)=[0 1;2 2];how can i do this.
  댓글 수: 1
mahesh chathuranga
mahesh chathuranga 2013년 10월 4일
is there any method to subdivide the image with overlaps?

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

답변 (1개)

Image Analyst
Image Analyst 2013년 10월 4일
편집: Image Analyst 2013년 10월 4일
I don't know what you mean when you say "i want to call each individual nine blocks". Perhaps blockproc() can work for you, or simply conv2() . Or maybe mat2cell() . Depends on what "call" means. See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_split_an_image_into_non-overlapping_blocks.3F if you want non-overlapping blocks. You can have blockproc() to overlapping blocks instead of moving over in jumps but it's a little non-obvious. Or you can use imfilter() or nlfilter() if you have the Image Processing Toolbox.
  댓글 수: 2
mahesh chathuranga
mahesh chathuranga 2013년 10월 4일
call means ,i want to display each blocks separately and i want to do some calculations for each block.i want to address each block. yes you are correct i have tried for blkproc. can i apply more than one function as fun in
B = blkproc(A,[m n],[mborder nborder],fun).
Image Analyst
Image Analyst 2013년 10월 4일
See the attached demos. You can run a custom function in blockproc() (this is in the demo) and in there you can use imshow() to display the small individual blocks if you want.

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

카테고리

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