【图像处理】图像形态学处理系统Matlab源码
【图像处理】图像形态学处理系统Matlab源码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
图像形态学处理可以为图像检测识别提供技术指导.通过MATLAB中多种函数的选择对图像进行不同算法处理,结果表明:利用MATLAB软件能够实现彩色图像分量提取,加噪去噪。
2 部分代码
function hsi = rgb2hsi(rgb)
%
RGB2HSI Converts an RGB image to HSI.
%
HSI = RGB2HSI(RGB) converts an RGB image to HSI. The input image
%
is assumed to be of size M-by-N-by-3,
where
the third dimension
%
accounts
for
three image planes: red, green, and blue,
in
that
%
order. If all RGB component images are equal, the HSI conversion
%
is undefined. The input image can be of class double (with values
%
in
the range [0, 1]), uint8, or uint16.
%
%
The output image, HSI, is of class double,
where
:
%
hsi(:, :, 1) = hue image normalized to the range [0, 1] by
%
dividing all angle values by 2*pi.
%
hsi(:, :, 2) = saturation image,
in
the range [0, 1].
%
hsi(:, :, 3) = intensity image,
in
the range [0, 1].
%
Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%
Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%
$Revision
: 1.5 $
$Date
: 2005/01/18 13:44:59 $
%
Extract the individual component images.
rgb = im2double(rgb);
r = rgb(:, :, 1);
g = rgb(:, :, 2);
b = rgb(:, :, 3);
%
Implement the conversion equations.
num = 0.5*((r - g) + (r - b));
den = sqrt((r - g).^2 + (r - b).*(g - b));
theta = acos(num./(den + eps));
H = theta;
H(b > g) = 2*pi - H(b > g);
H = H/(2*pi);
num = min(min(r, g), b);
den = r + g + b;
den(den == 0) = eps;
S = 1 - 3.* num./den;
H(S == 0) = 0;
I = (r + g + b)/3;
%
Combine all three results into an hsi image.
hsi = cat(3, H, S, I);
3 仿真结果
4 参考文献
[1]钱月. 基于MATLAB的图像形态学处理技术与应用[J]. 内江师范学院学报, 2019(10):51-55.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
