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.
Here is an old example for this. (read the entire thread to fit for an elliptic peak of arbitrary rotation, see image below)
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)
Many thanks altenbach. I tested it. it is great.
the resaon I wanted to try this is that some of our spot (which is the light reflect from a ball) are disrupted by dust on the surface of the ball ( the part of edge of the spot be eaten away ) which affacts the centroiding calculation.
again, thanks for your help.