How to applied 2d gaussian function
Mostra commenti meno recenti
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,
Risposte (2)
Yongjian Feng
il 3 Ago 2021
0 voti
Try to contact the auther of the fileexchange function first?
1 Commento
Z998567
il 3 Ago 2021
You could try this alternative gaussian fitting routine, and see if you get different results:
4 Commenti
Z998567
il 3 Ago 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
il 3 Ago 2021
Matt J
il 3 Ago 2021
Once you have the fitted parameters, you can plot it any way you wish.
Categorie
Scopri di più su Image Category Classification in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

