1、在线图像编码字符识别系统主要包括数字图像的采集、存储、图像预处理、编码图像提取、编码特征提取、编码识别和后续处理等一些环节,其流程图如图1所示。 图1 在线图像编码字符识别系统流程图在线轮胎图像编码字符识别系统要求对通过生产流水线上每一个轮胎采集含有轮胎编码的图像,然后通过对图像的处理,提取出轮胎编码特征,采用合适的识别算法将每一位编码字符进行识别。由于轮胎编码字符在轮胎上有一定变形,且摄像角度不同,得到的编码图像差异也很大,规律性差,所以编码图像的预处理和识别算法的选取显得尤为重要。2图像采集与存储在线编码图像通常使用数码摄像机、数码照相机、数码摄像头等设备采集并输入计算机进行处理,本系统采
2、用QuickCamPro4000数码摄像头采集轮胎编码图像,直接按JPG格式存储。编码图像一般都要先转成BMP图像格式,因为BMP格式己经成为PC领域事实上的标准几乎所有为Windows操作系统设计的图像处理软件都支持这种格式的图像。BMP是Windows的原始位图格式,它可以用于保存任意类型的位图数据,可以支持所有的屏幕分辨率和Windows所支持的颜色组合。一般情况下,为了保证显示的高效率,它对图像数据没有任何的压缩,所以一幅很小的位图就可能占据相当大的空间。BMP位图文件包括位图文件头、位图信息头、调色板、位图数据区四个部分,位图文件头由14个字节构成,位图信息头由40个字节构成,调色板
3、的大小取决于色彩数,单色图像调色板占8个字节,16色图像调色板占64个字节,256色图像调色板占1024个字节,224色图像没有调色板,位图数据区内数据按行顺序自下而上、自左而右排列。3图像预处理图像预处理主要包括有:图像灰度化、图像降噪与增强、编码区边缘检测、图像几何校正、编码区图像提取、编码图像二值化、字符分割、字符归一化等。下面介绍几个关键环节的处理过程。3.1 图像灰度化处理编码图像通常是彩色的,实际识别用的图像是灰度图,所在需要先将彩色编码图像转换为灰度图像。在RGB颜色模型中,如果R=G=B,则颜色(R,G,B)表示一种黒白颜色,其中R=G=B的值叫灰度值,灰度化处理就是使彩色的R
4、、G、B分量值相等的过程。常用灰度化处理方法是加权平均值法,即R=G=B=(WRR+WGG+WBB)/3其中,WR、WG、WB分别是R、G、B的权值,实验和理论证明,当WR=0.3, WG=0.59, WB=0.11时,即当R=G=B=0.30R+0.59G+0.11B时,能得到最合理的灰度图像。3.2 图像增强处理3.2.1 直接灰度变换线性灰度变换:假设图像灰度是线性变化的,如原图像f(x,y)灰度范围为a,b,要求变换后图像灰度范围达到c,d,根据线性规律,则变换后图像g(x,y)为: (1)非线性变换对数变换和指数变换。当需要扩展低灰度区、压缩高灰度区时使用对数变换,当需要扩展高灰度区
5、时使用指数变换。3.2.2 平滑滤波降噪由于噪声对应图像中的区域边缘等灰度值具有较大较快变化的部分,属高频分量,所以使用低通滤波器(即平滑滤波器)降噪。同时平滑还可以使图像模糊,有利于在提取较大的目标前去除较小的细节或将目标内的小间断连接起来。平滑降噪的方法是使用模板对图像进行卷积运算,线性平滑滤波器最常用的模板是如图2所示的33模板,将此模板与图像中像素按如下方法进行卷积运算,可得到平滑降噪的图像。将模板在图中漫游,并将模板中心与图中每个像素位置重合;将模板上系数与模板下对应像素相乘;将所有乘积相加;将和赋给图中对应模板中心位置的像素。非线性平滑滤波器最常用的是中值滤波器,它将区域中所有的值
6、按大小进行排序,将排序后位于中间的像素值赋予中心像素。中值滤波可有效地去除随机噪声,能得到较好的视觉效果。3.3 编码区边缘检测边缘是灰度值不连续的结果,可利用求一阶和二阶导数的方法检测到。因为在边缘地带导数值大,而非边缘的地方导数值小。由于数字图像是离散的,不能求导数,可以通过卷积的方法用差分近似代替微分。-11-22效果较好的边缘检测算法是Sobel算子。Sobel算子是一种梯度幅值,分别利用垂直算子Sx、水平算子Sy来获取编码区垂直边缘和水平边缘,即在水平和垂直方向上使用如图3所示的两个不同的卷积模板,得到如图4所示的边缘检测结果。图2 平滑滤波器模板 图3 Sobel边缘检测模板 图4
7、 Sobel算子边缘检测结果3.4 图像几何校正Hough变换可以检测出编码区图像倾斜角度,根据此角度进行旋转变换可使编码区图像得到校正。Hough变换可以将图像空间XY中的直线(y=px+q)检测问题转换到参数空间PQ中点的检测问题,在参数空间PQ里,建立一个累加数组Sum(p,q),对每一个图像空间中给定边缘点,让p取遍所有可能值,根据直线方程q=-xp+y计算出对应的q,对Sum(p,q)进行累加,得到Sum(p,q)的值就是在(p,q)处共线的点的个数,(p,q)的值就是图像空间中直线的斜率和截距,由斜率得到图像编码区水平边缘角度。3.5 字符切割通过对编码字符区直接进行水平扫描,由字
8、符间距一般可以将字符区域分割出来。也可以通过对编码字符区做垂直方向投影运算,根据字符大致宽度与字符总数,对字符进行切割。如图5所示是编码字符区及对应垂直投影图。 图5 编码字符及对应垂直投影 图6 线性插值示意图3.6 字符归一化处理对分割出的字符从四个方向扫描,确定字符边界,然后采用线性插值方法对每个字符作归一化处理,使每个字符归一为3216点阵。图6为线性插值示意图,根据线性原理,f(x1)可由公式(2)计算: (2)4识别算法设计字符识别一般采取特征判别或模板匹配的方法,特征判别是根据特征抽取的程度分阶段的、用结构分析的办法完成字符的识别。模板匹配即是根据字符的知识采取按形匹配的方法,模
9、板匹配一般分为两类:一类是直接利用输入的二维平面图像与字典中记忆的图形进行匹配;另一类是抽出部分特征与字典进行匹配。轮胎编码图像中字符仅涉及部分英文字符和10个阿拉伯数字,字符较少,结构相对简单,因此具体识别时,既可以采用图形匹配的方法,也可以采用结构分析的方法。但由于轮胎上编码字符有一定变形,且有断裂现象,所以直接模板匹配与直接特征抽取方法识别率都不理想,本系统使用了模板匹配与特征识别相结合的基于特征加权的模板匹配识别算法,其字符识别率比简单模板匹配算法和特征识别算法识别率都有不同程度的提高。基于特征加权的模板匹配识别算法基本思路是:给模板中有字符笔画的点分配不同的权重,位于笔画中心的点权重
10、最高,位于笔画边缘的点权重最低,然后将样本模板与标准模板逐点模糊匹配,按模糊识别规则识别。 5结论本文结合轮胎编码识别系统的实现对在线图像字符编码识别系统的设计进行了阐述,提出了一种模板匹配与特征匹配相结合的识别算法,该方法对传统的模板匹配算法进行了改进,提高了变形、断裂等字符的识别率。这种方法在试验中得到了验证,取得了令人满意的效果。The Development of A Kind of Online Image Code Recognition SystemAbstract: This paper describes the design and the implement of onl
11、ine image coding char recognition system. It analyses and researches the important contents about the system. Then it provides the solutions of main problems. In recognition algorithm, combining template matching with feature recognition, it put forword an improved template matching algorithm based
12、on feature weights. The algorithm can obviously improve the char recognition ratio.Keyword: image processing; pattern recognition; feature weights; software design0 IntroductionCharacter recognition of image coding is still the subject of intense study at home and abroad, it has broad applications,
13、such as Automatic number plate recognition, postal code of the automatic identification, automatic reading papers, reports, automatic processing, because of this online image coded character recognition has some common, this paper online tire coding character recognition system for the general image
14、 coding character recognition system has been elaborated on the key link of the research and analysis, the method of the other online image coded character system Development of guiding significance.1 An online image coding identification system processesOnline image coding character recognition sys
15、tem includes digital image capture, storage, image preprocessing, encoding the image extraction, feature extraction coding, coding identification and follow-up treatment of some aspects of its flow chart shown in Figure 1.Figure 1-line character recognition image coding system flowchartOnline tire i
16、mage coding character recognition system requires the production pipeline through the acquisition of each tire with tire encoded image, and then through image processing, coding to extract features of the tire, using the appropriate recognition algorithm to identify each coded character. Tire coding
17、 characters as a certain deformation in the tires, and different camera angles, are also great differences in the coding images, regularity is poor, so coded image preprocessing and recognition algorithms of selection is very important.2 Image Acquisition and StorageLine coding commonly used digital
18、 camera images, digital cameras, digital video cameras capture and processed in computer, the system uses QuickCamPro4000 tire coding digital camera image capture, directly from JPG format.Coded images generally must first convert BMP image format, because the BMP format has become the de facto stan
19、dard PC in the field - almost all of the Windows operating system designed for image processing software to support this format of the image. BMP is the original Windows bitmap format, which can be used to save any type of digital map data, can support all Windows supported screen resolution and col
20、or combination. Under normal circumstances, in order to ensure the display of high efficiency, it does not have any compressed image data, so a small bitmap may occupy considerable space.BMP bitmap file includes the bitmap file header, bitmap information header, palette, bitmap data area of four par
21、ts, bitmap file header from 14 bytes constitute the bitmap header from 40 bytes composition, tone color palette depends on the number of monochrome color images.Board accounted for 8 bytes, 16-color palette images accounted for 64 bytes, 256-color palette image 1024 bytes total, 224-color images wit
22、hout color palette, the bitmap data from the region under the order of the data by row and on the arrangement from left to right.3 PreprocessingImage preprocessing includes are: gray image, image noise reduction and enhancement, coding, edge detection, image geometry correction, image coding region
23、of extraction, encoding image binarization, character segmentation, character normalization and so on. Here are some key aspects of the process.3.1 gray image processingImages are usually color coded, the actual identification with the image is grayscale, where the need to convert first color-coded
24、images to grayscale. In the RGB color model, if R = G = B, then color (R, G, B) indicates a Black white color, in which R = G = B is called the value of gray value, gray level processing is to make the color of the R , G, B component value equal to the process. Gray-scale processing methods are comm
25、only used weighted average method, that is,R = G = B = (WRR + WGG + WBB) / 3Which, WR, WG, WB are the R, G, B the weight of experimental and theoretical proof, when WR = 0.3, WG = 0.59, WB = 0.11, that is when R = G = B = 0.30R +0.59 G +0.11 B, can be the most reasonable grayscale.3.2 image enhancem
26、ent processing3.2.1 Direct gray-scale transformation linear gray level transformation: if the image gray scale is linear, as in the original image f (x, y) gray-scale range of a, b, asked the transformed image intensity range of up to c, d, According to the linear law, the transformed image g (x, y)
27、 as: nonlinear transformation - log transformation and exponential transformation:When the need to expand low gray zone, gray zone of high compression used on the log transformation, when the need to expand the use of high gray area index transformation.3.2.2 smoothing filter - Noise ReductionAs the
28、 noise in the area corresponding to the edge of the image gray value of such rapid change with a larger part is a high frequency, so the use of low-pass filter (ie, smoothing filter) noise. At the same time can make the image fuzzy smoothing is beneficial to the larger goal of the extraction prior t
29、o removal of the smaller details or to target the small interruption link.Smoothing noise reduction method is to use the template on the image convolution operation, linear smoothing filter is the most commonly used template is shown in Figure 2 of the 3 3 template, this template and image in pixels
30、 by the following method of convolution , get smooth image noise reduction.1 In the figure, roaming the template and the template center and map location of each pixel overlap;2 the template on the coefficient multiplied with the template under the corresponding pixel;3 add all the product;4 It will
31、 assign the figure corresponds to the template and the center of the pixel.The most commonly used non-linear smoothing filter is median filter, it will all of the values of the region are sorted according to size, will be sorted in the middle of the pixel values given to the center pixel. Median filter c
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1