how to centralizes 98% energy of the histogram?

1 回表示 (過去 30 日間)
mohammed
mohammed 2013 年 10 月 6 日
コメント済み: mohammed 2013 年 10 月 6 日
hi i wanted to write a code for this but i dont know how to get 98% energy of histogram. the following is the actual data which i want to write in code.
h1= brightness histogram
F = b-a
where (a,b) satisfies that the region [a,b] centralizes 98% energy of the brightness histogram. Let d be the index of the bin with the maximal volume, i.e. h(d)=max(h1). Starting from the dth bin, the histogram is searched step by step alternately towards the two sides until the summation reaches 98% of the total energy. plz help me...............

採用された回答

Image Analyst
Image Analyst 2013 年 10 月 6 日
編集済み: Image Analyst 2013 年 10 月 6 日
Try this - a better algorithm, in my opinion:
[pixelCounts, grayLevels= = imhist(grayImage, 256);
cdf = cumsum(pixelCounts) / numel(grayImage);
aIndex = find(cdf > 0.01, 1, 'first');
a = grayLevels(aIndex);
bIndex = find(cdf > 0.99, 1, 'first');
b = grayLevels(bIndex);
  4 件のコメント
Image Analyst
Image Analyst 2013 年 10 月 6 日
What if it were the central 2%? Wouldn't that go from 49% to 51%? Well it's the same for the central 98%. It goes from 1% to 99% because 99-1=98.
mohammed
mohammed 2013 年 10 月 6 日
THANKS .. ya i got it........ thanks a lot....

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by