PDA

View Full Version : Fixing your equirectangular poles



mbartelsm
03-09-2013, 11:20 AM
Has it ever happened to you that you invest a LOT of time drawing a beautiful map that you just love, and one day, for whatever reason you decide to put it on a sphere or take a shot of how the poles look like and you realize they look horrible? then this tutorial is for you.


Let's say the ugly black and white thing below is your map.

52744

And this is the map on a stereographic projection seen from a pole and from the side

5274552746

The problem is that the equirectangular projection (the 2:1 rectangle in which world maps are usually drawn) heavily distorts poles and when people draw on in, they often don't take into account this distortion or simply fail at doing so. This tutorial focuses on fixing that problem with a method that is NOT redrawing your map multiple times until you get it right.

You are going to need:
1. G.Projector (http://www.giss.nasa.gov/tools/gprojector/)
2. Hugin (http://hugin.sourceforge.net/)
3. A raster graphics editor (Photoshop, GIMP, Paint.NET, etc.)

Step 1
Reprojecting your map to stereographic in G.Projector

1. Launch G.Projector
2. Open your map
3. Select the Stereographic projection from the drop down list
4. Set it to latitude 90 (or -90) and radius 90, longitude does not matter
5. Make sure the graticule is on - this is to make sure the process has gone right.
6. Save the newly projected map.
7. Repeat the process for the opposite pole

It should look like this now:

52737

Step 2
Cropping and fixing

1. Open your map in whatever raster graphic software you use
2. Crop the gray borders VERY carefully, the circular area of the map must remain intact
3. remove the remaining gray area leaving it transparent
3. Redraw your poles
4. Save as PNG or another format that supports transparency

5273852739

Step 3
Restoring the projection

1. Open Hugin
2. Load both of your poles
3. Set in the load dialogue 'Stereographic' and '180' degrees

52740

4. Now position your images

52741

4.1. Open the preview
4.2. Select the 'Move/Drag' tab
4.3. Select only one pole
4.4. Write in 'Pitch' 90 if it's the north pole, -90 if it's the south
4.5. Apply
4.6. Deselect current pole from step 4.3.
4.7. Select the other pole and repeat
4.8. If you feel comfortable, you can also just drag them
4.9. Show both poles to verify they are correctly placed
4.10. Close the 'Fast panorama preview dialog

5. Now save the map

52743

5.1 Back in hugin main window, select the 'stitcher' tab
5.2 Set projection to equirectangular
5.3 Field of view to '360' and '180'
5.4 Click 'calculate optimal size'
5.5 Click 'Fit crop to images'
5.6 Select the file format you desire
5.7 Stitch!

6. A couple of windows will pop up, when finished, check your final image.

52742
EDIT: I just noticed the black lines at the equator, I was in a hurry and just dragged the images, if you do it with care and the pitch dialog, this shouldn't happen, also, the yaw dialog moves the images to the side, in case they are not properly aligned

I know this sounds like a lot, but the process, not including the redrawing, shouldn't take more than 10 minutes, which is a lot less than redrawing over and over and over and over again until you get it right

mbartelsm
03-09-2013, 11:32 AM
Damn, did this all to help someone here in CG who was having troubles, went back to the thread and found an easier solution:
Avoiding polar distortion by ~Naeddyr on deviantART (http://naeddyr.deviantart.com/art/Avoiding-polar-distortion-119133522)