資源簡介
matlab寫的一個道路障礙物識別,可檢測道路障礙物,利用數字圖像處理相關知識,如平滑,邊緣檢測等
代碼片段和文件信息
clc
clear?all;
close?all;
image_background=imread(‘背景2.jpg‘);
subplot(221);imshow(image_background);title(‘背景圖‘)
image_gray1=rgb2gray(image_background);
image_original=imread(‘2-1.jpg‘);
subplot(222);imshow(image_original);title(‘原圖‘);
image_gray2=rgb2gray(image_original);
Dk=imsubtract(image_gray2image_gray1);
image_bw=im2bw(Dk0.2);
subplot(223);imshow(image_bw);title(‘差分法后二值化圖像‘);
Image_BW_medfilt=medfilt2(image_bw[3?3]);
subplot(224);imshow(Image_BW_medfilt);title(‘中值濾波后圖像‘);
se=strel(‘disk‘30);
image=imdilate(Image_BW_medfiltse);
figure;imshow(image);title(‘膨脹后圖像‘);
[image_bwlabelnum]=bwlabel(image8);%對目標區域進行標記
D=regionprops(image_bwlabel‘BoundingBox‘);%求最小外接矩陣
figure;imshow(image_original);title(‘障礙物檢測與識別圖像‘);
for?i=1:num
????hold?o
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-11-18?21:40??道路障礙物識別\
?????文件???????64656??2015-11-05?18:28??道路障礙物識別\1-1.png
?????文件??????107224??2015-11-11?10:51??道路障礙物識別\2-1.jpg
?????文件??????321461??2015-11-11?12:09??道路障礙物識別\2-2.jpg
?????文件???????13779??2015-11-11?01:13??道路障礙物識別\GUI.jpg
?????文件?????????958??2015-11-06?00:25??道路障礙物識別\Recognize.m
?????文件????????2243??2015-11-11?01:51??道路障礙物識別\unti
?????文件????????7140??2015-11-11?12:32??道路障礙物識別\unti
?????文件???????51694??2015-11-05?18:27??道路障礙物識別\背景1.png
?????文件??????101969??2015-11-11?10:51??道路障礙物識別\背景2.jpg
?????文件?????1411588??2015-11-11?03:30??道路障礙物識別\道路障礙物識別.pptx
評論
共有 條評論