执行此代码时出现问题。我想从图像中提取文本,这是我的代码从自然图像中提取文字
i = imread('handicapped.jpg');
i1 = rgb2gray(i);
imshow(i1);
i2 = edge(i1,'canny',0.3);
imshow(i2);
se = strel('square',2);
i3 = imdilate(i2,se);
imshow(i3);
i4 = imfill(i3,'holes');
imshow(i4);
[Ilabel num] = bwlabel(i4);
disp(num);
Iprops = regionprops(Ilabel);
Ibox = [Iprops.BoundingBox];
Ibox = reshape(Ibox,[4 92]);
imshow(i);
hold on;
for cnt = 1:92
rectangle('position',Ibox(:,cnt),'edgecolor','r');
end
我在第19行
Error using reshape
To RESHAPE the number of elements must not change.
Error in test11 (line 19)
Ibox = reshape(Ibox,[4 92]);
任何人都可以帮我一个错误???
开始。为什么重塑使用,为什么这些维度? – nkjt