【正文】
[Pic_pattern_new_4,Pic_pattern_4]=Pic_L_fenxi(Pic_4)。 axes()。 imshow(Pic_pattern_4)。 end if i==5 [Pic_pattern_new_5,Pic_pattern_5]=Pic_L_fenxi(Pic_5)。 axes()。 imshow(Pic_pattern_5)。 end if i==6 [Pic_pattern_new_6,Pic_pattern_6]=Pic_L_fenxi(Pic_6)。 axes()。 imshow(Pic_pattern_6)。 endend function edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (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,39。String39。) returns contents of edit1 as text% str2double(get(hObject,39。String39。)) returns contents of edit1 as a double % Executes during object creation, after setting all properties.function edit1_CreateF(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc amp。amp。 isequal(get(hObject,39。BackgroundColor39。), get(0,39。defaultUicontrolBackgroundColor39。)) set(hObject,39。BackgroundColor39。,39。white39。)。end function edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (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,39。String39。) returns contents of edit2 as text% str2double(get(hObject,39。String39。)) returns contents of edit2 as a double % Executes during object creation, after setting all properties.function edit2_CreateF(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles empty handles not created until after all CreateFs called % Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc amp。amp。 isequal(get(hObject,39。BackgroundColor39。), get(0,39。defaultUicontrolBackgroundColor39。)) set(hObject,39。BackgroundColor39。,39。white39。)。end % Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Pic_pattern_new_1。Pic_pattern_new=Pic_pattern_new_1。% global Pic_pattern_new。str=39。213。253。212。218。199。243。189。225。185。39。set(,39。string39。,str)。pause()。[a,b]=size(Pic_pattern_new)。Pic_pattern1_num=0。Pic_pattern2_num=0。Pic_pattern3_num=0。For i=1:a %計算分類結(jié)果中1,2,3類點的個數(shù),要是第一類點的個數(shù)超出。則是禁止通行 for j=1:b if Pic_pattern_new(i,j)==1。 Pic_pattern1_num=Pic_pattern1_num+1。 end if Pic_pattern_new(i,j)==2。 Pic_pattern2_num=Pic_pattern2_num+1。 end if Pic_pattern_new(i,j)==3。 Pic_pattern3_num=Pic_pattern3_num+1。 end endend % Pic_pattern3_num/(a*b)if Pic_pattern3_num/(a*b)||Pic_pattern2_num/(a*b)||Pic_pattern3_num/(a*b) % set(,39。string39。,39。禁止駛?cè)?9。)。else [Pic_pattern_num]=Pic_pattern_match_3(Pic_pattern_new)。 load(39。39。)。 str=fname_array(Pic_pattern_num,:)。 set(,39。string39。,str)。end % Executes on button press in pushbutton6.function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) global Pic_pattern_new_2。Pic_pattern_new=Pic_pattern_new_2。% global Pic_pattern_new。str=39。213。253。212。218。199。243。189。225。185。39。set(,39。string39。,str)。pause()。[a,b]=size(Pic_pattern_new)。Pic_pattern1_num=0。Pic_pattern2_num=0。Pic_pattern3_num=0。for i=1:a for j=1:b if Pic_pattern_new(i,j)==1。 Pic_pattern1_num=Pic_pattern1_num+1。 end if Pic_pattern_new(i,j)==2。 Pic_pattern2_num=Pic_pattern2_num+1。 end if Pic_pattern_new(i,j)==3。 Pic_pattern3_num=Pic_pattern3_num+1。 end endend % Pic_pattern3_num/(a*b)if Pic_pattern3_num/(a*b)||Pic_pattern2_num/(a*b)||Pic_pattern3_num/(a*b) set(,39。string39。,39。禁止駛?cè)?9。)。else [Pic_pattern_num]=Pic_pattern_match_3(Pic_pattern_new)。 load(39。39。)。 str=fname_array(Pic_pattern_num,:)。 set(,39。string39。,str)。end % Executes on button press in pushbutton7.function pushbutton7_Callback(hObject, eventdata, handles)% hObject handle to pushbutton7 (see GCBO)% eventdata reserved to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Pic_pattern_new_3。Pic_pattern_new=Pic_pattern_new_3。% global Pic_pattern_new。str=39。213。253。212。218。199。243。189。225。185。39。set(,39。string39。,str)。pause()。[a,b]=size(Pic_pattern_new)。Pic_pattern1_num=0。Pic_pattern2_num=0。Pic_pattern3_num=0。for i=1:a for j=1:b if Pic_pattern_new(i,j)==1。 Pic_pattern1_num=Pic_pattern1_num+1。 end if Pic_pattern_new(i,j)==2。 Pic_pattern2_num=Pic_pattern2_num+1。 end if Pic_pattern_new(i,j)==3。 Pic_pattern3_num=Pic_pattern3_num+1。 end endend % Pic_pattern3_num/(a*b)if Pic_pattern3_num/(a*b)||Pic_pattern2_num/(a*b)||Pic_pattern3_num/(a*b) set(,39。string39。,39。禁止駛?cè)?9。)。else [Pic_pattern_num]=Pic_pattern_match_3(Pic_pattern_new)。 load(39。39。)。 str=fname_array(Pic_pattern_num,:)。 set(,39。string39。,str)。end % Execut