2

I'm trying to georeference a photo using QGIS Georeferencer plugin (this is an oblique photograph. I know I should be using a proper georectification routine, but my current work now is just to simply overlay the photo on the DEM and see how it looks like). I'm working with spatial reference EPSG:31256 and quite a lot of GCP (total of 49 points). I tried several transformation type, and what worked best for my photo is Thin Plate Spline (TPS).

The plugin worked out fine and the created GDAL script is this:

gdal_translate -of GTiff -gcp 146.829 710 -88060.8 335823 -gcp 163.415 700.854 -88060.6 335823 -gcp 42.7439 406.829 -88043.5 335814 -gcp 57.0122 402.866 -88043.9 335813 -gcp 25.6707 241.22 -88010 335792 -gcp 32.622 240.244 -88009.9 335792 -gcp 32.1341 156.463 -87941 335747 -gcp 36.0366 156.098 -87940.6 335747 -gcp 239.939 126.098 -87935.2 335713 -gcp 243.841 125.976 -87935.3 335712 -gcp 312.805 192.439 -88007.8 335770 -gcp 318.78 191.098 -88008.1 335769 -gcp 471.22 296.098 -88045 335798 -gcp 482.317 293.293 -88045.3 335797 -gcp 667.073 465.976 -88061.4 335811 -gcp 676.951 460.732 -88061.4 335811 -gcp 901.585 708.171 -88069.6 335819 -gcp 919.146 700.366 -88069.6 335819 -gcp 1213.78 387.927 -88070 335802 -gcp 1232.56 385.976 -88070.3 335802 -gcp 1124.63 226.829 -88061.5 335776 -gcp 1133.66 226.341 -88061.8 335776 -gcp 902.439 148.293 -88040.2 335749 -gcp 907.805 148.049 -88040.5 335749 -gcp 671.22 108.049 -88001.3 335715 -gcp 676.829 107.561 -88001.5 335714 -gcp 637.073 73.1707 -87943 335632 -gcp 639.756 73.1707 -87943.3 335632 -gcp 920.976 61.2195 -87996 335635 -gcp 923.171 60.9756 -87995.7 335635 -gcp 1248.66 57.3171 -88049.6 335677 -gcp 1252.2 57.0732 -88050 335677 -gcp 1116 22 -87979 335462 -gcp 1279.17 42.1951 -88041.3 335599 -gcp 1276.24 380.732 -88071.1 335801 -gcp 1216.73 370 -88069.8 335800 -gcp 1099.66 713.415 -88071.7 335818 -gcp 1276.24 715.366 -88073.6 335817 -gcp 816.732 713.415 -88068 335820 -gcp 120.146 716.341 -88059.8 335824 -gcp 5.02439 686.098 -88057.8 335824 -gcp 2.58537 416.341 -88042.3 335814 -gcp 2.58537 397.805 -88040.3 335813 -gcp 1.85366 301.951 -88024.9 335803 -gcp 1.85366 293.415 -88022.9 335802 -gcp 1.85366 243.902 -88006.6 335791 -gcp 1.36585 238.78 -88004.4 335790 -gcp 1.60976 207.073 -87987.3 335779 -gcp 1.85366 183.902 -87968.5 335768 -gcp 2.09756 169.756 -87949.9 335756 Frame_2015-02-24_14-00-01.jpg Frame_2015-02-24_14-00-01_trans.jpg
gdalwarp -r near -tps -co COMPRESS=NONE -dstalpha Frame_2015-02-24_14-00-01_trans.jpg Frame_2015-02-24_14-00-01_tps.tif

But when I tried to run this script in GDAL console, it gave me error of "There is a problem to invert the interpolation matrix". I tried changing the transformation to Polynomial 3 (rewriting the -tps to -order 3), then the script worked out fine. So I guess it's the TPS transformation that was giving me the error. I need to run this in console since I want to batch process 200 photos using the same GCP reference. I figured the best way to do batch processing is through the script since the plugin doesn't seem to have that feature.

Does anyone have any idea on why the set up could work fine in Geoferencer plugin but failed through running the GDAL script? And does anyone perhaps know how to solve this problem?

  • Could you share the image Frame_2015-02-24_14-00-01.jpg or similar as well? – user30184 Feb 18 '16 at 14:49
  • My GDAL version prints this message: gdalwarp -r near -tps -co COMPRESS=NONE -dstalpha Frame_20 15-02-24_14-00-01_trans.tif Frame_2015-02-24_14-00-01_tps.tif Warning 1: GCP 16 and 14 have same (x,y)=(-88061.400000,335811.000000) but different (pixel,line): (676.951000,460.732000) vs (667.073000,465.976000) Warning 1: GCP 18 and 16 have same (x,y)=(-88069.600000,335819.000000) but different (pixel,line): (919.146000,700.366000) vs (901.585000,708.171000) ERROR 1: There is a problem inverting the interpolation matrix. – user30184 Feb 18 '16 at 15:05
  • I didn't realize that the numbers were rounded up in the script. thank you very much for pointing that out! I will try it again with rewriting the easting and northing with 3 decimal places. may I know from which platform/GUI you ran the GDAL to get the warning details? – toscha Feb 18 '16 at 15:58
  • Gdal 2.1-dev on Windows. – user30184 Feb 18 '16 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.