Tips and Tutorials \ Generate an ortho-image (PNEO)
This tutorials explains how to generate an ortho-image with the example of PNEO data
Type: Tip
Overview
This tutorial shows how to generate ortho-images from PNEO data but it can be applied to other sensors.
Pre-requisites
This tutorial uses command lines from the OTB.
Commands
Command list :
1 - Get incidence angles (this command is to be launched in every folder, because we will work in the folder where the value in minimal)
grep INCIDENCE_ANGLE *DIM*PAN*
2 - Pansharpening
otbcli_BundleToPerfectSensor -inp <path>/<pan.[tif|jp2]> -inxs <path>/<[rgb|ned].[tif|jp2]> -out <pxs.tif>
2bis (opt) - Refine sensor model
otbcli_HomologousPointsExtraction -in1 <pxs>.tif -in2 <ortho_ref>.tif -mode geobins -elev.dem /work/datalake/static_aux/MNT/SRTM_30_hgt -algorithm sift -out homologous.txt -outvector homologous.shp
otbcli_RefineSensorModel -ingeom <input>.geom -outgeom <output>.geom -elev.dem /work/datalake/static_aux/MNT/SRTM_30_hgt -inpoints homologous.txt -outstat <stats>.txt -outvector <refined>.shp -map epsg -map.epsg.code 32631
3 - Ortho-rectification
otbcli_OrthoRectification -io.in <path>/<pan+XS.tif> -io.out <ortho.tif> uint16 [-elev.dem <MNT.tif>]
Details
Image selection
In case you are working with stereo or tri-stereo acquisition, you have more than 1 image for the same scene. In order to select which acquisition is to be used to generate the ortho-image, we look at the incidence angle for each image (here the panchromatic one), then we will work with the acquisition where the incidence angle is minimal (i.e the closest to a nadir shot).
In every folder, run the following command to read the incidence angle in the DIMAP file :
grep INCIDENCE_ANGLE\ u *DIM*PAN*
Pansharpening
Pleiades-Neo provides XS images in 2 different files :
IMG_PNEO*MS-FS*RGB*.JP2
: the first containing RGB bandsIMG_PNEO*MS-FS*NED*.JP2
: the second containing near infrared, red-edge and deep-blue bands
We can therefore apply pansharpening method from the OTB (XS + PAN fusion) for each image :
ml otb
otbcli_BundleToPerfectSensor -inp <path>/<pan.[tif|jp2]> -inxs <path>/<[rgb|ned].[tif|jp2]> -out <pxs.tif>
Refine sensor model (optionnal)
In order to improve the localization of the ortho-image, we can refine the sensor model. To do so, we have to compute homologous points between P+XS and a reference ortho-image :
otbcli_HomologousPointsExtraction -in1 <pxs>.tif -in2 <ortho_ref>.tif -mode geobins -elev.dem /work/datalake/static_aux/MNT/SRTM_30_hgt -algorithm sift -out homologous.txt -outvector homologous.shp
Then the model can be refined :
otbcli_RefineSensorModel -ingeom <input>.geom -outgeom <output>.geom -elev.dem /work/datalake/static_aux/MNT/SRTM_30_hgt -inpoints homologous.txt -outstat <stats>.txt -outvector <refined>.shp -map epsg -map.epsg.code 32631
If you do not have a <input>.geom
file, you can use the following command to generate it :
otbcli_ReadImageInfo -in <DIMAP_PAN>.xml -outkwl <input>.geom
Ortho-rectification
In case you have a DEM for the targeted area you can execute the following command :
otbcli_OrthoRectification -io.in <path>/<pan+XS.tif> -io.out <ortho.tif> uint16 -elev.dem /work/datalake/static_aux/MNT/SRTM_30_hgt
otbcli_OrthoRectification -io.in <path>/<pan+XS.tif> -io.out <ortho.tif> uint16
Tips inside the tip !
-
If you have a DEM with a higher resolution than SRTM (DEM Pleiades, DEM Pleiades-Neo, etc.) for the observed area, it is better to use it during orthorectification.
-
In order to perform the refinement of the sensor model, reference ortho-images can be found on the IGN website, which provides open-access to the BD Ortho.
Troubleshooting
-
During the refinement of the sensor model, in the homologous points extraction step, make sure the compared bands are the same (Red with Red for example). Otherwise, it is necessary to map bands with the OTB commandline (by default, the command compares band 1 of each image).
-
You can sometimes observe a localization error with P-Neo images during orthorectification. You can use an external VT (OSM, etc.) to check if this bias appears or not.
References
Contacts
Questions ? Get help on the Forum