필터 지우기
필터 지우기

how to find the pixel that drop from 0-100

조회 수: 1 (최근 30일)
wann Azihil
wann Azihil 2020년 6월 18일
답변: Ashwin 2020년 6월 18일
Here it is my code:
global a;
a=imread('.jpg')
a_gray=rgb2gray(a)
subplot(1,2,1)
imshow(a_gray)
subplot(1,2,2)
imhist(a_gray)
intensityValue(0,100)

채택된 답변

KSSV
KSSV 2020년 6월 18일
idx = a >= 0 & a <=100 ;
iwant = nnz(idx(:)) ;

추가 답변 (1개)

Ashwin
Ashwin 2020년 6월 18일
My understanding is that you require a way to identify the total number of pixels that have an intensity value between 0 and 100.
The a_gray array that you used to convert the image from RGB to grayscale contains the intensity values for the pixels as well. To find out the number of pixels, we can do:
val = sum(a_gray>0 & a_gray<100,'all');
Where ‘all’ parameter helps calculate in this case the number of 1s across all dimensions of the array,
Conditions a_gray>0 & a_gray<100 compare each element of the array to see if they match the condition.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by