Skip to content

Commit d8e3962

Browse files
authored
New Transform type: Homography (OSGeo#11949)
Add new transform type, Homography. Add functions to compute homography from a list of GCPs. Add functions to serialize and deserialize a homography Automatically select homography transfrom when there are 4 or 5 GCPs present. Fixes OSGeo#11940
1 parent ee53c8c commit d8e3962

11 files changed

+1218
-2
lines changed

alg/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ add_library(
55
contour.cpp
66
delaunay.c
77
gdal_crs.cpp
8+
gdal_homography.cpp
89
gdal_octave.cpp
910
gdal_rpc.cpp
1011
gdal_tps.cpp

alg/gdal_alg.h

+10
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,16 @@ int CPL_DLL GDALGCPTransform(void *pTransformArg, int bDstToSrc,
165165
int nPointCount, double *x, double *y, double *z,
166166
int *panSuccess);
167167

168+
/* Homography transformer ... forward is to georef coordinates */
169+
void CPL_DLL *GDALCreateHomographyTransformer(double adfHomography[9]);
170+
void CPL_DLL *
171+
GDALCreateHomographyTransformerFromGCPs(int nGCPCount,
172+
const GDAL_GCP *pasGCPList);
173+
void CPL_DLL GDALDestroyHomographyTransformer(void *pTransformArg);
174+
int CPL_DLL GDALHomographyTransform(void *pTransformArg, int bDstToSrc,
175+
int nPointCount, double *x, double *y,
176+
double *z, int *panSuccess);
177+
168178
/* Thin Plate Spine transformer ... forward is to georef coordinates */
169179

170180
void CPL_DLL *GDALCreateTPSTransformer(int nGCPCount,

0 commit comments

Comments
 (0)