I wrote a simple application which has a static image.
I have 2 types coordinates for a point (or points if it is necessary):
- latitude and longitude;
- x and y for a screen.
So I can get some constant points with already converted coordinates.
Note that visible screen coords are always positive and (0, 0) is in the top left corner.
How many constant points I need? And how to convert using these points?
If the image is small enough to qualify as mostly undistorted, then one may assume for simplicity that the transform is (affine) linear, i.e. $$ (\lambda,\phi)\mapsto(x_0+a\lambda+b\phi,x_0+c\lambda+d\phi)$$ (or similarly the other way round). In that case three sample points suffice to solve for the unknowns $x_0,y_0,a,b,c,d$. This does of course not work if the transform is non-linear (i.e. if the curvature of the planet surface is noticeable).
In fact, assuming the view is from straight above (i.e. angles are preserved), two points will suffice, but that is less trivial.