0
该代码假设在Matlab中从图像执行字符分割。代码是卢卡斯给我的,非常感谢卢卡斯。代码解释 - Matlab
问题是,我想精确理解字符分割是如何完成的,我不想在理解它之前使用它。
任何人都可以为我解释...谢谢。
卢卡斯代码:
clear all;
close all;
I = imread('plate.jpg');
BW = im2bw(I, 0.9);
BW = ~BW;
stats = regionprops(BW);
for index=1:length(stats)
if stats(index).Area > 200 && stats(index).BoundingBox(3)*stats(index).BoundingBox(4) < 30000
x = ceil(stats(index).BoundingBox(1))
y= ceil(stats(index).BoundingBox(2))
widthX = floor(stats(index).BoundingBox(3)-1)
widthY = floor(stats(index).BoundingBox(4)-1)
subimage(index) = {BW(y:y+widthY,x:x+widthX,:)};
figure, imshow(subimage{index})
end
end
链接:how to perform character segmentation in Matlab
您应该查看http://www.mathworks.com/help/toolbox/images/ref/regionprops.html以了解有关regionprops及其属性的信息。 – 2011-06-08 01:56:20