"Pythphys", would it be too demanding to ask you to sign your messages
with a human name?...
Danke.
You ask:
> - changing to an image grey scale only needs ... what?
plt.set_cmap(plt.cm.gray)
in the context of your current figure. Or, use cmap=... in your imshow.
Please, look up "colormap" in the documentation.
> - I need to do a 'plane fit' of the image. Does matplotlib
> have some routine for this? Or shall I use other math libs?
I am not a guru of matplotlib, but this is a visualisation package, not
a data processing one. Scipy (numpy) have some interpolation procedures,
polyfit, etc. but I don't remember without digging the docs (which you
might do as well) whether multidimensional fitting is there.
Anyway, why not use your head? This is a standard student exercise.
You need to fit: zf = ax + by + c, having z =f(x,y) in your image, am
I right? If not, forget the rest.
Use the linear regression, find the zero of the gradient wrt (a,b,c) of
SUM[(ax +by +c - z)^2]
and that's all.
The most tragic part of the exercise is the necessity of solving a
linear equation set in 3 variables...
Jerzy Karczmarczuk
Caen, France
|