is there a way so that we extract a particular block from an 8x8 image?
이전 댓글 표시
i've an image of size 8x8 blocks i.e total of 64 blocks.
i want to extract or show only few blocks...
how can i do so?
for row = 1 : blockSizeR : rows
for col = 1 : blockSizeC : columns
row1 = row;
row2 = row1 + blockSizeR - 1;
row2 = min(rows, row2);
% Determine starting and ending columns.
col1 = col;
col2 = col1 + blockSizeC - 1;
col2 = min(columns, col2);
% Extract out the block into a single subimage.
oneBlock = grayImage(row1:row2, col1:col2);
% Specify the location for display of the image.
subplot(6,8, blockNumber);
imshow(oneBlock);
end
end
the above code shows all the 64 blocks..
what should i do, so that only block 10 and block 34 is show rather than all the blocks..
if there is a way tell me how to do it..
댓글 수: 5
Walter Roberson
2013년 3월 10일
Do you want the blocks numbered going down the rows or across the columns? e.g., is block 34 the 2nd one across on the 5th row, or the 2nd one down in the 5th column ?
Raman
2013년 3월 10일
Image Analyst
2013년 3월 10일
Ambiguous. Down the rows first (in a single column), before advancing to the next column? Or across the columns first (in a single row) before advancing to the next row. Why can't you just do a little math to figure out row1, row2, col1, and col2? Alternatively put in a counter and don't extract the block until the counter is what you want.
Raman
2013년 3월 12일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Neighborhood and Block Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!