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 visualización (últimos 30 días)
Mostrar comentarios más antiguos
%# 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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!