필터 지우기
필터 지우기

RGB to gray pic

조회 수: 2 (최근 30일)
Franzi
Franzi 2020년 5월 1일
댓글: Image Analyst 2020년 6월 18일
I want to convert a RGB picture to a gray one, does anybody know how to do that?
  댓글 수: 3
Rik
Rik 2020년 5월 1일
You could also consider the rgb2gray function.
Image Analyst
Image Analyst 2020년 6월 18일
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?

댓글을 달려면 로그인하십시오.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 5월 1일
편집: KALYAN ACHARJYA 2020년 5월 1일
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
Rik
Rik 2020년 5월 1일
Or just:
data1=sum(data,3);
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 5월 1일
yes, I feel so Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by