裂缝识别系统 Matlab GUI设计


使用说明

裂缝识别系统 Matlab GUI设计 ,运行环境Matlab2023b及以上;

一种基于MATLAB图形用户界面(GUI)的裂缝自动识别系统,该系统利用数字图像处理技术实现裂缝图像的预处理,集成均衡化、噪声滤波、对比增强和形态学操作等算法,系统可高效识别裂缝,为工程结构检测提供便捷工具。

代码获取

  • 私信回复裂缝识别系统 Matlab GUI设计
matlab 复制代码
% --- Executes on button press in pushbuttonProject.
function pushbuttonProject_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonProject (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if ~isempty(handles.Result)
    axes(handles.axes1); imshow(handles.Result.Image); title('原图像');
    axes(handles.axes2); imshow(handles.Result.CrackJudge); title('裂缝图像');
    axes(handles.axes3); plot(1:size(handles.Result.Image, 1), handles.Result.Projectr);
    title('行投影');
    axes(handles.axes4); plot(1:size(handles.Result.Image, 2), handles.Result.Projectc);
    title('列投影');
end
% --- Executes on button press in pushbuttonClose.
function pushbuttonClose_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonClose (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
choice = questdlg('确定退出?', ...
    '退出', ...
    '是','否','否');
switch choice
    case '是'
        close;
    otherwise
        return;
end
% --- Executes on button press in pushbuttonSaveResult.
function pushbuttonSaveResult_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonSaveResult (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbuttonBridge.
function pushbuttonBridge_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonBridge (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if ~isempty(handles.Result)
    axes(handles.axes1); imshow(handles.Result.Image); title('原图像');
    axes(handles.axes2); imshow(handles.Result.BwFilter); title('二值图像滤波');
    axes(handles.axes3); imshow(handles.Result.CrackJudge); title('裂缝判断');
    axes(handles.axes4); imshow(handles.Result.CrackBridge); title('裂缝拼接');
end
% --- Executes on button press in pushbuttonSaveImage.
function pushbuttonSaveImage_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonSaveImage (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
[filename, pathname] = uiputfile({'*.jpg;*.tif;*.png;*.gif','All Image Files';...
    '*.*','All Files' },'Save Image',...
    fullfile(pwd, 'Result/result.png'));
if ~isequal(filename, 0)
    imwrite(handles.Result.BwEnd, fullfile(pathname, filename));
    msgbox('保存图像成功!', '信息提示框');
end
% --- Executes on button press in pushbuttonDiplay.
function pushbuttonDiplay_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonDiplay (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
if ~isempty(handles.File)
    F = [];
    F{1} = sprintf('文件名:%s', handles.File);
    F{2} = sprintf('阈值信息%.2f', handles.Result.BwTh);
    F{3} = sprintf('面积信息%.2f', handles.Result.BwArea);
    F{4} = sprintf('长度信息%.2f', handles.Result.BwLength);
    F{5} = sprintf('最大宽度信息%.2f', handles.Result.BwWidthMax);
    F{6} = sprintf('最小宽度信息%.2f', max(handles.Result.BwWidthMin,0.01));
    F{7} = sprintf('形状信息%s', handles.Result.str);
    listdlg('PromptString', '参数显示:',...
        'Name', '参数信息', ...
        'ListSize', [300, 150], ...
        'SelectionMode','single',...
        'ListString', F);
end
相关推荐
tyatyatya2 天前
MATLAB中进行视觉检测入门教程
开发语言·matlab·视觉检测
2zcode2 天前
基于Matlab可见光通信系统中OOK调制的误码率性能建模与分析
算法·matlab·php
听情歌落俗2 天前
MATLAB3-1变量-台大郭彦甫
开发语言·笔记·算法·matlab·矩阵
XIAOYU6720133 天前
金融数学专业需要学哪些数学和编程内容?
开发语言·matlab·金融
听情歌落俗3 天前
MATLAB3-2数据存储-台大郭彦甫
开发语言·数学建模·matlab·矩阵
slandarer3 天前
MATLAB | 这是屎吗?抱歉打错了,这是什么?
开发语言·matlab
茜茜西西CeCe3 天前
数字图像处理-巴特沃斯高通滤波、低通滤波
图像处理·opencv·计算机视觉·matlab·巴特沃斯高通滤波·巴特沃斯低通滤波
电力程序小学童4 天前
基于密集型复杂城市场景下求解无人机三维路径规划的Q-learning算法研究(matlab)
算法·matlab·无人机
通信小呆呆4 天前
OCDM 波形通信感知一体化:从原理到 MATLAB 实现
matlab·信息与通信·通信感知一体化·ocdm
2zcode4 天前
基于Matlab不同作战类型下兵力动力学模型的构建与稳定性分析
开发语言·matlab