【正文】
% hObject handle to m_canny (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) 。canny39。 % 調(diào)用 canny函數(shù) imshow(BW)。canny39。 axes()。)。title(39。 axes()。)。) % hObject handle to m_lapacian (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % function m_canny_Callback(hObject, eventdata, handles) img_src=getappdata(,39。 % 顯示分割后的圖像,即梯度圖像 title(39。 BW = im2bw(grad,)。 % 計算梯度矩陣 grad = mat2gray(dx)。 % 建立模板 I = im2double(A)。1,4,1。)。title(39。 axes()。)。) % hObject handle to m_priwitt (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % function m_lapacian_Callback(hObject, eventdata, handles) img_src=getappdata(,39。 % 顯示分割后的圖像即邊緣圖像 title(39。 BW = im2bw(grad,level)。 % 將梯度矩陣轉(zhuǎn)換為灰度圖像 level = graythresh(grad)。 % 計算 Y方向的梯度分量 grad = sqrt(dx.*dx + dy.*dy)。 % 將圖像數(shù)據(jù)轉(zhuǎn)化為 雙精度 dx = imfilter(I, x_mask)。 % 建立 Y方向的模板 x_mask = y_mask39。0 0 0。)。title(39。 axes()。)。) % hObject handle to m_Roberts (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % function m_priwitt_Callback(hObject, eventdata, handles) img_src=getappdata(,39。 % 顯示分割后的圖像即邊緣圖像 title(39。 BW = im2bw(grad,level)。 % 將梯度矩陣轉(zhuǎn)換為灰度圖像 level = graythresh(grad)。 % 計算 Y方向的梯度分量 grad = sqrt(dx.*dx + dy.*dy)。 % 將圖像數(shù)據(jù)轉(zhuǎn)化為雙精度 dx = imfilter(I, x_mask)。 % 建立 X方向的模板 y_mask = rot90(x_mask)。 x_mask = [1 0。原圖 39。 imshow(A)。 A=img_src。img_src39。Sobel39。 % 用閾值分割梯度圖像 imshow(BW)。 % 計算灰度閾值 axes()。 % 計算梯度 grad = mat2gray(grad)。 % 計算 X方向的梯度分量 dy = imfilter(I, y_mask)。 % 建立 X方向的模板 I = im2double(A)。1 2 1]。 y_mask = [1 2 1。原圖 39。 imshow(A)。 A=img_src。img_src39。 % hObject handle to m_file_exit (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % function m_image_Callback(hObject, eventdata, handles) % hObject handle to m_image (see GCBO) % eventdata reserved to be defined in a future version of MATLAB 26 % handles structure with handles and user data (see GUIDATA) % function m_sobel_Callback(hObject, eventdata, handles) axes()。)。 img_src=getappdata(,39。%將文件名和目錄名組合成一個完整的路徑 img_src=imread(fpath)。 axes()。Pick an image39。All Files (*.*)39。*.*39。Image Files (*.bmp, *.jpg, *.png, *.jpeg)39。*.jpeg39。*.jpg。 % hObject handle to m_file_open (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % 25 function m_file_save_Callback(hObject, eventdata, handles) [filename, pathname] = uigetfile( ... {39。img_src39。)。 title(39。%將文件名和目錄名組合成一個完整的路徑 img_src=imread(fpath)。 axes()。Pick an image39。All Files (*.*)39。*.*39。Image Files (*.bmp, *.jpg, *.png, *.jpeg)39。*.jpeg39。*.jpg。 24 % function m_file_Callback(hObject, eventdata, handles) % hObject handle to m_file (see GCBO) % eventdata reserved to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % function m_file_open_Callback(hObject, eventdata, handles) [filename, pathname] = uigetfile( ... {39。 % Outputs from this function are returned to the mand line. function varargout = Mywork_OutputF(hObject,