Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how do i divide image into subblocks in 1:2:1 proportion like shown in the figure
조회 수: 1 (최근 30일)
이전 댓글 표시
please help me with this
댓글 수: 1
답변 (1개)
Walter Roberson
2018년 1월 31일
[r, c, p] = size(YourImage);
rq = floor(r/4); rh = floor(r/2); rq3 = r - rq - rh;
rparts = [rq rh rq3];
cq = floor(c/4); ch = floor(c/2); cq3 = c - cq - ch;
cparts = [cq ch cq3];
blocks = mat2cell(YourImage, rparts, cparts, p);
I do operations this way because of the possibility that the size is not exactly divisible by 4, and wanting to be sure that we do not get an off-by-one due to round-off.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!