필터 지우기
필터 지우기

Fit Gaussian to randomly distributed points

조회 수: 1 (최근 30일)
Daniel Goldfarb
Daniel Goldfarb 2015년 5월 26일
댓글: Greig 2015년 5월 28일
I'm trying to recreate the signal produced by a microscope by randomly distributing x number of points(with a given intensity value) on a matrix of a size equal to the resolution(512). I then want to fit a gaussian on to each point to see at what density value of points do I lose the ability to resolve the peaks.
Regarding the code, I'm able to randomly allocate the points and set a peak intensity:
a=1 b=resolution
for i=1:number_of_points x=ceil(((b-a).*rand(i,1)+a)); y=ceil(((b-a).*rand(i,1)+a)); A(x,y)=100;
but I'm unable to fit gaussian to each one of those peaks. How would I take a single value in a matrix and fit a point spread function which caries over the entire matrix, until point density equals a value in which no peaks are resolvable

답변 (1개)

Greig
Greig 2015년 5월 26일
If I understand your question properly, I think imgaussfilt might be what you are looking for, but you will need to make some decision about the sigma value for the Gaussian. Also, I think it only does isotropic filtering (i.e., sigma is the same in all directions).
  댓글 수: 2
Daniel Goldfarb
Daniel Goldfarb 2015년 5월 26일
Thanks for the quick response Greig. Unfortunately imgaussfilt didn't work for a double input argument.
Greig
Greig 2015년 5월 28일
I don't actually have Image Processing Toolbox, which is needed for imgaussfilt, so I cannot play around with it, but it should be able to handles this. It reads in an image matrix, which is 2D. In your case I think you want to use it like:
B = imgaussfilt([x,y], sigma);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by