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