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

 채택된 답변

Subhadeep Koley
Subhadeep Koley 2020년 11월 9일

0 개 추천

% 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개)

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

질문:

2020년 11월 9일

답변:

2020년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by