2

How to get coords for NW and SE if we have about 4-5 pixels on the image with assigned latit/longit? I'm working on javascript app which would overlay that image on Google Map then.

Thanks.

1

Man, you show no own effort... when I read your previous question I knew you would ask this... based on the restrictions you make (e.g. no rotation, just scaling and shifting), you have to write set of equations for the 4-5 corresponding points, using the scale and shift parameters. Then you have the parameters for which the reference points fit best. For this you solve the equations e.g. like regression (if you have more equations than parameters), so minimize the error with least squares estimation. You can use some statitistics library for it but in javascript I doubt it exists. I would solve it manually by putting second derivation of all parameters as zero. This would give me another set of equations to solve. When you have the parameters it is easy to compute the NW and SE coords. This is quite simple math but if you don't have the background to do this, ask on https://math.stackexchange.com/

| improve this answer | |
  • I'm really trying to figure this out.. I'm sorry you think I show no effort. And better to write - 'Women' :) So, it is possible to get NW and SE coords when we have assigned lat and long of 4-5 points? I don't have a background of doing this, but I would like to learn definitely. – againstflow Jul 17 '13 at 11:10
  • @againstflow, are you a woman (in that case I am sorry :)), or are you a man warning me for possible faux pas? :) Anyways: yes, 4-5 points is enough. You need 4 numbers (coordinates of 2 corners) which is equivalent to 4 parameters (shift X, shift Y, scale X, scale Y). 4-5 points is 8-10 numbers which is enough. 2 points would be also enough (if they don't sit on the same X or Y position). – Tomas Jul 17 '13 at 11:26
  • I am a women, and it's ok :) Ok, thanks, now it is more clear to me. Is there some example of similar formula or any help I could get regards to formula I should use? Thanks. – againstflow Jul 17 '13 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.