✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。
🍎个人主页:海神之光
🏆代码获取方式:
海神之光Matlab王者学习之路—代码获取方式
⛳️座右铭:行百里者,半于九十。
更多Matlab仿真内容点击👇
Matlab图像处理(进阶版)
路径规划(Matlab)
神经网络预测与分类(Matlab)
优化求解(Matlab)
语音处理(Matlab)
信号处理(Matlab)
车间调度(Matlab)
⛄一、简介
高速公路路面病害养护和管理的重要部分就是路面裂缝的检测。近年来,路面裂缝自动检测技术已得到了广泛应用,而由于路面裂缝图像的复杂性,检测算法直接影响着检测结果的精确度。因此,本文将重点放在路面裂缝病害的检测上,为了提高检测的精度,分别从裂缝图像的去噪、图像的增强、图像的分割以及检测后路面裂缝图像的特征提取方面进行深入研究。 在路面裂缝图像中,由于裂缝信息与背景对比度偏低,难以将裂缝直接检测到。对于图像的预处理,首先对图像进行灰度校正,再对校正之后的图像滤波,本文提出了一种改进的中值滤波方法,对图像进行去噪,之后用基于模糊理论的图像增强原理对图像做进一步增强,有效提高了路面裂缝图像的对比度。 针对路面裂缝图像分割,本文分别用了阈值分割和基于形态学多尺度的思想,对于形状规则的裂缝采用的是阈值分割,对于裂缝形状不规则的图像,本文设计了一种多结构元素的抗噪型边缘检测算子,且依据不同形状的结构元素对裂缝边缘填充的几率不同,确定了自适应权重,使得算子检测到了各种类型的裂缝边缘,有效地提高了检测的精度。 对于经过分割后的路面裂缝图像中存在噪声和裂缝断裂的问题,本文对于断裂较窄的图像用形态学中的闭运算和开运算去处理,对于断裂较宽的图像,提出了一种基于生长的断裂裂缝块的连接方法。提高了连接的效率和准确率,使整个检测结果清晰完整。最终,从识别结果图中提取裂缝信息。根据得到的识别结果图,设定一系列判定条件,提取出裂缝的连通域,对裂缝的类型进行判断,最后计算出网状裂缝的面积及线性裂缝的长宽信息。
⛄二、部分源代码
function varargout = firstPage(varargin)
% FIRSTPAGE MATLAB code for firstPage.fig
% FIRSTPAGE, by itself, creates a new FIRSTPAGE or raises the existing
% singleton*.
%
% H = FIRSTPAGE returns the handle to a new FIRSTPAGE or the handle to
% the existing singleton*.
%
% FIRSTPAGE(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in FIRSTPAGE.M with the given input arguments.
%
% FIRSTPAGE(‘Property’,‘Value’,…) creates a new FIRSTPAGE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before firstPage_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to firstPage_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose “GUI allows only one
% instance to run (singleton)”.
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help firstPage
% Last Modified by GUIDE v2.5 12-Apr-2021 10:23:22
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @firstPage_OpeningFcn, …
‘gui_OutputFcn’, @firstPage_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% — Executes just before firstPage is made visible.
function firstPage_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to firstPage (see VARARGIN)
% Choose default command line output for firstPage
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% set(gcf,‘menu’,‘figure’);
set(gcf,‘numbertitle’,‘off’,‘name’,‘基于BP神经网络的路面裂缝检测与处理建议软件’);
% UIWAIT makes firstPage wait for user response (see UIRESUME)
% uiwait(handles.figure1);
bg_P=axes(‘units’,‘normalized’,‘position’,[0 0 1 1]);
uistack(bg_P,‘bottom’);
II=imread(‘background\8.jpg’);
image(II);
hold on
% w=text(177,68,‘基于BP网络的路面裂缝处理系统’,‘fontsize’,25,‘color’,[1.0 1.0 1.0]);
w=text(65,98,‘基于BP神经网络的路面裂缝检测与处理建议软件’,‘fontsize’,25,‘color’,[0.0 0.0 0.0]);
w1=text(52,150,'Pavement Crack Detection And Processing Suggest Software ',‘fontsize’,20,‘color’,[0.0 0.0 0.0]);
w2=text(250,200,'Based On BP Neural Network ‘,‘fontsize’,20,‘color’,[0.0 0.0 0.0]);
w3=text(385,400,‘大学’,‘fontsize’,15,‘color’,[0.0 0.0 0.0]);
w4=text(340,420,’** University ',‘fontsize’,13,‘color’,[0.0 0.0 0.0]);
w5=text(380,470,‘1st,April,2021’,‘fontsize’,11,‘color’,[0.0 0.0 0.0]);
colormap gray;
set(bg_P,‘handlevisibility’,‘off’,‘visible’,‘off’);
% set(handles.pushbutton1,‘visible’,‘off’);
% — Outputs from this function are returned to the command line.
function varargout = firstPage_OutputFcn(~, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% — Executes on button press in pushbutton1.
% --------------------------------------------------------------------
function model_Callback(hObject, eventdata, handles)
% hObject handle to model (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Help_Callback(hObject, eventdata, handles)
% hObject handle to Help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Exit_Callback(hObject, eventdata, handles)
% hObject handle to Exit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close gcf;
% --------------------------------------------------------------------
function fast_Callback(hObject, eventdata, handles) %%%%%%%%%%%%%%%%%%%%%%%%%%%模式选择—》快速模式
% --------------------------------------------------------------------
function Retrain_Callback(hObject, eventdata, handles) %%%%%%%%%%%%%%%%%%%%%模式选择—》重新训练
ANNcheck;
load data\acy_check;
load data\acy_reg;
t=[‘准确率为’ acy_check];
q=questdlg(t,‘是否重新训练’,‘是’,‘否’,‘否’);
if q==‘是’
Retrain_Callback();
else
setappdata(0,‘acy_check’,acy_check);
setappdata(0,‘acy_reg’,acy_reg);
close(gcf);
secondPage;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%作为《重新训练or快速模式》标志
Hit=0;
setappdata(0,‘Hit’,Hit); %%%%%%%重新训练模式,则 Hit=0
% --------------------------------------------------------------------
function ask_help_Callback(hObject, eventdata, handles)
% hObject handle to ask_help (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open (‘Help.docx’);
% --------------------------------------------------------------------
function Wenjian_Callback(hObject, eventdata, handles)
% hObject handle to Wenjian (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function file_in_Callback(hObject, eventdata, handles)
% hObject handle to file_in (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open txt\程序文件介绍.txt
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to Exit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function DingYi_Callback(hObject, eventdata, handles)
% hObject handle to DingYi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open txt\裂缝方向定义.txt
% --------------------------------------------------------------------
function Net_Callback(hObject, eventdata, handles)
% hObject handle to Net (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function CheckNet_Callback(hObject, eventdata, handles) %%%%%%%%%%%%%%%%%关于网路-》检测网络
% hObject handle to CheckNet (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open txt\检测网络.txt;
% --------------------------------------------------------------------
function RecNet_Callback(hObject, eventdata, handles) %%%%%%%%%%%%%%%%%关于网路-》识别网络
% hObject handle to RecNet (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open txt\识别网络.txt;
% --------------------------------------------------------------------
function retrain_c_Callback(hObject, eventdata, handles)
% hObject handle to retrain_c (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function retrain_r_Callback(hObject, eventdata, handles)
% hObject handle to retrain_r (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Reset_Callback(hObject, eventdata, handles) %%%%%%%%%%%%%%参数重置
% hObject handle to Reset (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
tex=[‘默认参数是经过多次试验得到的最优组合,您真的需要重新设置吗?’];
q=questdlg(tex,‘温馨提示’,‘是’,‘否’,‘否’);
if q==‘是’
t{1}=‘最大迭代次数’;t{2}=‘第一隐层隐元数目’;t{3}=‘第二隐层隐元数目’;
t{4}=‘第一隐层激活函数’;t{5}=‘第二隐层激活函数’;t{6}=‘训练函数’;
title=‘设置’;
default_t={‘5000’,‘432’,‘54’,‘tansig’,‘purelin’,‘trainscg’};
param=inputdlg(t,title,1,default_t,‘on’);
num1=str2num(param{1});num2=str2num(param{2});num3=str2num(param{3});
str1=(param{4});str2=(param{5});str3=(param{6});
save data\param num1 num2 num3 str1 str2 str3;
key_reset=1;
save data\key_reset key_reset;
else
key_reset=0;
save data\key_reset key_reset;
end
% --------------------------------------------------------------------
function f_open_Callback(hObject, eventdata, handles)
% hObject handle to f_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[filename pathname]=uigetfile({‘.jpg’;'.png’;‘*.gif’},‘选择背景’);
% --------------------------------------------------------------------
function f_new_Callback(hObject, eventdata, handles)
% hObject handle to f_new (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
⛄三、运行结果
⛄四、matlab版本及参考文献
1 matlab版本
2014a
2 参考文献
[1]陈健昌,张志华.融于图像多特征的路面裂缝智能化识别[J].科学技术与工程. 2021,21(24)
3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除
🍅 仿真咨询
1 各类智能优化算法改进及应用
生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化
2 机器学习和深度学习方面
卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断
3 图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知
4 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化
5 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配
6 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化
7 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化
8 电力系统方面
微电网优化、无功优化、配电网重构、储能配置
9 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长
10 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合