汽车牌照识别车牌识别模板匹配法 Matlab代码
[filename,pathname] = uigetfile('*.jpg','请选择要识别的车牌图片');
if isequal(filename,0)
msgbox('没有图片')
else
pathfile=fullfile(pathname,filename);
msgbox('导入图片成功,现在开始处理')
pause(6);
I=imread(pathfile);
end
figure(1)
subplot(331);imshow(I);title('原图')
% 2. 图像预处理
I1=rgb2gray(I);
I2=edge(I1,'sobel',0.18,'both');
subplot(332),imshow(I1);title('灰度图');
subplot(333),imhist(I1);title('灰度图直方图');
subplot(334),imshow(I2);title('sobel算子边缘检测');
se=[1;1;1];
I3=imerode(I2,se
2025-04-21 16:40:45
248KB
matlab
1