【正文】
) returns toggle state of togglebutton3。% Hint: get(hObject,39。clear。Value39。endclear。)。), ylabel(39。 %xlabel(39。hough 變換后的圖像39。 %figure ,imshow(B)。 delete(h)。)。 waitbar(1,h,39。)。 case 3 h = waitbar(,39。% delete(h)。)。% waitbar(1,h,39。)。 case 2 h = waitbar(,39。axes()。)。,39。)) set(hObject,39。), get(0,39。 isequal(get(hObject,39。 end% Executes during object creation, after setting all properties.function popupmenu1_CreateF(hObject, eventdata, handles)if ispc amp。)。) returns toggle state of togglebutton1% Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)global value value = get(hObject,39。% Hint: get(hObject,39。axes()。% info=imfinfo(str)。if pathname == 0 return。選擇圖片39。*.*39。*.gif39。*.jpg39。*.tif39。*.bmp39。)。,39。set(hObject,39。ytick39。,[])。% Hint: place code in OpeningF to populate axes1《圖像分析與模式識別》課程 期末大作業(yè)報告 姓名:趙世瑜 學號:2022204067 20 / 19% Executes during object creation, after setting all properties.function axes2_CreateF(hObject, eventdata, handles)set(hObject,39。on39。box39。,[])。set(hObject,39。xTick39。% Outputs from this function are returned to the mand line.function varargout = sztxfx_mssb_zsy_OutputF(hObject, eventdata, handles) varargout{1} = 。end% End initialization code DO NOT EDIT% Executes just before sztxfx_mssb_zsy is made visible.function sztxfx_mssb_zsy_OpeningF(hObject, eventdata, handles, varargin)% Choose default mand line output for sztxfx_mssb_zsy = hObject。endif nargout [varargout{1:nargout}] = gui_mainf(gui_State, varargin{:})。amp。, [])。, [] , ... 39。, sztxfx_mssb_zsy_OutputF, ... 39。, sztxfx_mssb_zsy_OpeningF, ... 39。, gui_Singleton, ... 39。, mfilename, ... 39。gui_State = struct(39。close。 %進行下一次迭代 A=round(A)。 %將記錄后面類中心像素值前移 count(g)=count(g+1)。 end end end if i==temp_c count(i)=0。 count(j)=count(i)+count(j)。ij %矩陣為一對稱矩陣.....只看下三角 c=c1。 for x=1:s for i=1:temp_c for j=1:temp_c J_temp=J。 end end endend if ssL % 當 s 超過最大合并對數(shù)時將 s 的值變?yōu)樵试S的最大聚類對的數(shù)目 s=sL。 line(temp1)=line(i)。 for j=i+1:s if line(j)line(temp1) %選擇排序法對 line 進行排序 temp1=j。 s=s+1。 s=1。 % 這個矩陣為一對稱矩陣 end end %%%%%%%%%%%%%%%%%13..將小于最小合并參數(shù)的 betwen_dis(i,j)%%%%%%%% sL=2。 for i=1:c for j=1:i betwen_dis(i,j)=abs(J(i)J(j))。 end end end end count(x)=count(x)count(c)。 count(c)=count(c)+1。 J(c)=J(x)r(x)。 %實際類的數(shù)目加 1 J_rec(x)=J(x)。count(x)2*(sN+1) r(x)=t*meandis(x)。J_rec=J。 end%%%%%%%%%%%%%10..求最大標準差分量.. 灰度圖特征分量為 1%%%%%%%%%%%%%%%%%%%%%%11..決定是否分裂 %%%%%%%%%%%%%%%%%%%% t= 。 for i=1:m for j=1:n if A(i,j)==J(x) sum1(x)=sum1(x)+((I(i,j)J(x))*(I(i,j)J(x)))。 if ck/2+1|mod(w,2)==1 %繼續(xù)做步驟 8%%%%%%%%%%%%9...實際聚類中心數(shù)跟預期數(shù)相比太小要進行分裂%%%%%%%%%%%%%%%%%%%%%%%%對各個聚類求標準偏差%%%%%%%%%%%%%%%%%%%%%%%%std_err=zeros(1,c)。 %sC 為合并參數(shù)if w==max_gen1 %如果這是最后一次迭代置合并參數(shù)為 0 《圖像分析與模式識別》課程