Hi,
I am calibrating a camera and need to fit a cosine curve to each pixel. There 2048x2448 pixels. There's a total of 19 images of different intensities . I am trying to fit each pixel to a cosine function across the different images.
I used a fit function
fit = @(A,B,C,x) A + B.*(cos((x) + C)) ;
and put the paramters i wanted into a matrix whose location correspondeded to which pixel ir refers to.
The problem arises when i have a for loop to do this for all the pixels. It would take 5 years for the code to run .
Is there any tips for optimization? I can easly predict close to what the fit will look like; is there a way to implement this?
Any help/tips are greatly appreciated