필터 지우기
필터 지우기

How to find the intensity of each pixel of an image?

조회 수: 27 (최근 30일)
shimul
shimul 2013년 9월 6일
편집: Image Analyst 2018년 4월 2일
Consider an image sample.jpg Now I want to count the number of pixels on that image have intensity value larger than 200(white pixels).
If the image contain such pixels above 75% then I want to reject the image. How can I accomplish this in matlab?
  댓글 수: 2
Doug Hull
Doug Hull 2013년 9월 6일
What format is the image in? RGB or greyscale? If it is just a greyscale image, it is really just a matrix and you can do any calculations on it like you would any matrix in MATLAB.
shimul
shimul 2013년 9월 13일
Yap I have done this. However thanks

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

채택된 답변

Image Analyst
Image Analyst 2013년 9월 6일
편집: Image Analyst 2013년 9월 6일
If it's a color image, first convert to a gray image
[rows, columns, numberofColorChannels] = size(originalImage);
if numberofColorChannels > 1
grayImage = rgb2gray(originalImage);
else
grayImage = originalImage;
end
otherwise if it's already gray, you don't need to call rgb2gray(). Then threshold
binaryImage = grayImage >= 200;
Then count
numberOfWhitePixels = sum(binaryImage(:));
Note: MATLAB uses the American spelling of gray, not the English spelling of grey.
  댓글 수: 14
Image Analyst
Image Analyst 2016년 5월 6일
You should start your own question for this.
sana saleeme
sana saleeme 2016년 5월 6일
will you answer me there?

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

추가 답변 (1개)

Upeka Somaratne
Upeka Somaratne 2018년 4월 2일
How can I get the pixel coordinates of the pixels which have intensity value greater than 200? (in matlab)
  댓글 수: 1
shimul
shimul 2018년 4월 2일
편집: Image Analyst 2018년 4월 2일
[rows, cols] = find(yourImage > 200);
considering the image is grayscale.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by