[gdal-dev] 4 point, projective warping
Manuel Massing
m.massing at warped-space.de
Wed Jul 28 09:45:34 EDT 2010
Hi Jeffrey,
> Hi, all - I need 4-point (GCP) projective warping (
> http://docs.bentley.com/en/I-RASB/irasbhelp171.html) for my very basic
> rubbersheeting app at http://cartagen.org/maps (getting full-res TMS output
> working). These are for aerial photographs, not scanned images.
to implement this programmatically using GDAL, you could supply a custom
transform callback to the gdal warper.
Have a look at the qgis georeferencer plugin to see how a custom model can be
passed to the gdalwarper (in particular, see qgsgeoreftransfrom.{cpp,h},
where custom model fitting is implemented (e.g. helmert), and qgsimagewarper.
cpp,h}, where warper setup is handled).
A projective transform can be simply expressed as multiplication of an
inhomogenous coordinate vector with a 3x3 matrix (a homography).
Estimating a homography from 4 or more points is usually done by solving a set
of equations using singular value decomposition (see e.g. "Multiple View
Geometry In Computer Vision", by Hartley and Zissermann). You should be able
to find some code for that (e.g. I guess OpenCV should be able to do that).
I've thought about implementing a projective transform in the qgis
georeferencer, so if you're interested I'll let you know when I get around to
it.
cheers,
Manuel
More information about the gdal-dev
mailing list