필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can I find the value with the most change in my histogram?

조회 수: 2 (최근 30일)
ThatStudent
ThatStudent 2019년 10월 13일
마감: MATLAB Answer Bot 2021년 8월 20일
[N,edges] = histcounts(Y);
min = mean();
[k1,k2,k3]=size(imYuv) %Size of the picture
for i=1:k1
for j=1:k2
if Y(i,j)>min
Y(i,j)=0;
end
end
end
imYuv(:,:,1)=Y;
final = colorspace('RGB<-YUV',imYuv);
HIstogram1.jpg
I know the value is around .64 something.
But im trying to automated so it can select that for my threshold value.
  댓글 수: 4
Image Analyst
Image Analyst 2019년 10월 13일
I don't understand. Do you just want to blacken any values higher than 0.67? Or is it variable? Because you have lots of minimums all over the place. If it's variable then how are we supposed to know to take the min between 0.5 and 0.7 and not the min between 0.5 and 0.35, or any other min?
ThatStudent
ThatStudent 2019년 10월 13일
Yeah I want to just blacken the values greater than 0.67, and use that to make all the values greater than that black. What my professor told me was to, get the minimun next to the largest or the one with the biggest change . That is how you would know to use that minimum instead of the others.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 13일
편집: KALYAN ACHARJYA 2019년 10월 13일
More detail with example:
data=[1 2 -4 5 6 0 5 20 10]; % Hist data is just simillar array
diff_data=diff(data)
idx=find(diff_data==max(diff_data));
threshold=data(idx+1)
  댓글 수: 2
ThatStudent
ThatStudent 2019년 10월 13일
Should I use the N or the edges or would it work with both?
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 20일
You can get it just see the maximum different (with neighbours) in number of pixels (N).

이 질문은 마감되었습니다.

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by