[gdal-dev] gdalwarp on a separate RPC model
Yi Dong
yidong80 at gmail.com
Mon Jun 15 12:40:34 PDT 2015
Hi Evan,
Thanks a lot! Your suggestion is exactly what I am looking for. To
keep the record, here is what I did
1. gdal_translate -of VRT input.ntf input.vrt
2. modify the 'input.vrt' w.r.t. correct RPC model, name it as
'input_correct.vrt'
3. gdalwarp -rpc -to RPC_HEIGHT=200 input_correct.vrt output.tif
4. gdaltransform input_correct.vrt for projection
5. gdaltransform -i input_correct.vrt for backprojection
Thanks everyone again for help
Ian
On 6/15/2015 2:55 PM, Even Rouault wrote:
> Le lundi 15 juin 2015 20:18:02, Yi Dong a écrit :
>> Dear List,
>>
>> I have a question about recitify satellite images that has RPC camera
>> using gdalwarp. I know gdalwarp can be used for this task, with using
>> RPC metadata (either packed inside the NITF or stored inside RPB files)
>> Normally, the image folder shall contain following files
>> input.ntf
>> input.rpb
>> input.imd
>> etc...
>> The command I used for this is
>> gdalwarp -rpc input.ntf -to RPC_HEIGHT=200 rectified.tif
>>
>> Now I performed some geo-correction on the satellite image and generate
>> a corrected RPC model (with imporved offset values) and I store this
>> correct RPC camera in 'correct.rpb'. Now I am trying to use this
>> 'correct.rpb' to recitify the image
>> I tried
>> gdalwarp -rpc input.ntf correct.rpb -to RPC_HEIGHT=200
>> recitify_corrected.tif
>> but it failed with following error
>> ERROR 4: 'correct.rpb' not recognized as a supported file format
>>
>> Then I tried to overwrite the 'input.rpb' in the image folder with my
>> 'corrected.rpb', run 'gdalwarp -rpc input.ntf -to RPC_HEIGHT=200
>> rectified.tif' again but I got exactly same results as I used the
>> original RPC model. I guess that might be because gdalwarp used RPC
>> parameter that was packed inside NITF image itself, instead of getting
>> them from rpb files ?
>>
>> So Is there other way to use my corrected RPC model in gdal, like
>> gdalwarp, gdal_transform, etc.?
>> Also, gdaltransform doesn't not accept RPB files either. It only
>> recognizes GDAL dataset, i.e. vrt file. Therefore I need to generate
>> vrt file from my RPB. Is there any vrt example for RPC camera that I
>> can follow?
> Ian,
>
> I'd suggesting gdal_translate'ing your input.ntf into a VRT, and replace the
> values in the "VRT" metadata domain with your own values. Then you can run
> gdalwarp on this VRT file
>
> Even
>
More information about the gdal-dev
mailing list