필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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
Chandra Shekhar 2013년 4월 27일
편집: Chandra Shekhar 2013년 4월 27일
Suppose your image size is 50*50, then u separate each RGB plane.
image=imread('img.jpg');
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.
  댓글 수: 2
Ruchi
Ruchi 2013년 4월 27일
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
Chandra Shekhar 2013년 4월 27일
편집: Chandra Shekhar 2013년 4월 28일
I=imread('board.tif');
[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

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

추가 답변 (1개)

Mohamed Muhajir
Mohamed Muhajir 2017년 1월 31일
what is a value of a pixel sir

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by