Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How can I find the value with the most change in my histogram?
2 ビュー (過去 30 日間)
古いコメントを表示
[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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/242467/HIstogram1.jpeg)
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
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?
回答 (1 件)
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 件のコメント
KALYAN ACHARJYA
2019 年 10 月 20 日
You can get it just see the maximum different (with neighbours) in number of pixels (N).
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!