Filter löschen
Filter löschen

RGB to gray pic

2 Ansichten (letzte 30 Tage)
Franzi
Franzi am 1 Mai 2020
Kommentiert: Image Analyst am 18 Jun. 2020
I want to convert a RGB picture to a gray one, does anybody know how to do that?
  3 Kommentare
Rik
Rik am 1 Mai 2020
You could also consider the rgb2gray function.
Image Analyst
Image Analyst am 18 Jun. 2020
Original question (for when it gets edited away):
I want to convert a RGB picture to a gray one, does anybody know how to do that?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 1 Mai 2020
Bearbeitet: KALYAN ACHARJYA am 1 Mai 2020
May be, is this to add all channels value to get the particular value
#See Whats going on, same code, just be one line see the Rik's Comments (Prefer & Recommended)
data=imread('1.jpeg');
[r,c,ch]=size(data);
for i=1:r
for j=1:c
data1(i,j)=sum(data(i,j,1:3));
end
end
imshow(data1,[]);
  2 Kommentare
Rik
Rik am 1 Mai 2020
Or just:
data1=sum(data,3);
KALYAN ACHARJYA
KALYAN ACHARJYA am 1 Mai 2020
yes, I feel so Thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by