Grayscale of RGB channels

6 ビュー (過去 30 日間)
SNEHA P S
SNEHA P S 2017 年 7 月 13 日
編集済み: Jan 2017 年 7 月 18 日
Is it possible to convert the matrix values of R, G and B channels to its own grayscale values respectively?
  3 件のコメント
SNEHA P S
SNEHA P S 2017 年 7 月 18 日
Am not sure that whether the R G and B matrices itself display grayscales ?
Adam
Adam 2017 年 7 月 18 日
Each of the R, G and B channels can already be considered greyscale by itself. Whether it is useful to do so or not is another matter, but you haven't given any information so it's impossible to say.

サインインしてコメントする。

採用された回答

Jan
Jan 2017 年 7 月 18 日
編集済み: Jan 2017 年 7 月 18 日
RGB = rand(100, 100, 3); % RGB array
R = RGB(:, :, 1); % Gray image of the red channel
G = RGB(:, :, 2); % Gray image of the green channel
B = RGB(:, :, 3); % Gray image of the blue channel
figure
image(R)
figure
image(cat(3, R, R, R))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModify Image Colors についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by