title: Image Remapping Algorithm
body: <p>I have been developing (for the last 3 hours) a small project I'm doing in C# to help me choose a home.</p>
  
  <p>Specifically, I am putting crime statistics in an overlay on Google maps, to find a nice neighborhood.</p>
  
  <p>Here is an example:
  <a href="http://otac0n.com/Demos/prospects.html" rel="nofollow noreferrer">http://otac0n.com/Demos/prospects.html</a></p>
  
  <p>Now, I manually found the Lat and Lng to match the corners of the map displated in the example, but I have a few more maps to overlay.</p>
  
  <p>My new application allows me to choose a landmark and point at the image to tie the Pixel to a LatLng.  Something like:</p>
  
  <pre><code>locations.Add(new LocationPoint(37.6790f, -97.3125f, "Kellogg and I-135"));
  
  // and later...
  
  targetPoint.Pixel = FindPixel(mouseEvent.Location);
  </code></pre>
  
  <p>So, I've gathered a list of pixel/latlng combinations, and now would like to transform the image (using affine or non-affine transformations).</p>
  
  <p>The goal here is to make every street line up.  Given a good map, the only necessary transformation would be a rotation to line the map up north-to-south (and for now I would be happy with that).  But I'm not sure where to start.</p>
  
  <p><strong>Does anybody have any experience doing image transformations in C#?  How would I find the proper rotation to make the map level?</strong></p>
  
  <p>After the case of well-made maps is resolved, I would eventually like to be able to overlay hand drawn maps.  This would obviously entail heavy distortion of the final image, and may be beyond the scope of this first iteration.  However, I would not like to develop a system that would be un-expandable to this system in the future.</p>