필터 지우기
필터 지우기

image block block dividing

조회 수: 1 (최근 30일)
javeed miyandad
javeed miyandad 2011년 4월 10일
sir i have a black and white(binary image) of size(i j) and i need to divide image into blocks of 3X3 size please help me in coding.
sir i used r=blkproc(BW,[3 3]); but it showing error like this
??? Index exceeds matrix dimensions.
Error in ==> blkproc>parse_inputs at 244 [fun,msg] = fcnchk(varargin{3},length(params));
Error in ==> blkproc at 62 [a, block, border, fun, params, padval] = parse_inputs(varargin{:});

채택된 답변

Walter Roberson
Walter Roberson 2011년 4월 10일
There is no default value for the function. You need to provide at least 3 arguments for blkproc()
If you do not want overlapping blocks, and your images are exact multiples of 3 on each side, and you just want all of the blocks returned instead of doing something with them, then:
r = mat2cell(BW, 3 * ones(1,size(BW,1)/3), 3 * ones(1,size(BW,2)/3));
This will return a cell array of 3x3 arrays.
  댓글 수: 10
Walter Roberson
Walter Roberson 2011년 4월 10일
imshow(r{2,7}) %for example
Soumya
Soumya 2011년 11월 14일
Sir I happened to see this answer,and
1) now i have a doubt that how the entire blocks of the image can be viewed like that of blkproc().
2)imshow(r{2,7}) ->what doest the two values 2 and seven refer to?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by