how to divide an 512*512 image into 8*8 blocks??
조회 수: 6 (최근 30일)
이전 댓글 표시
i want to divide an 512*512 image into 8*8 blocks using matlab can u please help me
댓글 수: 0
답변 (3개)
Mihir Daptardar
2014년 1월 22일
편집: Mihir Daptardar
2014년 1월 22일
You can use the mat2cell command to subdivide the matrix. For this particular case, please refer to the following code snippet. Please make sure that your inputSqMat is exactly divisible into the subDivisions
function out = cropping(inputSqMat, subDivisions)
lengthSqMat = size(inputSqMat,1);
subDivisionVect = subDivisions*ones(1, lengthSqMat/subDivisions);
out = mat2cell(inputSqMat, subDivisionVect, subDivisionVect);
To access a particular element, you can index into the variable. For example:
out{1,1}
댓글 수: 0
Image Analyst
2014년 1월 22일
See the FAQ for two ways to do it, one using cell arrays, and one not.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!