matlab关于蓝色车牌识别问题

sj0404 2011-04-13 03:25:18
这段代码是黄色的底色车牌如何将黄色改为蓝色!!谢谢啊,高手帮帮忙
function [y_image] = extract_yellow_region(image);
% extract_yellow_region: Determines the yellow regions in the picture using
% the CIE-XYZ color system, and returns a black and white picture which is
% set on the yellow regions only.

% Define the lines in CIE-XYZ space, use to determine yellow color
lower_A = 0.87; lower_B = 0.04;
upper_A = 1.5 ; upper_B = -0.125;

% Convert 8-bit format of org_pic pixels to double format
pic = double(image)+1;
pic = pic.*1.6;

% Conversion from RGB709 to CIE-XYZ
x = ( pic(:,:,1).*0.412453 + pic(:,:,2).*0.35758 + pic(:,:,3).* 0.180423);
y = ( pic(:,:,1).*0.212671 + pic(:,:,2).*0.715160 + pic(:,:,3).* 0.072169);
z = ( pic(:,:,1).*0.019334 + pic(:,:,2).*0.119193 + pic(:,:,3).*0.950227);

sum = x + y + z;
x_bar = x./sum;
y_bar = y./sum;

% Define yellow color in CIE-XYZ space
x_sum_conds = ( ((x_bar > 0.34) & (sum > 400) & (sum < 500) ) | ((x_bar > 0.37) & (sum > 200) & (sum < 500)) );
xy_conds = ( (y_bar > 0.35) & (y_bar < 0.5) & (y_bar > (lower_A*x_bar + lower_B)) & (y_bar < (upper_A*x_bar + upper_B)) );

y_image = (x_sum_conds & xy_conds);
return;
...全文
350 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Johhny 2011-06-28
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 dianwei_wang 的回复:]
不知道车牌颜色对于识别方法有多大影响。
[/Quote]

这个我觉得颜色在车牌识别中最主要的作用是确定车牌区域,毕竟绝大多数情况下这块特殊颜色区域就是车牌区域。至于具体识别过程,灰度图像的操作更多一些。
dianwei_wang 2011-05-22
  • 打赏
  • 举报
回复
不知道车牌颜色对于识别方法有多大影响。
Johhny 2011-05-19
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 libralibra 的回复:]
引用 3 楼 arshavinal 的回复:

matlab没有RGB模式么

matlab默认全是rgb模式
你没看楼主很蛋疼的从rgb往CIE-XYZ 转呢吗
[/Quote]

……
libralibra 2011-04-15
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 arshavinal 的回复:]

matlab没有RGB模式么
[/Quote]
matlab默认全是rgb模式
你没看楼主很蛋疼的从rgb往CIE-XYZ 转呢吗
sj0404 2011-04-14
  • 打赏
  • 举报
回复
能否指点下,不会找哇
艾莎云 2011-04-14
  • 打赏
  • 举报
回复
matlab没有RGB模式么
libralibra 2011-04-14
  • 打赏
  • 举报
回复
找到CIE-XYZ空间下蓝色的范围,然后修改下面这部分即可

% Define the lines in CIE-XYZ space, use to determine yellow color
lower_A = 0.87; lower_B = 0.04;
upper_A = 1.5 ; upper_B = -0.125;

4,445

社区成员

发帖
与我相关
我的任务
社区描述
图形图像/机器视觉
社区管理员
  • 机器视觉
  • 迪菲赫尔曼
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧