【正文】
料的過程中我也增強自己學習的能力。真真正正的提高了我遇到問題分析問題解決問題的能力。這些都是我在以后的學習、生活和工作中的寶貴財富。附 錄指針式模擬表盤自動讀數(shù)算法設計程序:clear。clc。RGB=imread(39。39。)。figure,imshow(RGB)。 title(39。RGB39。)GRAY=rgb2gray(RGB)。figure,imshow(GRAY)。 title(39。GRAY39。)threshold=graythresh(GRAY)。ysu 專業(yè)綜合訓練結題報告19BW=im2bw(GRAY,threshold)。figure,imshow(BW)。 title(39。BW39。)BW=~BW。figure,imshow(BW)。 title(39。~BW39。)BW=bwmorph(BW,39。thin39。,Inf)。figure,imshow(BW)。 title(39。BWMORPH39。)[M,N]=size(BW)。[H,T,R] = hough(BW)。figure。imshow(H,[],39。XData39。,T,39。YData39。,R,39。InitialMagnification39。,39。fit39。)。 xlabel(39。\theta39。), ylabel(39。\rho39。)。 axis on, axis normal, hold on。 P = houghpeaks(H,1,39。threshold39。,ceil(*max(H(:))))。 x = T(P(:,2))。 y = R(P(:,1))。 plot(x,y,39。s39。,39。color39。,39。white39。)。%%%%%%%%%%%%%%%%%%%% Find lines and plot them%%%%%%%%%%%%%% lines = houghlines(BW,T,R,P,39。FillGap39。,5,39。MinLength39。,7)。 hold on。 figure, imshow(RGB), hold on max_len = 0。 for k = 1:length(lines) xy = [lines(k).point1。 lines(k).point2]。 plot(xy(:,1),xy(:,2),39。LineWidth39。,2,39。Color39。,39。green39。)。%%%%%%%%%% plot beginnings and ends of lines%%%%%%%%%%%%%%%%%%ysu 專業(yè)綜合訓練結題報告20 plot(xy(1,1),xy(1,2),39。x39。,39。LineWidth39。,2,39。Color39。,39。yellow39。)。 plot(xy(2,1),xy(2,2),39。x39。,39。LineWidth39。,2,39。Color39。,39。red39。)。%%%% determine the endpoints of the longest line segment %%%% len = norm(lines(k).point1 lines(k).point2)。 if ( len max_len) max_len = len。 xy_long = xy。 end end%%%%%%%%%%%%% highlight the longest line segment%%%%%%%%%%%%%% plot(xy_long(:,1),xy_long(:,2),39。LineWidth39。,2,39。Color39。,39。cyan39。)。 k=(xy(2,2)xy(1,2))/(xy(2,1)xy(1,1))。 theta=pi/2+atan(k)。 if((xy(1,1)+xy(2,1))/2=N/2) q=(theta+pi)*180/。 else q=theta*180/。 end shishu=q*100/360。 disp (theta)。 disp (q)。 disp (shishu)。 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ysu 專業(yè)綜合訓練結題報告21參考文獻[1]嚴義,[J].儀表技術與傳感器,:28~30.[2] enhancement and :,ed..Picture Processing and Digital Filtering,New York:SpringerVerlag,1975.[3]Kenh RC ,[M]. 北京:電子工業(yè)出版社,2022.[4]王延杰,[J].光學精密工程,1994,2(5):17~21.[5]嚴超華,劉高航,黎明, Hough 變換方法[J].南昌航空工業(yè)學院學報,2022,14(3):36~39.[6][M].北京:清華大學出版社,1999.[7] :國防工業(yè)出版社,2022 年 1 月[8]Tinku Acharya,Ajoy 田浩ysu 專業(yè)綜合訓練結題報告1等譯 .:清華大學出版社,2022 年 7 月