gray2ind
将灰度或二值图像转换为索引图像
说明
示例
输入参数
I
— 灰度图像
数值数组
灰度图像,指定为任意维度的数值数组。
数据类型: single
| double
| int16
| uint8
| uint16
BW
— 二值图像
数值数组
二值图像,指定为任意维度的数值数组。
数据类型: logical
c
— 颜色图的颜色数量
正整数
颜色图的颜色数量,指定为 1 到 65536 之间的正整数。
如果输入图像是灰度图像,则
c
的默认值为64
。如果输入图像是二值图像,则
c
的默认值为2
。
输出参数
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
GPU 数组
通过使用 Parallel Computing Toolbox™ 在图形处理单元 (GPU) 上运行来加快代码执行。
此函数完全支持 GPU 数组。有关详细信息,请参阅GPU 上的图像处理。
版本历史记录
在 R2006a 之前推出R2022b: 支持 GPU 加速
gray2ind
现在支持 GPU 加速(需要 Parallel Computing Toolbox™)。
R2021b: 支持基于线程的环境
gray2ind
现在支持基于线程的环境。
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)