当前位置: 代码迷 >> 综合 >> 【图像识别】基于形态学算法实现道路缺陷的自动识别matlab源码含GUI
  详细解决方案

【图像识别】基于形态学算法实现道路缺陷的自动识别matlab源码含GUI

热度:71   发布时间:2023-12-03 20:44:35.0

1 基于形态学算法实现道路缺陷模型

模型参考这里。

2 部分代码

function varargout = x(varargin)
% X M-file for x.fig
%      X, by itself, creates a new X or raises the existing
%      singleton*.
%
%      H = X returns the handle to a new X or the handle to
%      the existing singleton*.
%
%      X('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in X.M with the given input arguments.
?
end
end
if Val_s<10yw='坑槽';
end
set(handles.edit_YW,'string',yw);
pause(1);
pg='必须修补';
set(handles.edit_PG,'string',pg);
function edit_TP_Callback(hObject, eventdata, handles)
% hObject    handle to edit_TP (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 edit_TP as text
%        str2double(get(hObject,'String')) returns contents of edit_TP as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_TP_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_TP (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_DX_Callback(hObject, eventdata, handles)
% hObject    handle to edit_DX (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 edit_DX as text
%        str2double(get(hObject,'String')) returns contents of edit_DX as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_DX_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_DX (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_LF_Callback(hObject, eventdata, handles)
% hObject    handle to edit_LF (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 edit_LF as text
%        str2double(get(hObject,'String')) returns contents of edit_LF as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_LF_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_LF (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_LFC_Callback(hObject, eventdata, handles)
% hObject    handle to edit_LFC (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 edit_LFC as text
%        str2double(get(hObject,'String')) returns contents of edit_LFC as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_LFC_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_LFC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_YW_Callback(hObject, eventdata, handles)
% hObject    handle to edit_YW (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 edit_YW as text
%        str2double(get(hObject,'String')) returns contents of edit_YW as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_YW_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_YW (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_PG_Callback(hObject, eventdata, handles)
% hObject    handle to edit_PG (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 edit_PG as text
%        str2double(get(hObject,'String')) returns contents of edit_PG as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_PG_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_PG (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_MJ_Callback(hObject, eventdata, handles)
% hObject    handle to edit_MJ (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 edit_MJ as text
%        str2double(get(hObject,'String')) returns contents of edit_MJ as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_MJ_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_MJ (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_ZC_Callback(hObject, eventdata, handles)
% hObject    handle to edit_ZC (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 edit_ZC as text
%        str2double(get(hObject,'String')) returns contents of edit_ZC as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_ZC_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_ZC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_JXC_Callback(hObject, eventdata, handles)
% hObject    handle to edit_JXC (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 edit_JXC as text
%        str2double(get(hObject,'String')) returns contents of edit_JXC as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_JXC_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_JXC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_JXK_Callback(hObject, eventdata, handles)
% hObject    handle to edit_JXK (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 edit_JXK as text
%        str2double(get(hObject,'String')) returns contents of edit_JXK as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_JXK_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_JXK (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
??
?
function edit_LWC1_Callback(hObject, eventdata, handles)
% hObject    handle to edit_LWC1 (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 edit_LWC1 as text
%        str2double(get(hObject,'String')) returns contents of edit_LWC1 as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_LWC1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_LWC1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?
?
?
function edit_LWK1_Callback(hObject, eventdata, handles)
% hObject    handle to edit_LWK1 (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 edit_LWK1 as text
%        str2double(get(hObject,'String')) returns contents of edit_LWK1 as a double
?
?
% --- Executes during object creation, after setting all properties.
function edit_LWK1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit_LWK1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not 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
?

3 仿真结果

img

img

4 参考文献

[1]徐志刚, 赵祥模, 宋焕生,等. 基于直方图估计和形状分析的沥青路面裂缝识别算法[J]. 仪器仪表学报, 2010(10):102-108.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

  相关解决方案