You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
How can I fit a spot on an image to a 2D Gaussian function?
I have a Tiff image file, on it there's an almost round spot, e.g. laser profile.
Is there a way in mathematica to 2D Gaussian fit the spot?
Szabolcs Horvát
unread,
Apr 28, 2012, 5:23:36 AM4/28/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
The best way to do this would depend on the kinds of images you have
(i.e. how noisy they are, how many spots are there, etc.)
For example ComponentMeasurements will help measure the spot and also
identify its centre. Then you could cut the spot from the image and
convert it to a matrix so you can use fitting methods such as those
implemented in NonlinearModelFit.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
You might consider a polynomial fit to the logarithm of your data to the logarithm of the Gaussian, (which is a polynomial). A direct fit of the data to a Gaussian will minimize the square of the differences between the data and the Gaussian. This will tend to give large relative errors in the wings, and small relative errors in the spot. A logarithmic fit will minimize the relative errors, rather than the absolute errors. The "percent error" will be roughly the same over the entire field. I don't know if this is acceptable to you or not.
FairView
unread,
May 1, 2012, 5:23:53 AM5/1/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I'm kinda new to Mathematica. My above question should be devided into
2 parts:
1) how to read data from TIFF file (i.e. read image into intensity
matrix)
2) hot to fit the retrived data to a 2D Gaussian function