color array to grayscale, images
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Subhadeep Koley
2020 年 11 月 9 日
% 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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!