How to applied 2d gaussian function
Mostrar comentarios más antiguos
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,
Respuestas (2)
Yongjian Feng
el 3 de Ag. de 2021
0 votos
Try to contact the auther of the fileexchange function first?
1 comentario
Z998567
el 3 de Ag. de 2021
You could try this alternative gaussian fitting routine, and see if you get different results:
4 comentarios
Z998567
el 3 de Ag. de 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
el 3 de Ag. de 2021
Matt J
el 3 de Ag. de 2021
Once you have the fitted parameters, you can plot it any way you wish.
Categorías
Más información sobre Image Category Classification en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

