clc;
clear all;
close all;
fontSize = 20;
folder = fullfile(matlabroot, '\toolbox\images\imdemos');
baseFileName = 'lena.png';
fullFileName = fullfile(folder, baseFileName);
if ~exist(fullFileName, 'file')
fullFileName = baseFileName;
if ~exist(fullFileName, 'file')
errorMessage = sprintf('Error: %s does not exist.', fullFileName);
uiwait(warndlg(errorMessage));
return;
end
end
figure,imshow ('lena.png');
a = imread(fullFileName);
a = imresize(a, [64 64]);
[rows columns numberOfColorBands] = size(a);
ca = mat2cell(a,8*ones(1,size(a,1)/8),8*ones(1,size(a,2)/8),3);
plotIndex = 1;
c1=zeros(size(a,1),size(a,2),3);
for c = 1 : size(ca, 2)
for r = 1 : size(ca, 1)
fprintf('c=%d, r=%d\n', c, r);
Text = sprintf('M');
H = vision.TextInserter(Text);
H.Color = [0.0 0.0 0];
H.FontSize = 3;
b = step(H,ca{r,c});
size(b);
c1(8*(c-1)+1:8*c,8*(r-1)+1:8*r,:) = b;
plotIndex = plotIndex + 1;
end
end
size(c1)
imshow(uint8(c1))
if true
end
end
댓글 수: 0
댓글을 달려면 로그인하십시오.