Pixelwise least square in Python
I have a non-linear forward model which computes a gray scale image for a per-pixel parameter w. I am also able to invert the model using scipys optimize functions. The only problem I am having currently is the size of the image is making this solution really slow… Like 7% of the pixels have been calculated in 40 minutes slow. I am looping over all pixels with a for-loop and applying the model pixelwise. I have tried the least_squares, leastsq, and root functions, but all of them are quite slow. I also implemented the derivative values, since I heard it could be faster by providing the jacobian matrix, but to no avail.