Grayscale of RGB channels

8 次查看(过去 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 CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by