[Gdal-dev] gdalwarp, using GCPs with pixel positions outside the input image

Chris Campbell chris at alchemedia.jp
Thu Oct 21 08:07:04 EDT 2004


Hi

I am generating very large images which I rectify with gdalwarp, using 
lat-lon GCPs. Because of the size of the input images, it is much more 
practical to generate them in smaller sections, but I want each one of these 
smaller images to go through the same transformation as it it's 
corresponding part of the larger image would. Since the only pixel values 
for the GCPs I have are relative to the large image, and I want to use all 
available GCPs, I tried warping the smaller images by adding an offset to 
the pixel value depending on where the smaller image is within the large 
image..... of course this gives me some pixel values outside the image to be 
warped.
For example say my large image would be 50,000x50,000 pixels with GCPs 
spread fairly evenly through it. I generate a 2000x2000 section of it that 
covers the area say from (bottomleft-topright) 6000,6000 - 8000,8000. Now I 
warp this using GCPs which have their pixel values shifted by -6000,-6000. 
The GCPs that had pixel values less than 6000 will now be negative, and GCPs 
that had pixel values above 8000 likewise will not actually be in the image 
to be warped..... hope this all makes sense!
Anyway, this method runs fine and without errors etc, but the small 
rectified file is just not _quite_ the same as it's corresponding section in 
the large file. It is very close, but seems to have different coefficients 
for the warping calcluation.
So my question is, does using GCPs with pixel positions outside the image to 
be warped screw up the transformation?
Thanks for any comments....
Chris





More information about the Gdal-dev mailing list