名前
RGB2Ind — はRGB空間の画像を色の表のインデックスとして現れる画像へ変換する
Calling Sequence
[IndexImage ColorMap] = RGB2Ind(RGB);
Parameters
- RGB
3次元の行列で、型はuint8、uint16、uint32又はdoubleである。
- IndexImage
2次元の行列で、行と列の数はRGBと同じである
- ColorMap
行列で、行の数はRGBの画素数と同じで、列の数は3つである。本数の引数は必要である
説明
本関数はRGB空間の画像を色の表のインデックスとして現れる画像へ変換する。
例
RGB = rand(3, 3, 3) // generate random image
[IndexedImage, ColorMap] = RGB2Ind(RGB) // RGB is converted to an indexed image
FigureHandle = ShowImage(IndexedImage, 'Example', ColorMap); // IndexedImage is displayed