Take the average from a region of a plot and subtract the background

3 ビュー (過去 30 日間)
aneps
aneps 2013 年 11 月 25 日
コメント済み: Image Analyst 2013 年 11 月 25 日
I have a histogram ranging from 0 to 700 (along X axis). It is an exponential decay curve. I want to take the average from 600 to 700. This average is the background. I want to subtract this background from the plot. How can I perform this in Matlab?

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 25 日
Try this:
binaryImage = grayImage > 600;
meanGL = mean(grayImage(binaryImage ))
newImage = double(grayImage) - meanGL; % Casting to double is needed to get negative values.
imshow(newImage, []); % The [] is needed.
  7 件のコメント
aneps
aneps 2013 年 11 月 25 日
Yes, I know indexing a little bit. This meanBinIndex gives the mean in the range 620 to 720 right? If so, I guess, this value can be used as the background.
Image Analyst
Image Analyst 2013 年 11 月 25 日
It should give you the mean t in the histogram. Because your t starts at 0, you can find the index, if you need it, by adding 1. If you need just the t value, you don't need to add 1.

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

その他の回答 (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