废话不多说,没什么技术含量,因为下面的代码是matlab中自带的转换函数。在这里贴出来只是为了方便以后复习、研究其转换的算法:
HSV空间:分别是H(色调)——S(饱和度)——V(亮度)
与HSI颜色空间类似:分别是H(色调)——S(饱和度)——I(强度)
注意:
强度和亮度差不多是一个概念。
饱和度代表的是渗入白光的数量级,白光越多,饱和度越小,白光越少,饱和度越大,表示颜色的纯度更大。
下面是代码:
rgb2hsv.m
function [h,s,v] = rgb2hsv(r,g,b)
%RGB2HSV Convert red-green-blue colors to hue-saturation-value.
% H = RGB2HSV(M) converts an RGB color map to an HSV color map.
% Each map is a matrix with any number of rows, exactly three columns,
% and elements in the interval 0 to 1. The columns of the input matrix,
% M, represent intensity of red, blue and green, respectively. The
% columns of the resulting output matrix, H, represent hue, saturation
% and color value, respectively.
%
% HS
MATLAB中的HSV与RGB颜色空间转换

这篇博客主要介绍了MATLAB中自带的RGB到HSV颜色空间转换的代码实现,以及HSV颜色空间的组成部分——H(色调)、S(饱和度)、V(亮度)的概念。同时提到了HSV与HSI颜色空间的相似性,以及饱和度和强度的含义。
最低0.47元/天 解锁文章
8258

被折叠的 条评论
为什么被折叠?



