# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Re: 2d Gaussian Fit Problem.

Sorry, I don't have IMAQ. Could you replace your image with a diagram constant of a 2D array?

Also, since your data is arranged in a grid, all you need is reshape to a 1D array (the picture array and the function output inside the model), you don't need this advanced coding that also works for scattered xyz data.

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 11 of 24
(3,485 Views)

## Re: 2d Gaussian Fit Problem.

@altenbach wrote:

Also, since your data is arranged in a grid, all you need is reshape to a 1D array (the picture array and the function output inside the model), you don't need this advanced coding that also works for scattered xyz data.

Here is an old example for this. (read the entire thread to fit for an elliptic peak of arbitrary rotation, see image below)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 12 of 24
(3,483 Views)

## Re: 2d Gaussian Fit Problem.

Dear

I replaced the same image with static 2d array. thanks for your time

cheers

xg

Message 13 of 24
(3,476 Views)

## Re: 2d Gaussian Fit Problem.

As I said, you should use code that is optmized for gridded data. There is no reason to do the xyz dance.

Here's a quick rewrite of my older code.

(simply read your PNG file, wat a few seconds, and it will fit it just fine. For faster fitting, you should take a reasonably sized subset around the peak)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 14 of 24
(3,465 Views)

## Re: 2d Gaussian Fit Problem.

And here's how it would look taking a reasonable subset. Much faster! (same model VI as above)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 15 of 24
(3,463 Views)

## Re: 2d Gaussian Fit Problem.

Dear

Many thanks for your quick reply and help. I thought of using the subset too.

xg

Message 16 of 24
(3,451 Views)

## Re: 2d Gaussian Fit Problem.

Here's the LabVIEW 2012 version.

(EDIT: rezipped and uploaded new version)

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 17 of 24
(3,441 Views)

Many thanks

xg

Message 18 of 24
(3,431 Views)

## Re: 2d Gaussian Fit Problem.

I am having trouble extracting your zip file.  It seems corrupt.  Could you please re-upload a new version?

Message 19 of 24
(3,395 Views)

## Re: 2d Gaussian Fit Problem.

This thread contains 6 zip files. can you tell which one is giving you problems?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 20 of 24
(3,386 Views)