在我的车牌识别应用程序(英国车牌)中,我做了一个矩形检测,我使用了几个标准,例如车牌的宽/长比以及车牌的最小宽度和长度。我已经设法显著地减少了非车牌区域。我的最后一个标准是获得每个候选区域的连接分量的数量,这样我就可以验证我在研究论文中读到的车辆图像的真实车牌区域。
我使用的是C#和Aforge.Net库。但是如何使用ConnectedComponentsLabeling来获取车牌中连接的元件的数量呢?
发布于 2012-10-27 20:11:09
我正在做这个:
FiltersSequence preOcr = new FiltersSequence(
Grayscale.CommonAlgorithms.BT709,
new BradleyLocalThresholding());
Bitmap grayscale = preOcr.Apply(original);
var labels = new ConnectedComponentsLabeling();
labels.Apply(new Invert().Apply(grayscale));
//Console.WriteLine(labels.ObjectCount); // Here you go
foreach (var candidate in labels.BlobCounter.GetObjectsInformation())
{
using (Bitmap symbol = new Bitmap(candidate.Rectangle.Width,
candidate.Rectangle.Height))
using (Graphics g2 = Graphics.FromImage(symbol))
{
g2.DrawImage(grayscale, 0, 0, candidate.Rectangle, GraphicsUnit.Pixel);
symbol.Save(String.Format(@"temp\{0}-{1}.jpg",i,++n), ImageFormat.Jpeg);
// do stuff
}
}
发布于 2015-01-31 00:09:23
找到与车牌对应的斑点后,使用此斑点图像作为另一个斑点计数器实例的输入。结果将告诉您此blob Image中的组件数量。
https://stackoverflow.com/questions/11600218
复制相似问题