How to applied 2d gaussian function
Afficher commentaires plus anciens
Hi,
I tried to modifed and applied this function: https://au.mathworks.com/matlabcentral/fileexchange/55033-fit-1d-and-2d-gaussian-to-noisy-data?s_tid=prof_contriblnk by @Manuel A. Diaz
I upload my code and data I don't know why the fit not working and the amplitude not in the center of the gaussain
I hope someone can help.
Thanks,
Réponses (2)
Yongjian Feng
le 3 Août 2021
0 votes
Try to contact the auther of the fileexchange function first?
1 commentaire
Z998567
le 3 Août 2021
You could try this alternative gaussian fitting routine, and see if you get different results:
4 commentaires
Z998567
le 3 Août 2021
Here's what I get,
load gauss
[X,Y]=ndgrid(1:length(imageData));
XY=[X(:),Y(:)];
params=gaussfitn(XY, imageData(:));
[D,A,mu,sig]=deal(params{:});
Zfit= D + A*exp( -0.5 * sum( (sig\(XY.'-mu)).*(XY.'-mu) ));
imageFit=reshape(Zfit,size(imageData));
montage({imageData,imageFit})
caxis(4000*[0.7615 0.8126])
Z998567
le 3 Août 2021
Matt J
le 3 Août 2021
Once you have the fitted parameters, you can plot it any way you wish.
Catégories
En savoir plus sur Image Category Classification dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

