




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、function varargout = FR_Processed_histogram(varargin)%這種算法是基于直方圖處理的方法%The histogram of image is calculated and then bin formation is done on the%basis of mean of successive graylevels frequencies. The training is done on odd images of 40 subjects (200 images out of 400 images) %The results of the im
2、plemented algorithm is 99.75 (recognition fails on image number 4 of subject 17)gui_Singleton = 1;gui_State = struct('gui_Name', mfilename, . 'gui_Singleton', gui_Singleton, . 'gui_OpeningFcn', FR_Processed_histogram_OpeningFcn, . 'gui_OutputFcn', FR_Processed_histogr
3、am_OutputFcn, . 'gui_LayoutFcn', , . 'gui_Callback', );if nargin && ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NO
4、T EDIT %-% - Executes just before FR_Processed_histogram is made visible.function FR_Processed_histogram_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% ha
5、ndles structure with handles and user data (see GUIDATA)% varargin command line arguments to FR_Processed_histogram (see VARARGIN) % Choose default command line output for FR_Processed_histogramhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes FR_Processed
6、_histogram wait for user response (see UIRESUME)% uiwait(handles.figure1);global total_sub train_img sub_img max_hist_level bin_num form_bin_num; total_sub = 40;train_img = 200;sub_img = 10;max_hist_level = 256;bin_num = 9;form_bin_num = 29;%-% - Outputs from this function are returned to the comman
7、d line.function varargout = FR_Processed_histogram_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see G
8、UIDATA) % Get default command line output from handles structurevarargout1 = handles.output; %-% - Executes on button press in train_button. function train_button_Callback(hObject, eventdata, handles)% hObject handle to train_button (see GCBO)% eventdata reserved - to be defined in a future version
9、of MATLAB% handles structure with handles and user data (see GUIDATA) global train_processed_bin;global total_sub train_img sub_img max_hist_level bin_num form_bin_num; train_processed_bin(form_bin_num,train_img) = 0;K = 1;train_hist_img = zeros(max_hist_level, train_img); for Z=1:1:total_sub for X=
10、1:2:sub_img %train on odd number of images of each subject I = imread( strcat('ORLS',int2str(Z),'',int2str(X),'.bmp') ); rows cols = size(I); for i=1:1:rows for j=1:1:cols if( I(i,j) = 0 ) train_hist_img(max_hist_level, K) = train_hist_img(max_hist_level, K) + 1; else train_h
11、ist_img(I(i,j), K) = train_hist_img(I(i,j), K) + 1; end end end K = K + 1; end end r c = size(train_hist_img);sum = 0;for i=1:1:c K = 1; for j=1:1:r if( (mod(j,bin_num) = 0 ) sum = sum + train_hist_img(j,i); train_processed_bin(K,i) = sum/bin_num; K = K + 1; sum = 0; else sum = sum + train_hist_img(
12、j,i); end end train_processed_bin(K,i) = sum/bin_num;end display ('Training Done')save 'train' train_processed_bin; %-% - Executes on button press in Testing_button. function Testing_button_Callback(hObject, eventdata, handles)% hObject handle to Testing_button (see GCBO)% eventdata
13、reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global train_img max_hist_level bin_num form_bin_num;global train_processed_bin;global filename pathname I load 'train'test_hist_img(max_hist_level) = 0;test_processed_bin(form_b
14、in_num) = 0; rows cols = size(I); for i=1:1:rows for j=1:1:cols if( I(i,j) = 0 ) test_hist_img(max_hist_level) = test_hist_img(max_hist_level) + 1; else test_hist_img(I(i,j) = test_hist_img(I(i,j) + 1; end end end r c = size(test_hist_img); sum = 0; K = 1; for j=1:1:c if( (mod(j,bin_num) = 0 ) sum =
15、 sum + test_hist_img(j); test_processed_bin(K) = sum/bin_num; K = K + 1; sum = 0; else sum = sum + test_hist_img(j); end end test_processed_bin(K) = sum/bin_num; sum = 0;K = 1; for y=1:1:train_img for z=1:1:form_bin_num sum = sum + abs( test_processed_bin(z) - train_processed_bin(z,y) ); end img_bin
16、_hist_sum(K,1) = sum; sum = 0; K = K + 1; end temp M = min(img_bin_hist_sum); M = ceil(M/5); getString_start=strfind(pathname,'S'); getString_start=getString_start(end)+1; getString_end=strfind(pathname,''); getString_end=getString_end(end)-1; subjectindex=str2num(pathname(getString_
17、start:getString_end); if (subjectindex = M) axes (handles.axes3) %image no: 5 is shown for visualization purpose imshow(imread(STRCAT('ORLS',num2str(M),'5.bmp') msgbox ( 'Correctly Recognized'); else display ( 'Error=> Testing Image of Subject >>' num2str(sub
18、jectindex) ' matches with the image of subject >> ' num2str(M) axes (handles.axes3) %image no: 5 is shown for visualization purpose imshow(imread(STRCAT('ORLS',num2str(M),'5.bmp') msgbox ( 'Incorrectly Recognized'); end display('Testing Done')%-function
19、box_Callback(hObject, eventdata, handles)% hObject handle to box (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of box as text% str2double(get(hObject,
20、9;String') returns contents of box as a double %-% - Executes during object creation, after setting all properties.function box_CreateFcn(hObject, eventdata, handles)% hObject handle to box (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not
21、created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor') set(hObject,'BackgroundColor','white');end%-% - Executes on button press in Input_Image_button.function Input_Image_button_Callback(hObject, eventdata, handles)% hObject handle
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025至2030骨髓纖維化治療行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030支線航空行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 化工企業(yè)安全生產(chǎn)管理制度范文
- 礦業(yè)企業(yè)財(cái)務(wù)制度及流程范文
- 2025至2030中國(guó)硫酸奈替米星試劑行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030中國(guó)硅樹(shù)脂屋頂涂料行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030中國(guó)石膏板行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030中國(guó)益生菌補(bǔ)充品市場(chǎng)供應(yīng)渠道與未來(lái)銷(xiāo)售渠道分析報(bào)告
- 2025至2030中國(guó)電動(dòng)閥遙控系統(tǒng)行業(yè)發(fā)展趨勢(shì)分析與未來(lái)投資戰(zhàn)略咨詢(xún)研究報(bào)告
- 2025至2030中國(guó)生鮮商超行業(yè)產(chǎn)業(yè)運(yùn)行態(tài)勢(shì)及投資規(guī)劃深度研究報(bào)告
- 2025-2030年中國(guó)樓宇對(duì)講系統(tǒng)行業(yè)市場(chǎng)深度調(diào)研及競(jìng)爭(zhēng)格局與投資研究報(bào)告
- 暑假提升部編版小學(xué)語(yǔ)文四升五暑假閱讀提升之概括文章中心思想 課件
- 2025聊城市輔警考試試卷真題
- 2025廣西專(zhuān)業(yè)技術(shù)人員公需科目培訓(xùn)考試答案
- 2024年山東高中學(xué)業(yè)水平合格考試化學(xué)試卷真題(含答案詳解)
- 人工智能概論課件完整版
- 國(guó)際學(xué)校六年級(jí)數(shù)學(xué)測(cè)(英文)
- 標(biāo)識(shí)標(biāo)牌的制作與安裝
- 動(dòng)力站柴油儲(chǔ)罐施工方案
- 注塑車(chē)間機(jī)臺(tái)日?qǐng)?bào)表
- 空氣站質(zhì)量控制措施之運(yùn)行維護(hù)
評(píng)論
0/150
提交評(píng)論