rgb2ind
将RGB图像转换为索引图像
句法
描述
___= rgb2ind(___,,,,
启用或禁用抖动。抖动
)
例子
输入参数
输出参数
Algorithms
统一量化 - 如果您指定
托尔
, 然后rgb2ind
uses uniform quantization to convert the image. Uniform quantization cuts the RGB color cube into smaller cubes of length托尔
。例如,如果指定托尔
在0.1中,然后立方体的边缘是RGB立方体长度的十分之一。小块的总数是:t =(地板(1/tol)+1)^3
每个立方体在输出图像中表示单个颜色。所以,
t
是结肠的最大长度。rgb2ind
去除输入图像中未出现的任何颜色t
。Minimum Variance Quantization — If you specify
问
, 然后rgb2ind
使用最小方差量子化。最小的瓦里安Ce quantization cuts the RGB color cube into smaller boxes (not necessarily cubes) of different sizes, depending on how the colors are distributed in the image. If the input image actually uses fewer colors than the number specified, then the output colormap is also smaller.逆菌落 - 如果指定输入colormap
inmap
, 然后rgb2ind
使用colormap映射。逆菌落算法将指定的结肠量化为每个颜色成分的32个不同水平。然后,对于输入图像中的每个像素,找到了量化的菌落中最接近的颜色。
References
[[1] Spencer W. Thomas, "Efficient Inverse Color Map Computation",图形宝石II,(詹姆斯·阿尔沃(James Arvo)编辑),学术出版社:波士顿。1991。(包括源代码)