博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
matlab识别图中蓝色,在网上下载了一个matlab的车牌识别,怎么将识别黄色车牌改成识别蓝色车牌,大神求解...
阅读量:4364 次
发布时间:2019-06-07

本文共 1134 字,大约阅读时间需要 3 分钟。

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

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; 这段代码怎么提取黄色改成提取蓝色

转载地址:http://oqkfs.baihongyu.com/

你可能感兴趣的文章
常用三大软件评价1
查看>>
MVC各层介绍使用---初步理解
查看>>
单例对象的创建与销毁
查看>>
知识点关键词(记录一下)
查看>>
国际结算业务
查看>>
嵌套循环概念
查看>>
IOS开发札记
查看>>
ASP.NET MVC Model绑定(二)
查看>>
一步一步写算法(之hash表)
查看>>
漫谈并发编程(一) - 并发简单介绍
查看>>
JDBC连接MySQL数据库及演示样例
查看>>
Beta 冲刺(1/7)
查看>>
修改 Vultr 登录密码
查看>>
CSS学习
查看>>
Centos 安装lnmp完整版
查看>>
【转】Eclipse和PyDev搭建完美Python开发环境(Ubuntu篇)
查看>>
Differences between page and segment
查看>>
字符串之strcmp
查看>>
最长公共子序列(不连续)
查看>>
微服务:Java EE的拯救者还是掘墓人?
查看>>