color array to grayscale, images
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Michelle
am 9 Nov. 2020
Beantwortet: Subhadeep Koley
am 9 Nov. 2020
I have two jpg images that I need to store as matrices of doubles then convert their color arrays into grayscale matrices. how would I do that?
*I attached the photos in a zip file
0 Kommentare
Akzeptierte Antwort
Subhadeep Koley
am 9 Nov. 2020
% Read the image
img1 = imread('photo1.jpg');
% Convert it to double
img1Double = im2double(img1);
% Convert from RGB to grayscale
img1Gray = rgb2gray(img1);
% Display the results
figure
imshowpair(img1, img1Gray, 'montage')
You can do the same for 'photo2.jpg'
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!