指针式仪表自动读数识别系统设计 - 图文 下载本文

工业生产线在线检测数据数字化处理系统设计

A0=imread('1.jpg'); seed=[100,220];

thresh=15;%相似性选择阈值 A=rgb2gray(A0);

A=imadjust(A,[min(min(double(A)))/255,max(max(double(A)))/255],[]);

A=double(A); B=A;

[r,c]=size(B); n=r*c;

pixel_seed=A(seed(1),seed(2)); q=[seed(1) seed(2)]; top=1;

M=zeros(r,c);

M(seed(1),seed(2))=1; count=1;

while top~=0; r1=q(1,1); c1=q(1,2); p=A(r1,c1); dge=0;

for i=-1:1 for j=-1:1

if r1+i<=r & r1+i>0 & c1+j<=c & c1+j>0

if abs(A(r1+i,c1+j)-p)<=thresh & M(r1+i,c1+j)~=1 top=top+1;

q(top,:)=[r1+i c1+j]; M(r1+i,c1+j)=1; count=count+1; B(r1+i,c1+j)=1; end

if M(r1+i,c1+j)==0; dge=1; end else

dge=1; end end end

if dge~=1

B(r1,c1)=A(seed(1),seed(2)); end

33

工业生产线在线检测数据数字化处理系统设计

if count>=n top=1; end

q=q(2:top,:); top=top-1; end

subplot(1,2,1),imshow(A,[]); subplot(1,2,2),imshow(B,[]);

A0=imread('1.jpg'); seed=[100,220];

thresh=15;%相似性选择阈值 A=rgb2gray(A0);

A=imadjust(A,[min(min(double(A)))/255,max(max(double(A)))/255],[]);

A=double(A); B=A;

[r,c]=size(B); n=r*c;

pixel_seed=A(seed(1),seed(2)); q=[seed(1) seed(2)]; top=1;

M=zeros(r,c);

M(seed(1),seed(2))=1; count=1;

while top~=0; r1=q(1,1); c1=q(1,2); p=A(r1,c1); dge=0;

for i=-1:1 for j=-1:1

if r1+i<=r & r1+i>0 & c1+j<=c & c1+j>0

if abs(A(r1+i,c1+j)-p)<=thresh & M(r1+i,c1+j)~=1 top=top+1;

q(top,:)=[r1+i c1+j]; M(r1+i,c1+j)=1; count=count+1; B(r1+i,c1+j)=1; end

if M(r1+i,c1+j)==0; dge=1; end

34

工业生产线在线检测数据数字化处理系统设计

else

dge=1; end end end

if dge~=1

B(r1,c1)=A(seed(1),seed(2)); end

if count>=n top=1; end

q=q(2:top,:); top=top-1; end

subplot(1,2,1),imshow(A,[]); subplot(1,2,2),imshow(B,[]);

附录二 labview程序框图

35

工业生产线在线检测数据数字化处理系统设计

参考文献

36

工业生产线在线检测数据数字化处理系统设计

[1]

Sablatnig, Robert, Kropatsch, Walter G. Automatic Reading of Analog

DisplayInstruments.Conference on Pattern Recognition, 1994, 1:794-797.

[2]

Kyong-Ho Kim, Sung-Li Chen, Yong-Bum Lee, Jong Min Lee. A Study on Analog and

Digital Meter Recognition Based on Image Processing Technique. Journal of the Korean Institute of elematics and Eleatronics, 1995, 9(32):79-94.

[3]

F.C0rreaAlegria,A.Cruzz.Serra.Automatie Calibration of Analog and Digital

Measuring Instruments Using ComPuter Vision[J].IEEE Transaction on Instrumentation and Measurement,2000,49(l):94一99.

[4]

孙凤杰,安田江,范杰清,杨春萍,徐征. 电力变压器温度表指针位置识别研究[J]. 中

国电机工程学报,2007,27(7): 70-75.

[5]

黎明,王厚枢.飞机零位检测系统中的座舱读数识别法团.南京航空航天大学学报,1996,

l(28):106-112.

[6]

周洪,钟明慧.工业过程显示的数字处理与视频传输.仪表仪表学报(增刊),2003,

4(24):359-361.57

[7]

杨晓敏,何小海,吴炜等.基于高斯混合模型的车辆字符识别算法.光电子?激光,2007,

4:487-490.

[8]

何智杰 , 张彬 , 金连文 . 高精度指针仪表自动读数识别方法 [J]. 计算机辅助工

程 ,2006,15(3): 9-18.

[9]

宁志刚, 汪仁煌, 唐冬, 李貌. 基于图像处理的高精度仪表判读方法[J]. 传感器与微

系统,2006,25(3): 32-37.

[10][11]

于殿泓. 图像检测与处理技术[M]. 西安: 西安电子科技大学出版社, 2006: 103-169.

田村秀行(著), 金喜子, 乔双(译). 计算机图像处理[M]. 北京: 科学出版社,2004:

117-121.

[12]

Rezai-rad,G. Aghababaie,M. Comparison of SUSAN and Sobel Edge Detection in

MRI Images for Feature Extraction [C]. Information and Communication Technologies, 2006.ICTTA ‘06. 2nd, 2006, 1: 1103-1107.

[13][14]

沈洁, 杜宇人, 高浩军. 图像边缘检测技术研究[J]. 信息技术,2005, (12): 32-34. Villegas, O.O.V. Elias, R.P. Villela, P.R. Salazar, A.M. Edge Preserving Lossy

Image Compression with Wavelets and Contourlets [C]. Electronics, Robotics and Automotive Mechanics Conference, 2006, 1: 3-8.

[15]

张艳群, 孟凡龙. MATLAB 在图像边缘检测中的应用[J]. 计算机应用研究, 2004, (6):

144-146.

37