Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

07-20-2011 09:08 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi everyone,

I have the same problem but I need an isotropic 2D Gaussian fit to fit the image of a spot.

Is it an existing VI for this?

Gabriel

07-20-2011 09:42 AM - edited 07-20-2011 09:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

The problem has already been solved in this thread. Take my example above and surgically remove the code for the angle and the second width to make it isotropic. (Use the first width for both dimensions). These are minimal changes. The model will have two less parameters.

See how far you get....

08-04-2011 02:32 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello,

This example VI appears to be exactly what I need to profile a laser beam using a webcam. Unfortunately I only have labview 8.5. Is there anyway you can post a picture of the block diagram? I have been struggling to use the nonlinear curve fitting vi's supplied with labview to treat two dimensional data instead of simple 1D data. How do you adapt your 2D data to be processed by a 1D fitting algorithm?

Thanks very much, Arron

08-08-2011 09:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi MenI,

If you download the VIs you can upload them to the Downconvert forum (http://forums.ni.com/t5/LabVIEW/Downconvert-VI-Requests/m-p/1067229?requireLogin=False) and have someone downconvert these files for you.

Regards,

Daniel H.

07-09-2012 01:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Maybe a bit late, but for the people who happen to read this thread:

First of all, huge thanks to Altenbach for this VI and the explanation! It helped me a lot (i tried to make my own 2D Fit program and was looking for some kind of inspiration).

But there's a little (but crucial) mistake in your formula for calculating a gaussian disribution:

You forgot a factor of 2 in your model vi. The correct formula is exp(-2*x²/w²), yours is exp(-x²/w²). Both are correct. But when you calculate a power distribution (e.g. the intensity array of a CCD) you have to square your gaussian distribution (Intensity I = E²).

07-09-2012 01:47 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@Tjalf wrote:

You forgot a factor of 2 in your model vi. The correct formula is exp(-2*x²/w²), yours is exp(-x²/w²). Both are correct. But when you calculate a power distribution (e.g. the intensity array of a CCD) you have to square your gaussian distribution (Intensity I = E²).

(quote from my post above: "*... **and the principal Gaussian widths are defined as 2*sigma for code simplicity*"), so I documented that I took some shortcuts, even if the statement is not exactly correct )

All my gaussians are typically defined as width at half height, yet another convention.

07-09-2012 02:53 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-04-2012 07:44 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-04-2012 11:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@nikodem wrote:

A typical mistake is if the __size of the array__ of initial parameters does not match the number of parameters used in the model.

Does the function look OK if you calculate the model using your initial parameter estimates? Does it behave as expected if you change any of the parameters?

Can you attach your code?

10-04-2012 11:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator