-
大小: 23KB文件類(lèi)型: .rar金幣: 2下載: 0 次發(fā)布日期: 2021-05-10
- 語(yǔ)言: Matlab
- 標(biāo)簽: 圖像分割??車(chē)牌識(shí)別??
資源簡(jiǎn)介
使用MATLAB的圖像分割的源代碼,包括M文件源代碼和示例圖片。

代碼片段和文件信息
%?This?is?a?program?for?extracting?objects?from?an?image.?Written?for?vehicle?number?plate?segmentation?and?extraction
%?Authors?:?Jeny?Rajan?Chandrashekar?P?S
%?U?can?use?attached?test?image?for?testing
%?input?-?give?the?image?file?name?as?input.?eg?:-?car3.jpg
clc;
clear?all;
k=input(‘Enter?the?file?name‘‘s‘);?%?input?image;?color?image
im=imread(k);
im1=rgb2gray(im);
im1=medfilt2(im1[3?3]);?%Median?filtering?the?image?to?remove?noise%
BW?=?edge(im1‘sobel‘);?%finding?edges?
[imximy]=size(BW);
msk=[0?0?0?0?0;
?????0?1?1?1?0;
?????0?1?1?1?0;
?????0?1?1?1?0;
?????0?0?0?0?0;];
B=conv2(double(BW)double(msk));?%Smoothing??image?to?reduce?the?number?of?connected?components
L?=?bwlabel(B8);%?Calculating?connected?components
mx=max(max(L))
%?There?will?be?mx?connected?components.Here?U?can?give?a?value?between?1?and?mx?for?L?or?in?a?loop?you?can?extract?all?connected?components
%?If?you?are?using?the?attached?car?image?by?giving?171819222728?to?L?you?can?extract?the?number?plate?completely.
[rc]?=?find(L==17);??
rc?=?[r?c];
[sx?sy]=size(rc);
n1=zeros(imximy);?
for?i=1:sx
????x1=rc(i1);
????y1=rc(i2);
????n1(x1y1)=255;
end?%?Storing?the?extracted?image?in?an?array
figureimshow(im);
figureimshow(im1);
figureimshow(B);
figureimshow(n1[]);
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????19554??2005-07-14?13:40??MATLAB圖像分割提取算法源代碼(示例車(chē)牌識(shí)別)\car3.jpg
?????文件???????1306??2006-11-16?13:32??MATLAB圖像分割提取算法源代碼(示例車(chē)牌識(shí)別)\seg.m
????..A.SH.??????5632??2009-07-15?11:08??MATLAB圖像分割提取算法源代碼(示例車(chē)牌識(shí)別)\Thumbs.db
?????目錄??????????0??2009-07-15?11:08??MATLAB圖像分割提取算法源代碼(示例車(chē)牌識(shí)別)
-----------?---------??----------?-----??----
????????????????26492????????????????????4
評(píng)論
共有 條評(píng)論