rgb颜色空间,hsv颜色空间绘制如下,那hsi怎么绘制呢
《如何用matlab绘制rgb,HSV颜色空间?》, 一起来围观吧 https://blog.csdn.net/qq_38799806/article/details/120516608?utm_source=app&app_version=5.3.1&code=app_1562916241&uLinkId=usr1mkqgl919blen
用这个转成hsi试试
function [hsi] = rgb2hsi(rgb)
%UNTITLED3 此处显示有关此函数的摘要
% 此处显示详细说明
rgb=im2double(rgb);
r=rgb(:,:,1);
g=rgb(:,:,2);
b=rgb(:,:,3);
% H 单位弧度
num=0.5*((r-g)+(r-b));
den=sqrt( (r-g).^2 + (r-b).*(g-b) );
theta=acos(num./(den+eps)); %分母+eps防止为0 acos得到的是弧度
H0=theta.*(g>=b); %G>=B
H1=(2*pi-theta).*(g<b); %G<B
H=H0+H1;
% %转成角度
% H=H.*360./(2*pi);
% S
num=3.*min(min(r,g),b);
S=1-num./(r+g+b+eps);
% I
I=(r+g+b)/3;
H=(H-min(min(H)))./(max(max(H))-min(min(H)));
S=(S-min(min(S)))./(max(max(S))-min(min(S)));
hsi=cat(3,H,S,I);
end
不知道对你是否有帮助:
Demo:
[X,Y]=meshgrid(-299:300);
Z=abs(ifft2(ifftshift((hypot(Y,X)+1e-5).^(-2.1).*exp(rand(size(X))*2i*pi)))); %example terrain inspired by rafael.pinto
Z=(Z-Z(300,300))*1000/std(Z(:));
surf(Z)
material dull
camlight
shading interp
camorbit(3,2,4)
caxis([-1 1]*max(caxis))
axis off
%Then make water blue and land green
hslcolormap('mc.yc',[1 0],[.1 .3 1])
colorbar
surf(peaks);
H=rand;
S=rand*.5+.5;
L=[.01 .99];
hslcolormap(H,S,L)
colorbar
matlab hsi颜色空间,RGB 颜色空间转 HSI 颜色空间的matlab程序实现
https://blog.csdn.net/qq_43266432/article/details/120652214