After the splitting/dividing of an image to 3x3 sub-blocks, how do I choose a specific sub-block for my image processing. After that particular sub-block is done image processing, all the sub-blocks image are combinn to a single figure. Thanks.

조회 수: 1 (최근 30일)
%# desird number of horizontal/vertical tiles to divide the image into
numBlkH = 3; %%Row
numBlkW = 3; %%Column
%# compute size of each tile in pixels
[imgH,imgW,~] = size(InputImage);
szBlkH = [repmat(fix(imgH/numBlkH),1,numBlkH-1) imgH-fix(imgH/numBlkH)*(numBlkH-1)];
szBlkW = [repmat(fix(imgW/numBlkW),1,numBlkW-1) imgW-fix(imgW/numBlkW)*(numBlkW-1)];
%# divide into tiles, and linearize using a row-major order
C = mat2cell(InputImage, szBlkH, szBlkW)';
C = C(:);
%# display tiles i subplots
figure
for i=1:numBlkH*numBlkW
subplot(numBlkH,numBlkW,i), imshow( C{i} )
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by