clear all
clc
PS=imread('1.jpg');
subplot(1,2,1);
imshow(PS)
title('原图')
p=rgb2gray(PS);
subplot(1,2,2)
imshow(p)
title('原灰度图')
[m,n]=size(p);
GP=zeros(1,256);
for k=0:255
GP(k+1)=length(find(p==k))/(m*n);
end
figure
subplot(1,2,1);
bar(0:255,GP,'g')
title('原灰度直方图')
max_index=[];
for i=3:length(GP)-2
if((GP(i)>=GP(i+1))&(GP(i)>=GP(i-1)))&((GP(i+1)>=GP(i+2))&(GP(i-1)>=GP(i-2)))
max_index(end+1)=i-1;
end
end
possible=GP(max_index);
[max_value,index]=max(possible);
TT=max_index(index)-2;
[m,n]=size(p);
R=zeros(m,n);
for i=1:m
for j=1:n
if p(i,j)<TT
R(i,j)=0;
else R(i,j)=256;
end
end
end
subplot(1,2,2);
imshow(R);
title('二值图');
MATLAB代码实现夜间车牌识别程序.rar
127 浏览量
2023-02-09
15:39:52
上传
评论 1
收藏 100KB RAR 举报
逃逸的卡路里
- 粉丝: 6887
- 资源: 3508
最新资源
- 基于STC12C5A60S2单片机+LCD12864屏实现贪吃蛇源码程序软件源码KEIL C51工程文件.zip
- Java资源 javaeasycms-v2.0.zip
- 基于Qt和opencv图像格式处理工具源代码
- tomcat安装及配置教程.zip
- python,爬取电商平台手机评论并保存为excel,用python进行数据分析并展示图片
- matlab对直接序列扩频和直接序列码分多址进行仿真实验源代码
- 六一儿童节祝福网页源代码
- 端午节活动吃豆人游戏源代码
- python爬虫案例findtrip-master.zip
- 对要使用到的开源组件进行组合整理, 搭建一个简单的框架,方便后续的开发, 其中包括MVP
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈