Haha, it's funny that you mention it, because I (as an beginner) tried that and it worked, BUT it is far too inaccurate, is there an different solution?
Now it becomes interesting, the deviation is at some points too much, as well negative as positive. That's because of the resolution. Is it possible to increase the resolution, p.e., make from every pixel four??. (pixel overlap?)
It isn't the resolution. It is more a perspective thing. For accurate measurements, you need to be looking directly at the needle from a perpendicular position. The needle has to be flat against the surface, and it needs to have the same shape in any position. The lighting has to be good so there are no shadows. I would not expect to get fantastic measurements from your setup, so it may be the best you can get.
I did it!, I created an array (sine waveform) and added it to the other array to compensate the deviation, and it worked perfectly!:) The max deviation now is only 1 degree, thanks everyone for the responses