void Rgb2Hsv(float R, float G, float B, float& H, float& S, float&V) { // r,g,b values are from 0 to 1 // h = [0,360], s = [0,1], v = [0,1] // if s == 0, then h = -1 (undefined) float min, max, delta,tmp; tmp = R>G?G:R; min = tmp>B?B:tmp
Filter Blue Light for Better Sleep By Carolyn Mohr11 May, 2016 Many people like to use their phones or tablets at night before they go to sleep. However, the light from mobile devices can interfere with sleep. But not all light carries the same risk.
首先,进行非均匀量化,H,S,V三通道分别量化为16,4,4级,返回一个向量.量化依据如下表: function vec = getHsvHist(Image) [M,N,O] = size(Image); if O~= 3 error('3 components are needed for histogram'); end [h,s,v] = rgb2hsv(Image); H = h; S = s; V = v; h = h*360; %将hsv空间非等间隔量化: % h量化成16级: %