如何在Matlab中进行字符分割

Ofi*_* A. 1 matlab image-segmentation

我有车牌图像,我想逐个削减数字.

任何人都有简单的想法如何执行它?

在搜索网页后,我发现了一种通过水平和垂直拖尾操作的方法,但我真的不知道它是什么意思.

任何解释都会有帮助

提前致谢.

Luc*_*cas 8

regionprops可能适合你.如果你拿这个样品车牌.

样品

您可以使用这样的小脚本来剪切对象.对不起,我只是很快就把它拼在一起,但它给了你一个主意.

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
Run Code Online (Sandbox Code Playgroud)

这将输出图像

一个

还有这个

狗

你仍然需要决定它是否真的是一封信.小心,脚本会输出很多图像(约30或40)