Azzera filtri
Azzera filtri

Image to Grayscale box

2 visualizzazioni (ultimi 30 giorni)
dunphy
dunphy il 15 Nov 2021
Risposto: SRUSHTI KHATAU il 15 Nov 2021
How do I change the color of image to a grayscale box? This is my code
  • yellow = [1,1,0; 1,1,0]; %yellow color
  • orange = [0.8500,0.3250,0.0980; 0.8500,0.3250,0.0980]; %orange color
  • pink = [1, 0.5, 0.8; 1, 0.5, 0.8]; %pink color
  • m = [yellow;orange;pink]; %separating the three colors into rows
  • tci = cat(3,m(:,1),m(:,2),m(:,3)); %concatenation.
  • A = imresize(tci,[6 5]); %code to resize the matrix to 6x5x3
  • image (A) %shows image

Risposte (1)

SRUSHTI KHATAU
SRUSHTI KHATAU il 15 Nov 2021
you can use rgb2gray for having grayscale image

Categorie

Scopri di più su Modify Image Colors in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by