how to divide an image into blocks
조회 수: 1 (최근 30일)
이전 댓글 표시
how to divide an image into blocks of size 10*10,can anyone help please
댓글 수: 0
답변 (2개)
Junaid
2011년 12월 11일
Dear Pat,
mat2cell is the only easy solution for your question. You are getting this error because your the mod of your IMG and 10 is not equal to zero. In other words the dimensions of IMG can't be evenly divided by 10. so either you take image of size whose dimensions are divisible by 10. Example:
IMG = magic(100);
IMGcells = mat2cell(IMG, 10*ones(1,size(IMG,1)/10), 10*ones(1,size(IMG,2)/10));
so make sure your image dimensions are divisible by 10, or any grid size you want.
댓글 수: 0
Walter Roberson
2011년 9월 12일
IMGcells = mat2cell(IMG, 10*ones(1,size(IMG,1)/10), 10*ones(1,size(IMG,2)/10);
참고 항목
카테고리
Help Center 및 File Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!