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

조회 수: 2 (최근 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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by