Effacer les filtres
Effacer les filtres

Grayscale of RGB channels

2 vues (au cours des 30 derniers jours)
SNEHA P S
SNEHA P S le 13 Juil 2017
Modifié(e) : Jan le 18 Juil 2017
Is it possible to convert the matrix values of R, G and B channels to its own grayscale values respectively?
  3 commentaires
SNEHA P S
SNEHA P S le 18 Juil 2017
Am not sure that whether the R G and B matrices itself display grayscales ?
Adam
Adam le 18 Juil 2017
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.

Connectez-vous pour commenter.

Réponse acceptée

Jan
Jan le 18 Juil 2017
Modifié(e) : Jan le 18 Juil 2017
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))

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Image Processing Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by