divide image into block of size 1*2
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a 512*512 image and I want to divide into blocks each having 1x2 pixels.So I will get total 131072 blocks.Now I want to process each blocks.
i am doing in matlab code.. Any idea?
댓글 수: 0
채택된 답변
Walter Roberson
2016년 10월 12일
image_blocks = num2cell(TheImage);
Now image_blocks{J,K} will be the 1 x 1 block corresponding to the pixel at TheImage{J,K}
I cannot think of any advantage of dividing into 1 x 1 blocks, unless perhaps it is for convenience in holding the bit equivalent as a unit ? But if that is the situation then
bit_cells = arrayfun(@(V) dec2bin(V,8), TheImage, 'Uniform', 0);
댓글 수: 2
Walter Roberson
2016년 10월 12일
image_blocks = mat2cell(TheImage, ones(1,size(TheImage,1), 2 * ones(1, size(TheImage,2)/2) );
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!