ā12-06-2012 02:18 AM
OK, the Gaussians in the x and y direction are the same, but both are asymmetric, with a different width on each side. (in the more general case, you would need four widths)
Here's my 5 minute modification (fitsurface4.zip). See if it works for you. I am not sure if it is exactly what you want. (there are probably bugs)
Since there is significantly more asymmetry now, there are probably local minima in the rotation, so you might have to add some more intelligence to get a good angle guess.
(To simulate other data scenarios, make the "guess" array into a control and vary any parameter at will, then look at the middle graph, e.g. fitsurface3.zip)
ā05-21-2013 02:07 PM
this same problem is mine ihave an image of bead and i have to its center ,but cant able to do this i have labview 11
ā05-21-2013 02:22 PM
@abhishek_singh wrote:
this same problem is mine ihave an image of bead and i have to its center ,but cant able to do this i have labview 11
This is not sufficeint information to help you.
What have you tried and what kind of errors did you encounter?
Attach your code and your data so we can see what's wrong.
ā04-21-2014 09:11 AM
Dear Altenbach,
First of all like the others here I want to thank you for your tricks which allowed me to build an efficient 2D fitting algorithm for my experimental data. I would now have interest in getting confidence intervals for the different fitting parameters and I was trying to use the built-in labview VI Nonlinear curve fit intervals, but it seems that it does not respond very well to having no X input (unlike the nonlinear fitting VI). I also tried it unsuccessfully with your 2D gaussian fitting code.
Do you have suggestions as to how to treat this problem?
Thank you very much in advance,
Antoine
ā04-23-2014 08:57 AM
Please disregard the previous message, th eproblem was actually the same as pointed out in the thread http://forums.ni.com/t5/LabVIEW/Non-linear-Fit-Intervals-Gives-Error-20001/td-p/1301484.
Thank you nonetheless (you answered that hread too...)
ā04-17-2015 04:27 AM
Dear altenbach,
Dear All,
thank you for your help on 2D fitting.
I think that the version 2 (FitSurface2.zip ā40 KB) should be the best approach for my problem.
I have a spot that should be gaussian (it should be better to use a Pseudo Voigt, i.e. something similar to µ*F_gauss + (1-µ)*F_Lorentz) that should be elliptical and rotate.
However, during an experiment I can obtain a saturated image...
In order to not loose all the experimental run, I would like to fit the spot making a mask (or better not fitting the saturated areas). The vi FitSurface2 transform 2D to 1D: in this way it is possible to fit (for each line) only the tails, discarding the saturated points.
But, how I can do it in Labview? (I can do with Origin, Kaleidagraph...)
awaitig some helps...
dh
ā04-17-2015 09:32 AM
I believe Altenbach's fit is a general 2D non-linear fit to a (more-or-less arbitrary) model. If you want to fit, but your data is saturated, make a model of "saturated data". In your case, the model would be min (Gaussian model, Saturated Value).
Bob Schor
ā04-17-2015 10:10 AM
Dear Bob,
I'm sorry but I do not understand "make a model of "saturated data" "
dh
ā04-17-2015 11:09 AM - edited ā04-17-2015 11:10 AM
@Dariush_Hampai wrote:
Dear Bob,
I'm sorry but I do not understand "make a model of "saturated data" "
I am sure that a saturated 2D gaussian can be modeled mathematically, maybe with just one additional parameter that describes the saturation. So simply add one more parameter, rewrite the model subVI according and fit for it.
If you have problem with that, please attach some typical data.
Is the saturation some nonliear process or is it just an input clipping? Is the saturated value known (e.g. 255, or whatever the Z resolution of the deterctor is)
ā04-17-2015 11:13 AM - edited ā04-17-2015 11:13 AM
Dear Altenbach,
in my attach you may find your example with my saturated image