Transforming map projections

Hi, I am working on a project with weather maps (rain/temperature/etc). These maps are provided in Mercator projection, where poles suffer of unavoidable distortion.

My goal is to extract image crops starting from random locations where distance (or areas) are somehow consistent. For example, in Mercator projection, a 200x200 crop around Oslo, Norway encapsulates way less area than the same crop centered in Lima, Peru. Moreover, extracting the neighborhood of the south pole is impossible (that point is actually a line).

I was thinking to something like this.

  1. from Mercator image, warp into a kind of spherical representation
  2. rotate the sphere so that target is at the “center”
  3. Apply a projection. Technically, anyone. My goal is that the distortion is always the same.

Do you have any suggestion? Is there anything convenient in OpenCV?

generally yes, but the steps in there are different. a mercator projection is a fine texture for a sphere. you just want a decent view onto the sphere.

I am unfamiliar with the stitching module of OpenCV so I can’t advise there. it probably contains something useful. I believe its main purpose is to take photos and assemble them into a map, but not to turn the map back into a view… but I could be mistaken.

one could construct the desired mapping with some numpy (index array/mesh grid) and general messing around. really you’d just have to throw the mercator map onto a cylinder and then put a camera at the optical center (inside the sphere). that’s a bunch of OpenGL/Direct3D/… or other 3D graphics code.