How can i read the whole RGB image pixel by pixel with their values and to check that if pixels have specific value please guide me

Ruchi (view profile)

on 27 Apr 2013
Latest activity Answered by Mohamed Muhajir

Mohamed Muhajir (view profile)

on 31 Jan 2017
Accepted Answer by Chandra Shekhar

Chandra Shekhar (view profile)

How can i read the whole RGB image pixel by pixel with their values and to check that if pixels have specific value please guide me

Chandra Shekhar (view profile)

Answer by Chandra Shekhar

Chandra Shekhar (view profile)

on 27 Apr 2013
Edited by Chandra Shekhar

Chandra Shekhar (view profile)

on 27 Apr 2013

Suppose your image size is 50*50, then u separate each RGB plane.
R=image(:,:,1); or R=image(1:50,1:50,1);
G=image(:,:,2); or G=image(1:50,1:50,2);
B=image(:,:,3); or B=image(1:50,1:50,3);
by varying row and column of each plane you can check pixel values.
I hope this is answer for your question.

Ruchi

Ruchi (view profile)

on 27 Apr 2013
Thanks for ur response Actually i need to read pixel values to match whether it is "1" or not.so could you please explain what will be the code for this...
Chandra Shekhar

on 27 Apr 2013
[m n k]=size(I);
for l=1:k
for i=1:m
for j=1:n
if I(i:j:l)==1
do
else
dont
end
end
end
end

Mohamed Muhajir (view profile)

Answer by Mohamed Muhajir

Mohamed Muhajir (view profile)

on 31 Jan 2017

what is a value of a pixel sir