Commit 93a53921 authored by Victor Poughon's avatar Victor Poughon

Merge branch 'patch_locS1' into 'develop'

Patch for S1 localization problems

Closes #1861

See merge request orfeotoolbox/otb!450
parents 35e5fb6b 3d1d11a1
Pipeline #1222 passed with stages
in 5 minutes and 33 seconds
......@@ -188,6 +188,16 @@ RAPIDEYE/level1B/2008-12-25T005918_RE3_1B-NAC_397971_12345_band3.ntf
SENTINEL1/S1A_S6_SLC__1SSV_20150619T195043/measurement/s1a-s6-slc-vv-20150619t195043-20150619t195101-006447-00887d-001.tiff
)
set(TOLERANCE_RATIO
0
0
0
0
0
0
0.0002
)
set(IMG_TYPE
"pleiades-1"
"wv2-1"
......@@ -303,6 +313,8 @@ foreach(current_img ${IMG_TEST_ORTHO})
list(GET RESOL ${IMGNB} current_resol )
list(GET GRIDSPACING ${IMGNB} current_grid_spacing)
list(GET ISCOMPLEX ${IMGNB} current_is_compex)
list(GET TOLERANCE_RATIO ${IMGNB} current_tolerance_ratio)
math(EXPR IMGNB "${IMGNB} + 1")
set( MODENB 0)
......@@ -313,6 +325,7 @@ foreach(current_img ${IMG_TEST_ORTHO})
otb_add_test(NAME prTvOrthoRectification_${current_imgtype}_${current_mode} COMMAND otbProjectionTestDriver
--compare-image ${EPSILON_4} ${BASELINE}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif
${TEMP}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif
--tolerance-ratio ${current_tolerance_ratio}
otbOrthoRectificationFilter
LARGEINPUT{${current_img}?&geom=${INPUTDATA}/${current_geomgcp}.geom}
${TEMP}/prTvOrthoRectification_${current_imgtype}_${current_mode}.tif
......
......@@ -1058,29 +1058,39 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
theAzimuthTimeOffset = count > 0 ? cumulAzimuthTime / count : DurationType(0);
// Then, fix the range time
count=0;
// Patch_locS1 : do not fix the range time
// This fix takes GCPs as inputs to calculate an offset in range dimension.
// However for recent S1 products (after March 2017 with IPF >= 2.82), GCPs contain wrong values
// for lat/lon coordinates => the range time offset is wrong and shift the localization.
// To avoid wrong offset, fixRangeTimeWithGCPs is always set to false
bool fixRangeTimeWithGCPs = false;
if (fixRangeTimeWithGCPs)
{
// Then, fix the range time
count=0;
for(std::vector<GCPRecordType>::const_iterator gcpIt = theGCPRecords.begin(); gcpIt!=theGCPRecords.end();++gcpIt)
{
ossimDpt estimatedImPt;
TimeType estimatedAzimuthTime;
double estimatedRangeTime;
for(std::vector<GCPRecordType>::const_iterator gcpIt = theGCPRecords.begin(); gcpIt!=theGCPRecords.end();++gcpIt)
{
ossimDpt estimatedImPt;
TimeType estimatedAzimuthTime;
double estimatedRangeTime;
ossimEcefPoint sensorPos;
ossimEcefVector sensorVel;
ossimEcefPoint sensorPos;
ossimEcefVector sensorVel;
// Estimate times
const bool s1 = this->worldToAzimuthRangeTime(gcpIt->worldPt,estimatedAzimuthTime,estimatedRangeTime, sensorPos, sensorVel);
// Estimate times
const bool s1 = this->worldToAzimuthRangeTime(gcpIt->worldPt,estimatedAzimuthTime,estimatedRangeTime, sensorPos, sensorVel);
if(s1)
{
cumulRangeTime+=-estimatedRangeTime+gcpIt->slantRangeTime;
++count;
}
}
if(s1)
{
cumulRangeTime+=-estimatedRangeTime+gcpIt->slantRangeTime;
++count;
}
}
theRangeTimeOffset = count > 0 ? cumulRangeTime/count : 0;
theRangeTimeOffset = count > 0 ? cumulRangeTime/count : 0;
}
}
void get(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment