Find CDF in image

10 ビュー (過去 30 日間)
Dani D
Dani D 2016 年 5 月 2 日
コメント済み: Image Analyst 2016 年 5 月 2 日
Hello, I have an image and i want use CDF function for find CDF 0.5. How can use CDF function in matlab? I read help but i can't understand well. Thanks
I = imread('cameraman.tif');
%%FIND CDF 0.5 for this image.

回答 (1 件)

Image Analyst
Image Analyst 2016 年 5 月 2 日
Perhaps something like this to find the cumulative distribution function (integral of the histogram):
counts = histcounts(grayImage);
cdf = cumsum(counts)/sum(counts);
  2 件のコメント
Image Analyst
Image Analyst 2016 年 5 月 2 日
Dani's "Answer" moved here because it's a comment to me rather than an Answer to her original question:
Thanks, But CDF 0.5 is point which half pixel is left and half pixel should right. CDF 0.5 is one point (is pixel)
Image Analyst
Image Analyst 2016 年 5 月 2 日
Not sure what that means exactly, but if you want the median value you can use
medianValue = median(I(:));
You should get close the the same value if you use find on cdf
medianValue = find(cdf >= 0.5, 1, 'first');

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by