如何从图像中按顺序拆分每个字符? [英] How do split every character with space in order from image?

查看:82
本文介绍了如何从图像中按顺序拆分每个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做OCR软件。为此,我必须从图像中提取每个字符。我在c#中使用AForge的Blobs Processing方法编写了代码。



I am doing OCR software. For this I have to extract every character from image. I have written a code using the method Blobs Processing from AForge in c#.

// create an instance of blob counter algorithm
BlobCounterBase bc = new BlobCounter( );
// set filtering options
bc.FilterBlobs = true;
bc.MinWidth  = 5;
bc.MinHeight = 5;
// set ordering options
bc.ObjectsOrder = ObjectsOrder.Size;
// process binary image
bc.ProcessImage( image );
Blob[] blobs = bc.GetObjectsInformation( );
// extract the biggest blob
if ( blobs.Length > 0 )
{
   bc.ExtractBlobsImage( image, blobs[0], true );
}



它成功提取每个字符。我现在面临的问题是:

1.提取的字符不合适

2.我没有获得任何空白



那我怎么能执行这个任务呢?


It extracts every character successfully. The problems I am facing now are:
1. Extracted character are not in order
2. I am not getting any white space

So how can I perform this task?

推荐答案

你按大小排序blob。按位置排序(横向/向下,对Y变化有一些容差)是你想要的。然后你需要检查每个blob的位置,看看它们之间是否存在一个你想要解释为空格的重要差距。



一个体面的OCR库应该做什么这个给你。我不确定Blob是什么,是OCR还是只是图像分析?
You're sorting the blobs by size. Sorting by position (across/down with some tolerance for Y variation) is what you want. Then you need to check the position of each blob to see if there's a significant gap between them that you want to interpret as a space.

A decent OCR library should do this for you. I'm not sure what Blobs is, is it OCR or is it just image analysis?


这篇关于如何从图像中按顺序拆分每个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆