<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    That might be more trouble than its worth.  The trick is not to
    introduce any modeling "errors" when doing the steps, so the control
    points for the image's perspective transformation would have to
    first be projected from the sphere/spheroid to an orthographic map
    projection (I think).<br>
    <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
    <br>
    On 12/16/2010 9:26 AM, <a class="moz-txt-link-abbreviated" href="mailto:jkenneally@cartenav.com">jkenneally@cartenav.com</a> wrote:
    <blockquote cite="mid:1292516809.946713927@192.168.2.227"
      type="cite"><font face="arial" size="2">Hi Brent,<br>
        <br>
        That's a really good suggestion, especially as the perspective
        angle gets more extreme.   <br>
        <br>
        I dont think I can assume low altitude, so I think I will still
        need to attempt to correct for curvature of the earth, but I'm
        wonder if I can get away with doing an initial perspective
        transformation (ie warp it to a 'top down' perspective), then
        follow up with a second order polynomial gdalwarp for
        curvature?  <br>
        <br>
        Cheers!<br>
        <br>
        -----Original Message-----<br>
        From: "Brent Fraser" <a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com">&lt;bfraser@geoanalytic.com&gt;</a><br>
        Sent: Thursday, December 16, 2010 11:47am<br>
        To: <a class="moz-txt-link-abbreviated" href="mailto:jkenneally@cartenav.com">jkenneally@cartenav.com</a><br>
        Cc: "Frank Warmerdam" <a class="moz-txt-link-rfc2396E" href="mailto:warmerdam@pobox.com">&lt;warmerdam@pobox.com&gt;</a>,
        <a class="moz-txt-link-abbreviated" href="mailto:fwtools@lists.maptools.org">fwtools@lists.maptools.org</a><br>
        Subject: Re: [FWTools] gdalwarp issue?<br>
        <br>
        <meta content="text/html; charset=UTF-8"
          http-equiv="Content-Type">
        Jeff,<br>
        <br>
          If your aerial photography is at a low altitude, earth
        curvature won't play much of a part.  Then a better
        transformation might be a projective transformation (<a
          moz-do-not-send="true" class="moz-txt-link-freetext"
          href="http://www.leptonica.com/affine.html#RELATED-TRANSFORMS">http://www.leptonica.com/affine.html#RELATED-TRANSFORMS</a>). 

        Unfortunately GDAL doesn't support the projective
        transformation...<br>
        <pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
        <br>
        On 12/16/2010 8:03 AM, <a moz-do-not-send="true"
          class="moz-txt-link-abbreviated"
          href="mailto:jkenneally@cartenav.com">jkenneally@cartenav.com</a>
        wrote:
        <blockquote cite="mid:1292511804.800714399@192.168.2.227"
          type="cite"><font face="arial" size="2">Thanks a lot,
            Frank...that definitely seemed to help.   I've never really
            encountered 'thin plate splines' before, and I'm going to
            have to do a bit of reading regarding how they work. 
            However, in hind-sight I should have realized that I could
            only do an affine transform with four control points.  <br>
            <br>
            I do have just a few more questions about this if you don't
            mind though...<br>
            <br>
            Regarding the thin plate spline transformation, I do get the
            general transformed shape I was expecting, but the sides are
            a little more 'curved' than I was expecting, and I'm not
            sure how accurate they are.  Is this to be expected?  I am
            attaching another tiny image to demonstrate the result of my
            earlier warp with the '-tps'.<br>
            <br>
            Lastly, based on further reading I get the impression that a
            second order polynomial warp will at least incorporate a
            better model of earths curvature into the transformation,
            and that a third order would also help account for the
            'perspective' of the camera when the source imagery is not
            taken from a 'straight down' vantage point.   If this is
            correct, is it enough to literally just specify a few more
            gcp's (6 total) for a second order, or 10 for the 3rd
            order?   I assume it would be best to distribute these gcp's
            fairly evenly over the source image?<br>
            <br>
            Thanks again for your help!<br>
            Jeff<br>
            <br>
            -----Original Message-----<br>
            From: "Frank Warmerdam" <a moz-do-not-send="true"
              class="moz-txt-link-rfc2396E"
              href="mailto:warmerdam@pobox.com">&lt;warmerdam@pobox.com&gt;</a><br>
            Sent: Wednesday, December 15, 2010 6:55pm<br>
            To: <a moz-do-not-send="true"
              class="moz-txt-link-abbreviated"
              href="mailto:jkenneally@cartenav.com">jkenneally@cartenav.com</a><br>
            Cc: <a moz-do-not-send="true"
              class="moz-txt-link-abbreviated"
              href="mailto:fwtools@lists.maptools.org">fwtools@lists.maptools.org</a><br>
            Subject: Re: [FWTools] gdalwarp issue?<br>
            <br>
            On 10-12-15 01:49 PM, <a moz-do-not-send="true"
              class="moz-txt-link-abbreviated"
              href="mailto:jkenneally@cartenav.com">jkenneally@cartenav.com</a>
            wrote:<br>
            &gt; Once that is complete I run gdal_warp with the
            following arguments:<br>
            &gt;<br>
            &gt; gdalwarp.exe -t_srs EPSG:4326 -wt Byte -r bilinear -of
            GTiff -srcnodata "0 0 0<br>
            &gt; 0" -dstnodata "0 0 0 0"
            "C:\Projects\example_test_4\test_image_referenced.tif"<br>
            &gt; "C:\Projects\example_test_4\test_image_rectified.tif"<br>
            &gt;<br>
            &gt; I have tried different combinations of input params on
            both commands with no<br>
            &gt; success so far, but the above are the current 'best
            guess' at what I should be<br>
            &gt; specifying. I am suspicious that maybe I should be
            specifying a -a_src param<br>
            &gt; for the translate call?<br>
            &gt;<br>
            &gt; As I mentioned in my previous post, if I load
            'test_image_referenced.tif' into<br>
            &gt; Global Mapper after the gdal_translate call it appears
            as expected, so I don't<br>
            &gt; think it is as simple as my corner coords being wrong.
            Also, the final warped<br>
            &gt; 'test_image_rectified.tif' seems to be rotated
            correctly, just not bound within<br>
            &gt; the correct 'footprint' shape.<br>
            ...<br>
            &gt; I am attaching a teeny file comparing the final image
            loaded into global mapper<br>
            &gt; and OpenEv to show more clearly what I am seeing with
            the results.<br>
            <br>
            Jeff,<br>
            <br>
            Based on the image you attached I think you want more than a
            first order<br>
            polynomial transformation. You want, essentially, piecewise
            warping.<br>
            Four GCPs are only enough to give rotation and shear in a
            first order<br>
            polynomial. But if you use thin plate splines instead with
            the GCPs you<br>
            should get a more general transformation.<br>
            <br>
            Try adding "-tps" to the gdalwarp commandline arguments.<br>
            <br>
            Best regards,<br>
            -- <br>
---------------------------------------+--------------------------------------<br>
            I set the clouds in motion - turn up | Frank Warmerdam, <a
              moz-do-not-send="true" class="moz-txt-link-abbreviated"
              href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>
            light and sound - activate the windows | <a
              moz-do-not-send="true" class="moz-txt-link-freetext"
              href="http://pobox.com/%7Ewarmerdam">http://pobox.com/~warmerdam</a><br>
            and watch the world go round - Rush | Geospatial Programmer
            for Rent<br>
            <br>
          </font>
          <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
FWTools mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:FWTools@lists.maptools.org">FWTools@lists.maptools.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.maptools.org/mailman/listinfo/fwtools">http://lists.maptools.org/mailman/listinfo/fwtools</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://fwtools.maptools.org/">http://fwtools.maptools.org/</a>
</pre>
        </blockquote>
      </font>
    </blockquote>
  </body>
</html>