画像の特徴は、画像処理と特徴認識の開始点であり、処理プロセスでのアルゴリズムの選択を決定します。一般的に、取得システムによって取得された路面画像には、3つの部分が含まれます。コア部分は識別対象の亀裂であり、他の部分は途切れのない路面、つまり背景です。最後の部分はノイズです。オイルスポットの影など。ノイズは舗装画像の特徴抽出の最大の障害です。認識アルゴリズムの目的は、ノイズを弱めて除去し、舗装の亀裂特徴情報をより適切に抽出するという究極の目標を達成することです。理想的には、背景ピクセルは亀裂ピクセルよりもわずかに明るく、特に亀裂周辺の背景は、ほとんどの舗装特徴抽出研究の基礎です。ただし、さまざまな複雑な要因の影響を受けて、実際に収集された道路画像には、次のような不利な状況が発生します。
- 舗装画像は、中央部分が明るく、両端に向かって徐々に暗くなるのが特徴です。
- 識別対象として、クラックの数は画像全体の総ピクセル数のごく一部にすぎません。
- 通常の路面のグレー値の変動範囲は、亀裂の変動範囲と一致します。
- 通常の舗装テクスチャの均一性は、光や天候などの要因の影響を受けます。
- 一般的に高速道路の走行距離は非常に大きく、高速道路全体で収集される舗装画像情報は非常に大きい。大量の道路画像情報、低コントラスト、および作業環境の複雑さのために、収集された道路画像は上記の特性を示します。その一部はハードウェア条件の性質によって決定され、主に次の3つのハードウェア要因の影響を受けます。すなわち、補助照明機器の選択と、照明角度、路面に対するカメラの角度、および路面からのレンズの高さの制御。
1.舗装亀裂検出および識別システムの設計プロセス
舗装亀裂の検出および識別システムの主な機能は次のとおりです。
1.電子機器で収集したカラー舗装亀裂画像を前処理し、舗装亀裂を検出して特定し、結果を保存します。
2.画像の前処理
画像の前処理は、主に画像の亀裂の識別を妨げるノイズ情報を除去するために使用され、画像のコントラストを高める効果があり、その後の道路の亀裂の識別の強固な基盤を築きます。前処理は、画像に対して一連の数学演算を実行して、亀裂の識別に役立つ有用な特徴情報を抽出し、画像の亀裂識別効果を向上させます。
2.1ヒストグラム均等化
道路の亀裂画像を収集する場合、そのときの天候や収集技術、設備の影響を受けやすく、収集した画像が不鮮明、歪んだり、ぼやけたりするなどの問題が発生しやすく、コントラストが不明瞭な画像を取得しやすくなります。ヒストグラム均等化法は、主に画像のコントラストを強調するために使用される画像を強調する方法です。この方法は、元の画像のヒストグラム分布を特定の変換によって一様分布のヒストグラム分布に変換する方法です。画像画像をグレースケール画像とすると、画像のグレースケールはグレーで表され、値の範囲は[0、L-1]であり、グレー値が0の場合、画像は黒の画像であり、グレー値はL-1、画像は白色画像です。
2.2メディアンフィルタリング
亀裂画像を収集する場合、通常、機器の干渉や気象要因によりノイズが発生するため、処理する亀裂画像には、亀裂のぼやけや亀裂周辺のノイズなどの問題が発生する可能性があります。上記の画像をメディアンフィルタリングで処理した後は、画像のノイズの大部分を除去できるだけでなく、画像の亀裂のエッジの詳細を適切に保持すると同時に、画像の亀裂の特徴を強調することができます。実装コード:
% --- Executes on button press in pushbuttonOpenFile.
function pushbuttonOpenFile_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonOpenFile (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;*.tif;*.png;*.gif',
'*.*','All Files' },'载入图像',...
fullfile(pwd, 'images'));
I = imread(fullfile(pathname, filename));
Result = Process_Main(I);
handles.File = fullfile(pathname, filename);
handles.Result = Result;
guidata(hObject, handles);
InitAxes(handles)
axes(handles.axes1); imshow(handles.Result.Image); title('原图像');
% --- Executes on button press in pushbuttonHisteq.
function pushbuttonHisteq_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonHisteq (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.hist); title('直方图均衡化图像');
end
% --- Executes on button press in pushbuttonMedfilt.
function pushbuttonMedfilt_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonMedfilt (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.Medfilt); title('中值滤波图像');
end
% --- Executes on button press in pushbuttonBw.
function pushbuttonBw_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonBw (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.Bw); title('二值图像');
end
% --- Executes on button press in pushbuttonEnance.
function pushbuttonEnance_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonEnance (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.Enance); title('增强图像');
end
% --- Executes on button press in pushbuttonBwfilter.
function pushbuttonBwfilter_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonBwfilter (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.Bw); title('二值图像');
axes(handles.axes3); imshow(handles.Result.BwFilter); title('二值图像滤波');
end
% --- Executes on button press in pushbuttonCrackRec.
function pushbuttonCrackRec_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonCrackRec (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.Bw); title('二值图像');
axes(handles.axes3); imshow(handles.Result.BwFilter); title('二值图像滤波');
axes(handles.axes4); imshow(handles.Result.CrackRec); title('裂缝识别');
end
% --- Executes on button press in pushbuttonCrackJudge.
function pushbuttonCrackJudge_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonCrackJudge (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.CrackRec); title('裂缝识别');
axes(handles.axes4); imshow(handles.Result.CrackJudge); title('裂缝判断');
end
% --- Executes on button press in pushbuttonCrackLoc.
function pushbuttonCrackLoc_Callback(hObject, eventdata, handles)
% hObject handle to pushbuttonCrackLoc (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('原图像');
hold off;
end
% --- 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)
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)
try
if ~isempty(handles.File)
raw = [];
xlsfile = fullfile(pwd, 'Result/result.xls');
if exist(xlsfile, 'file')
[num, txt, raw] = xlsread(xlsfile);
end
F = [];
F{1, 1} = '文件名';
F{1, 2} = '阈值信息';
F{1, 3} = '面积信息';
F{1, 4} = '长度信息';
F{1, 5} = '最大宽度信息';
F{1, 6} = '最小宽度信息';
F{1, 7} = '形状信息';
F{2, 1} = handles.File;
F{2, 2} = handles.Result.BwTh;
F{2, 3} = handles.Result.BwArea;
F{2, 4} = handles.Result.BwLength;
F{2, 5} = handles.Result.BwWidthMax;
F{2, 6} = max(handles.Result.BwWidthMin,0.01);
F{2, 7} = handles.Result.str;
F = [raw; F];
xlswrite(xlsfile, F);
msgbox('保存结果成功!', '信息提示框');
end
catch
msgbox('保存结果失败,请检查程序!', '信息提示框');
end
% --- 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)
imwrite(handles.Result.BwEnd, fullfile(pathname, filename));
msgbox('保存图像成功!', '信息提示框');
end
参照
[1] ZhangLei。画像処理に基づく高速道路舗装の亀裂検出技術に関する研究[J]。機械設計および製造工学、2017年
[2]SunBocheng。デジタル画像処理に基づくアスファルト舗装亀裂認識技術に関する研究[D]。成都:西南交通大学、2015年。
詳細については、1341703358をクリックし、Matlab設計プログラムを使用して取得したテスト結果を表示してください。実験結果から、設計された舗装亀裂検出および識別システムは、舗装亀裂を正確かつ効果的に識別できることがわかります。