陕 西 理 工 学 院 毕 业 设 计
to detect. Because the derivative of the edge of a large area, rather than the local derivative of the edge of the small. As the digital image is discrete, not the derivative, convolution method can replace the differential with the differential approximation.
Is better Sobel edge detection algorithm is operator. Sobel operator is a gradient amplitude
M?22sx?sy, respectively, using vertical operator Sx, Sy operator to obtain the level of the
coding region of the vertical edges and horizontal edges, that is, the horizontal and vertical directions as shown in Figure 3 using two different volumes product template, get the edge as shown in Figure 4 results.
Hough transform can detect the coding region of the image angle, the angle of rotation according to the coding region of the image transformation can be corrected.
Hough transform to the image space XY of the line (y = px + q) parameter space detection problem is transformed into the mid-point of detection PQ, PQ in the parameter space, the establishment of a cumulative array Sum (p, q), for each given the edge in image space, let p taken over all possible values, according to linear equation q =- xp + y to calculate the corresponding q, on the Sum (p, q) to accumulate, by Sum (p, q) the value of the is the (p, q) point total of the number line, (p, q) is the image space in the value of the slope and intercept, obtained by the slope angle of the edge image coding standard. 3.4 Character Cutting
Coded character area on the level of scanning directly from the character spacing can generally be out of character segmentation. Can also be done by coded character area vertical projection operation, according to the character width and character less the total number of characters to be cut. Figure 2 is a coded character areas and the corresponding vertical projection.
Figure A2 encoded characters and the corresponding Figure A3 Schematic diagram of vertical projection linear interpolation Character normalization
The character of the segmented into four scans to determine the character boundaries, and then use linear interpolation for each character for normalized so that each character is normalized to 32 × 16 lattice.
第27 页 共 37 页
陕 西 理 工 学 院 毕 业 设 计
Figure 3 Schematic diagram of linear interpolation, according to linear theory, f (x1) by the formula (2) Calculation:
f(x1)?(f(x2)?f(x0))(x1?x0)?f(x0)x2?x0 (A2)
4.Identification algorithm
To determine the general characteristics of character recognition or template matching method, Feature identification is based on the degree of feature extraction stages, complete with a structural analysis approach to character recognition. Template matching that is based on knowledge of the characters take shape matching method according to the template matching is generally divided into two categories: direct use of the imported two-dimensional plane images and dictionary matching graphics memory; the other is out of some feature match with the dictionary.
Tire coding image only some of the characters and English characters and 10 Arabic numerals, characters less, the structure is relatively simple, so when the specific identification, either graphical matching method, you can also use structural analysis. However, the tires have a certain deformation of character encoding, and there is breakage, so a direct template matching and feature extraction methods to identify directly rate is unsatisfactory, the system uses a template matching and feature recognition weighted combination of feature-based template matching recognition , the character recognition rate than simple template matching algorithm and feature recognition algorithm for the recognition rate improved to varying degrees.
Feature-based weighted template matching recognition algorithm basic idea is: to the template in character stroke of points assigned different weights, in the stroke center point of the highest weight, in the stroke edge point of the weight minimum, then the sample templates and Standard Template point by point fuzzy matching, recognition by fuzzy recognition rules.
5.Conclusion
In this paper, coded tire identification system character encoding to achieve on-line image recognition system design was described, a template matching and feature matching recognition algorithm combines the method of the traditional template matching algorithm is improved, improved deformation and fracture character recognition rate. This method was validated in the test and achieved satisfactory results.
第28 页 共 37 页
陕 西 理 工 学 院 毕 业 设 计
References
[1] Xu Deyan, Lin Zunqi. The optical surface roughness research pro gress and direction [1]. Optical instruments 1996, 18 (1): 32-37.
[2] Wang Yujing. Turning surface roughness based on image measurement [D]. Harbin: Harbin University of Science and Technology,2005,33.
[3] BRADLEY C. Automated surface roughness measurement[1]. The International Journal of Advanced Manufacturing Technology ,2000,16(9) :668-674.
[4] Li Chenggui, Li xing-shan. 3D surface topography measurement method [J]. Aerospace measurement technology, 2000, 20(4): 2-10.
[5] Liu He. Digital image processing and application [ M]. China Electric Power Press, 2005
第29 页 共 37 页
陕 西 理 工 学 院 毕 业 设 计
附录B 英文文献译文
一种在线图像编码识别系统的设计
摘要:本文介绍了在线图像编码字符识别系统的设计与实现过程,对其中重点环节进行了分析与研究,给出了主要环节问题的解决方法,在识别算法上,结合模板匹配与特征识别,提出了基于特征加权的模板匹配算法,该算法对提高字符识别率提到了较好的作用。
关键词:图像处理;模式识别;特征加权;软件设计 引言
图像编码字符识别的研究目前仍是国内外一个重点研究课题,它具有广泛的应用背景,比如车牌号码自动识别、邮政编码的自动识别、试卷自动阅读、报表自动处理等,由于这种在线图像编码字符的识别都具有一些共性,本文结合在线轮胎编码字符识别系统的设计,对一般图像编码字符识别系统进行了阐述,对关键环节进行了研究与分析,该方法对其它在线图像编码字符系统的开发具有一定指导意义。
1.在线图像编码识别系统流程
在线图像编码字符识别系统主要包括数字图像的采集、存储、图像预处理、编码图像提取、编码特征提取、编码识别和后续处理等一些环节,其流程图如图1所示。
图B1 在线图像编码字符识别系统流程图
在线轮胎图像编码字符识别系统要求对通过生产流水线上每一个轮胎采集含有轮胎编码的图像,然后通过对图像的处理,提取出轮胎编码特征,采用合适的识别算法将每一位编码字符进行识别。由于轮胎编码字符在轮胎上有一定变形,且摄像角度不同,得到的编码图像差异也很大,规律性差,所以编码图像的预处理和识别算法的选取显得尤为重要。 2.图像采集与存储
在线编码图像通常使用数码摄像机、数码照相机、数码摄像头等设备采集并输入计算机进行处理,本系统采用QuickCamPro4000数码摄像头采集轮胎编码图像,直接按JPG格式存储。
编码图像一般都要先转成BMP图像格式,因为BMP格式己经成为PC领域事实上的标准——几乎所有为Windows操作系统设计的图像处理软件都支持这种格式的图像。BMP是Windows的原始位图
第30 页 共 37 页
原始图像 图像预处理 编码特征提取与识别 后续处理 陕 西 理 工 学 院 毕 业 设 计
格式,它可以用于保存任意类型的位图数据,可以支持所有的屏幕分辨率和Windows所支持的颜色组合。一般情况下,为了保证显示的高效率,它对图像数据没有任何的压缩,所以一幅很小的位图就可能占据相当大的空间。
BMP位图文件包括位图文件头、位图信息头、调色板、位图数据区四个部分,位图文件头由14个字节构成,位图信息头由40个字节构成,调色板的大小取决于色彩数,单色图像调色板占8个字节,16色图像调色板占64个字节,256色图像调色板占1024个字节,224色图像没有调色板,位图数据区内数据按行顺序自下而上、自左而右排列。
3.图像预处理
图像预处理主要包括有:图像灰度化、图像降噪与增强、编码区边缘检测、图像几何校正、编码区图像提取、编码图像二值化、字符分割、字符归一化等。下面介绍几个关键环节的处理过程。 3.1 图像灰度化处理
编码图像通常是彩色的,实际识别用的图像是灰度图,所在需要先将彩色编码图像转换为灰度图像。在RGB颜色模型中,如果R=G=B,则颜色(R,G,B)表示一种黒白颜色,其中R=G=B的值叫灰度值,灰度化处理就是使彩色的R、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)为:
g(x,y)?d?cf(x,y)?cb?a (B1)
②非线性变换——对数变换和指数变换。当需要扩展低灰度区、压缩高灰度区时使用对数变换,当需要扩展高灰度区时使用指数变换。 3.2.2 平滑滤波—降噪
由于噪声对应图像中的区域边缘等灰度值具有较大较快变化的部分,属高频分量,所以使用低通滤波器(即平滑滤波器)降噪。同时平滑还可以使图像模糊,有利于在提取较大的目标前去除较
第31 页 共 37 页