From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-22-2013 05:00 AM
hi, I am doing guassian peak fit as shown by curvefitting example of labview on an image. But when the same data is fitted through Origin or Matlab the results differ from that of Labview. Can anyone tell me why this is happaning??
Solved! Go to Solution.
02-22-2013 10:16 AM
Please post: 1. Your data. 2. The results you get from the other programs and from LV. 3. All of the initial settings or parameters used in both the LabVIEW and other programs.
Without specific data, it will not be likely that anyone can answer your question.
Lynn
02-22-2013 10:48 AM
@Aojha wrote:
But when the same data is fitted through Origin or Matlab the results differ from that of Labview.
I what way do they differ? Which software gives a better fit? As Lynn said, we need much more information.
02-24-2013 10:13 PM
hi,
I have attached the data in excel format. Along with Labview fit and Origin fit. The Labview fits data with R^2 of 0.94 while Origin fits the same data with R^2 of 0.967. The same thing happens with any other data.
02-25-2013 07:30 AM
We also need one more piece of data - what algorithms are you using to fit? The non-linear Levenburg-Marquart is the obvious choice, but with such noisy data, you may be better off with a downhill simplex using Lorentzian errors instead of Gaussian (see the online Numerical Recipes section on data fitting if you are unfamiliar with any of this). Also, your data appears to be more peaked than a Gaussian. It may fit better to a different distribution.
02-25-2013 03:17 PM - edited 02-25-2013 03:26 PM
I agree that the stock Gaussian Peak Fit does not perform well here, but the nonlinear curve fit works fine, with a ~2x better fit. (you just need to write a model)
(Even if you give the correct values as initial guesses for the gauss fit, it does not work well. Unfortunately, the inner code is hidden inside a DLL so we cannot probe further where the problem could be.)
I would recommend to use the nonlinear curve fit for this. Does it agree with your other methods?
Here's a quick VI comparing the two methods. (Modify as needed. It seem Origin defines the width and amplitude differently)
02-25-2013 09:59 PM
Actually the problem is that I am processing an image And I am getting data from that image. Now I have to find sigma and center of Guassian fit. So the data is not known, it varies with image points and I have to fit guassian only.
02-25-2013 11:04 PM
@Aojha wrote:
Actually the problem is that I am processing an image And I am getting data from that image. Now I have to find sigma and center of Guassian fit. So the data is not known, it varies with image points and I have to fit guassian only.
Sorry, I have no idea what you are trying to say here.
Can you show us such an image and whay you are trying to get out of it?
How does the data you attached earlier relate to an image?
02-26-2013 02:19 AM
The mismatch between the Gaussian Peak Fit.vi and the Nonlinear Curve Fit.vi results is due to the default parameter bounds of the Gaussian Peak Fit.vi. By default the bounds force the offset parameter to 0. Change the upper and lower limit to be +Inf and -Inf, and change the tolerance to be ~1E-8, and the results between the two VIs agree.
-Jim
02-26-2013 03:08 AM
I have attached a n image.
1-I have to count all the bright intensity objects in the image.
2-Calculate centroid of each bright intensity objects and mark its border.
3-plot horizontal and vertical profile for each centorid between object's border.
4-fit guassian curve on the profile and calculate standard deviation.
5-Again plot profile of intensity w.r.t. centroid (for each row and column of bright objects) and fit guassian to calculate standard deviation.
in sort I have to process individual bright objects to get individual spread (source size) and spread of source in whole image (source divergence).