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('二值图');
msgbox('MATLAB编程答疑,请加QQ: 993878382','MATLAB答疑','help')
web http://993878382.qzone.qq.com -browser
MATLAB夜间车牌识别程序.zip
版权申诉
184 浏览量
2022-11-16
21:16:30
上传
评论
收藏 35KB ZIP 举报
芝麻粒儿
- 粉丝: 6w+
- 资源: 2万+
最新资源
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
- 基于Java和LCN分布式事务框架的设计源码 - tx-lcn
- 基于Java和JavaScript的茶叶评级管理系统设计源码 - tea
- IMG_5680.JPG
- IMG_0437.jpg
- 基于Java的JAVA项目分析工具设计源码 - JAVAProjectAnalysis
- top888.json
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈