




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 數(shù)字圖像處理課程設(shè)計(jì)報(bào)告 數(shù)字圖像處理課程設(shè)計(jì)報(bào)告姓 名:宋東洋、祁飛、馮登科 學(xué) 號(hào): 20137750342、20137750336、20137750309 班 級(jí): 軟件開(kāi)發(fā) .NET 3班 設(shè)計(jì)題目: 手寫(xiě)體數(shù)字識(shí)別 教 師: 龐海波老師 提交日期: 2015年12月25日 一、設(shè)計(jì)內(nèi)容:主題:手寫(xiě)體數(shù)字識(shí)別詳細(xì)說(shuō)明:讀入手寫(xiě)體數(shù)字圖片,選擇要識(shí)別的數(shù)字然后通過(guò)尋找數(shù)字邊界將圖像裁剪的邊緣,然后生成裁剪后圖像的二進(jìn)制圖像,并將其轉(zhuǎn)換成57的圖像,然后進(jìn)行特征提取,運(yùn)行Simulink模型識(shí)別數(shù)字。二、現(xiàn)實(shí)意義:手寫(xiě)體數(shù)字的識(shí)別有著非常廣泛的應(yīng)用(如:郵政編碼、統(tǒng)計(jì)報(bào)表、財(cái)務(wù)報(bào)表、銀行
2、票據(jù)等等)。三、涉及知識(shí)內(nèi)容:1、邊界查找2、二值化3、Simulink模型四、實(shí)例分析及截圖效果:(1) 代碼顯示:1、程序中定義圖像變量說(shuō)明 (1)S-原圖變量;(2)img_crop-選擇的圖象;(3)imgGray-灰度圖像變量(4)BW-二值化圖像;(5)charvec-5*7圖像變量;2、實(shí)現(xiàn)代碼:Index.mfunction varargout = charGUI(varargin)% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename,
3、. gui_Singleton, gui_Singleton, . gui_OpeningFcn, charGUI_OpeningFcn, . gui_OutputFcn, charGUI_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_main
4、fcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT% - Executes just before charGUI is made visible.function charGUI_OpeningFcn(hObject, eventdata, handles, varargin)load data;assignin(base,net,net);handles.output = hObject;guidata(hObject, handles);% - Outputs from this function ar
5、e returned to the command line.function varargout = charGUI_OutputFcn(hObject, eventdata, handles) varargout1 = handles.output;% - Executes on button press in pbLoad.function pbLoad_Callback(hObject, eventdata, handles)filename, pathname = uigetfile(*.bmp;*.jpg;*.gif;*.*, Pick an Image File);S = imr
6、ead(pathname,filename);axes(handles.axes1);imshow(S);handles.S = S;guidata(hObject, handles);% - Executes on button press in pbSelect.function pbSelect_Callback(hObject, eventdata, handles)S = handles.S;axes(handles.axes1);img_crop = imcrop(S);axes(handles.axes2);imshow(img_crop);handles.img_crop =
7、img_crop;guidata(hObject, handles);% - Executes on button press in pbPreprocess.function pbPreprocess_Callback(hObject, eventdata, handles)img_crop = handles.img_crop;imgGray = rgb2gray(img_crop);bw = im2bw(img_crop,graythresh(imgGray);axes(handles.axes3);imshow(bw);bw2 = edu_imgcrop(bw);axes(handle
8、s.axes4);imshow(bw2);handles.bw2 = bw2;guidata(hObject, handles);% - Executes on button press in pbExtract.function pbExtract_Callback(hObject, eventdata, handles)bw2 = handles.bw2;charvec = edu_imgresize(bw2);axes(handles.axes5);plotchar(charvec);handles.charvec = charvec;guidata(hObject, handles);
9、% - Executes on button press in pbRecognize.function pbRecognize_Callback(hObject, eventdata, handles)charvec = handles.charvec;selected_net = get(handles.editNN,string);selected_net = evalin(base,selected_net);result = sim(selected_net,charvec);val, num = max(result);set(handles.editResult, string,
10、mod(num,10);% - Executes on button press in pbNN.function pbNN_Callback(hObject, eventdata, handles)function editNN_Callback(hObject, eventdata, handles)% - Executes during object creation, after setting all properties.function editNN_CreateFcn(hObject, eventdata, handles)if ispc & isequal(get(hObje
11、ct,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hObject,BackgroundColor,white);endfunction editResult_Callback(hObject, eventdata, handles)% - Executes during object creation, after setting all properties.function editResult_CreateFcn(hObject, eventdata, handles)if ispc & isequal(get
12、(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hObject,BackgroundColor,white);endedu_imgcrop.mfunction bw2 = edu_imgcrop(bw)% 求圖像的邊界y2temp x2temp = size(bw);x1=1;y1=1;x2=x2temp;y2=y2temp;% 尋找左側(cè)空白空間cntB=1;while (sum(bw(:,cntB)=y2temp) x1=x1+1; cntB=cntB+1;end% 尋找右側(cè)空白空間cntB=1;wh
13、ile (sum(bw(cntB,:)=x2temp) y1=y1+1; cntB=cntB+1;end% 尋找上邊空白空間cntB=x2temp;while (sum(bw(:,cntB)=y2temp) x2=x2-1; cntB=cntB-1;end% 尋找下邊空白空間cntB=y2temp;while (sum(bw(cntB,:)=x2temp) y2=y2-1; cntB=cntB-1;end% 將圖像裁剪到邊緣bw2=imcrop(bw,x1,y1,(x2-x1),(y2-y1);edu_imgresize.mfunction lett = edu_imgresize(bw2)%
14、 此功能將采取裁剪的二進(jìn)制圖像,并將其改為57% 單個(gè)向量中的特征表示。bw_7050=imresize(bw2,70,50);for cnt=1:7 for cnt2=1:5 Atemp=sum(bw_7050(cnt*10-9:cnt*10),(cnt2*10-9:cnt2*10); lett(cnt-1)*5+cnt2)=sum(Atemp); endendlett=(100-lett)/100);lett=lett;3、運(yùn)行效果截圖:第一步:讀取原圖,并顯示第二步:選擇圖像并顯示第三步:預(yù)處理(二值化、查找邊界、裁剪圖片)第四步: 特征提取第五步:顯示數(shù)字(運(yùn)行Simulink模型)四、算法分析(1)Simulink模型sim函數(shù)用來(lái)運(yùn)行Simulink模型。需要注意的是,用戶無(wú)法控制其仿真過(guò)程(例如暫停、繼續(xù)),一旦運(yùn)行就會(huì)直到達(dá)到結(jié)束條件為止這一點(diǎn)和通過(guò)模型窗口界面運(yùn)行仿真不同。五、心得體會(huì)通過(guò)這次的課程設(shè)計(jì),我對(duì)Matlab有了一定的了解
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 設(shè)定明確的工作優(yōu)先級(jí)計(jì)劃
- 財(cái)務(wù)分析在企業(yè)評(píng)估中的應(yīng)用計(jì)劃
- 教學(xué)創(chuàng)新與成果分享機(jī)制計(jì)劃
- 防止職業(yè)倦怠的小技巧計(jì)劃
- 醫(yī)學(xué)影像科醫(yī)生工作計(jì)劃
- 建立員工反饋與建議機(jī)制計(jì)劃
- 2025年電動(dòng)晾衣機(jī)項(xiàng)目合作計(jì)劃書(shū)
- 景區(qū)承包合同
- 珠寶定制服務(wù)特殊條款協(xié)議
- 農(nóng)產(chǎn)品電商項(xiàng)目開(kāi)發(fā)合作框架協(xié)議
- (完整版)中心醫(yī)院心血管學(xué)科的專科建設(shè)與發(fā)展規(guī)劃
- 勞動(dòng)合同法草案的立法背景與創(chuàng)新黎建飛中國(guó)人民大學(xué)法學(xué)院教授
- 第三章 檢測(cè)儀表與傳感器
- 服裝QC尾期查貨報(bào)告(中英雙語(yǔ))
- 冷庫(kù)噴涂施工工藝(詳細(xì))
- 電機(jī)學(xué)辜承林(第三版)第1章
- 醫(yī)療機(jī)構(gòu)停業(yè)(歇業(yè))申請(qǐng)書(shū)
- Counting Stars 歌詞
- 肩鎖關(guān)節(jié)脫位的分型及其endobutton手術(shù)治療
- 管理系統(tǒng)中計(jì)算機(jī)應(yīng)用PPT課件
- 企業(yè)辦公自動(dòng)化系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)
評(píng)論
0/150
提交評(píng)論