Effacer les filtres
Effacer les filtres

How to fit a Gaussian curve to the profile obtained from "improfile"?

2 vues (au cours des 30 derniers jours)
Maximus
Maximus le 22 Jan 2014
Hi,
I have generated an intensity profile across a line section for my image using improfile. How do I get MATLAB to fit a Gaussian curve to this "noisy" profile?
The main aim is to fit a 2D Gaussian to the pixel values at each position across a 2D image, and to display the result visually in real time.
If this is not possible, then please advise me on other methods.
Thank you!

Réponses (1)

Bruno Pop-Stefanov
Bruno Pop-Stefanov le 22 Jan 2014
Modifié(e) : Bruno Pop-Stefanov le 22 Jan 2014
You can fit a mixture of Gaussian models to your profile interactively using the Curve Fitting Toolbox. Here is a tutorial:
Execute cftool to open the Curve Fitting tool. Select your profile as y-data then select "Gaussian" in the model list. You can visualize the profile and see how changing the number of Gaussian models affects the fit.
I suggest you blur your profile to smooth it before trying to fit a Gaussian to it. Use fspecial to create a filter and imfilter to blur the profile:
h = fspecial('gaussian', [1 7]);
smooth_profile = imfilter(profile, h, 'replicate');

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by