Matlab's Surface fitting does not (yet) include fairly standard defined surfaces. The present contribution is a simple implementation of the surface fit to the problem of fitting a 2D gaussian to an observed object in an image. Keep the image size small in order not to suffocate the fitting routine.
Gauss2DRotFit requires an input in the form of a 2D intensity image of the 2D gaussian. It also accepts as a second input an structure defining the lower, upper bounds as well as a best guess of the 7 fit parameters. The structure has 3 fields: 'Lower','StartingPoint' and 'Upper'. A title string may be provided as a third input parameter.
A bit more detailed help in the file header would be useful.
Functions not declared (not involved in the file):
prepareSurfaceData( X,Y, im )
fit( [xData, yData], zData, ft, opts )
Could you please help or revise the given code.
what do you mean by 'Lower', 'StartingPoint' and 'Upper'?
I have read the code and find it very good. But now I do have some problem in calling the function.By more details, I do not know the data-style of 'im' in your code and the meaning of 'varargin'. So could you give me a example of calling the function. If it is convenient by email, please inform me. By the way my email is: firstname.lastname@example.org. Thank you!