Why does my image does not conert to grayscale?
19 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Andrew Killian
am 31 Aug. 2021
Kommentiert: Image Analyst
am 5 Sep. 2021
I need to convert an image that we were given to grayscale.
I wrote the code below. When I highlight the whole 'imagesc' line and 'evaluate selction' the image pops up but in color.
logo = imread('..._logo.jpg');
figure;
imagesc(logo);
colormap gray;
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 31 Aug. 2021
Use imshow() because imagesc() applies some funky colormap by default, and that is usually not what you want.
3 Kommentare
Image Analyst
am 31 Aug. 2021
No, you don't need that last line. The default for gray scale images is to not use a colormap and show everything in it's original, native gray color.
Image Analyst
am 5 Sep. 2021
Andrew, if this solved it, can you click the "Accept this answer" link? Thanks in advance.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Red finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!