資源簡介
使用matlab實現車牌識別,包括圖像預處理、提取連通區域、去除邊框、字符分割、字符識別等操作
代碼片段和文件信息
clear;
close?all;
%*************************************************************************%
%<1>讀取圖像并顯示
yuanshi=imread(‘2.jpg‘);%讀入圖像
huidu=rgb2gray(yuanshi);%原始圖像轉為灰度圖像
figuresubplot(121)imshow(yuanshi)title(‘原始圖像‘);
subplot(122)imshow(huidu)title(‘灰度圖像‘);
%*************************************************************************%
%<2>圖像預處理
junhenghua=histeq(huidu);%圖像均衡化?
lvbo=ordfilt2(junhenghua5ones(33));%中值濾波%%
%%s=strel(‘disk‘10);%
%sed=imtophat(lvbos);另一種邊緣增強法%%
f=[-1-1-1;-18-1;-1-1-1]/9;
guass=uint8(filter2(flvbo));%使用高斯濾波
%figureimshow(guass);
sed=imadd(junhenghuaguass);%與圖像相加得增強圖像
figuresubplot(221)imshow(junhenghua)title(‘直方圖均衡化后圖像‘);
subplot(222)imshow(lvbo)title(‘中值濾波后圖像‘);
subplot(223)imshow(sed)title(‘增強圖像‘);
%%subpl
評論
共有 條評論