How to take sum of grey value of an image

조회 수: 4 (최근 30일)
Deva Narayanan
Deva Narayanan 2018년 3월 15일
편집: Rik 2018년 3월 15일
I want to calculate sum of grey value of an image. I have enclosed a image . So kindly provide MATLAB code

답변 (1개)

Rik
Rik 2018년 3월 15일
편집: Rik 2018년 3월 15일
IM=imread('image.png');
%IM=mean(IM,3);%convert RGB to grey
IM=rgb2gray(IM);
sumval=sum(IM(:));
You forgot to attach the image. You should really consider a crash course Matlab, any half-decent tutorial will learn you how to do this.
  댓글 수: 1
Guillaume
Guillaume 2018년 3월 15일
Note that while taking the unweighted mean of the red, green and blue channels is certainly a possible way of converting to grey, it is not the most conventional. Most grey conversions put more weight on the green channel ( rgb2gray uses the weights 0.299, 0.587 and 0.114 respectively).

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by