Skip to content

Commit

Permalink
Update RPC example
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Jan 27, 2025
1 parent 1f1de2c commit 68b18a0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
12 changes: 6 additions & 6 deletions MMVII/MMVII-UseCaseDataSet/RPC/CmdRTL.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ set -e
# CREATE RTL SYSTEM / Orient Init in RTL / Ref Data in RTL
#=======================================================================================

# ------------ Parameter WGS84Degrees is redundant (but required for now with central perspective)
MMVII SysCoCreateRTL AllIm.xml WGS84Degrees RTL InOri=SPOT_Init Z0=0
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_INIT_RTL 0 TargetSysCo=RTL
MMVII TestSensor AllIm.xml SPOT_INIT_RTL TestCDI=true OutPointsMeasure=RefInit_RTL NbProc=1
MMVII SysCoCreateRTL AllIm.xml RTL InOri=SPOT_Init Z0=0
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_INIT_RTL 0
MMVII TestSensor AllIm.xml SPOT_INIT_RTL TestCDI=true OutObjCoordWorld=RefInit_RTL OutObjMesInstr=RefInit_RTL NbProc=1


#=======================================================================================
# IMPORT REFERENCE SENSOR test them and generate virtual GCP
#=======================================================================================
#

MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_Perturb_D2_RTL 2 RandomPerturb=0.003 TargetSysCo=RTL
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_Perturb_D2_RTL 2 RandomPerturb=0.003

MMVII TestSensor AllIm.xml SPOT_Perturb_D2_RTL TestCDI=true NbProc=1

MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D2_RTL Adj_SPOT_RTL_Deg2 GCPDir=RefInit_RTL GCPW=[0,1] NbIter=5
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D2_RTL Adj_SPOT_RTL_Deg2 GCP2D=[[RefInit_RTL,1]] GCP3D=[[RefInit_RTL,0]] NbIter=5


#=======================================================================================
Expand Down
25 changes: 13 additions & 12 deletions MMVII/MMVII-UseCaseDataSet/RPC/CmdWGS84.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e
# Import the data to check correctness of RPC implemantation
MMVII ImportM32 verif_1A.txt SjiXYZ XingWGS84 NumL0=13 NumLast=30 NameIm=SPOT_1A.tif
MMVII ImportM32 verif_1B.txt SjiXYZ XingWGS84 NumL0=13 NumLast=30 NameIm=SPOT_1B.tif
MMVII ImportM32 verif_1A.txt SjiXYZ XingWGS84 XingWGS84 NumL0=13 NumLast=30 NameIm=SPOT_1A.tif
MMVII ImportM32 verif_1B.txt SjiXYZ XingWGS84 XingWGS84 NumL0=13 NumLast=30 NameIm=SPOT_1B.tif

#=======================================================================================

Expand All @@ -19,32 +19,33 @@ MMVII ImportInitExtSens AllIm.xml '[SPOT_(.*).tif,RPC_$1.xml]' SPOT_Init
#
# Generate with 2 image and only "A"
#
MMVII TestSensor SPOT_1A.tif SPOT_Init ExtPatFile=0 TestCDI=true OutPointsMeasure=RefInit_A InPointsMeasure=XingWGS84
MMVII TestSensor AllIm.xml SPOT_Init TestCDI=true OutPointsMeasure=RefInit InPointsMeasure=XingWGS84 NbProc=1

MMVII TestSensor SPOT_1A.tif SPOT_Init ExtPatFile=0 TestCDI=true OutObjCoordWorld=RefInit_A OutObjMesInstr=RefInit_A InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84
MMVII TestSensor AllIm.xml SPOT_Init TestCDI=true OutObjCoordWorld=RefInit OutObjMesInstr=RefInit InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84 NbProc=1

#=======================================================================================
# GENERATE PERTUBATED SENSOR TEST OPTIMIZE TEST THEM AGAIN
#=======================================================================================

# ---------------------WITH DEGREE 0 ----------------------------------------------------
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_Perturb_D0 0 RandomPerturb=0.001
MMVII TestSensor AllIm.xml SPOT_Perturb_D0 TestCDI=true InPointsMeasure=XingWGS84 NbProc=1
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D0 Adj_SPOT_Deg0 GCPDir=RefInit GCPW=[0,1] NbIter=3
MMVII TestSensor AllIm.xml Adj_SPOT_Deg0 TestCDI=true InPointsMeasure=XingWGS84 NbProc=1
MMVII TestSensor AllIm.xml SPOT_Perturb_D0 TestCDI=true InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84 NbProc=1
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D0 Adj_SPOT_Deg0 GCP2D=[[RefInit,1]] GCP3D=[[RefInit,0]] NbIter=3
MMVII TestSensor AllIm.xml Adj_SPOT_Deg0 TestCDI=true InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84 NbProc=1

# ---------------------WITH DEGREE 2 ----------------------------------------------------
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_Perturb_D2 2 RandomPerturb=0.003
MMVII TestSensor AllIm.xml SPOT_Perturb_D2 TestCDI=true InPointsMeasure=XingWGS84 NbProc=1
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D2 Adj_SPOT_Deg2 GCPDir=RefInit GCPW=[0,1] NbIter=3
MMVII TestSensor AllIm.xml Adj_SPOT_Deg2 TestCDI=true InPointsMeasure=XingWGS84 NbProc=1
MMVII TestSensor AllIm.xml SPOT_Perturb_D2 TestCDI=true InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84 NbProc=1
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D2 Adj_SPOT_Deg2 GCP2D=[[RefInit,1]] GCP3D=[[RefInit,0]] NbIter=3
MMVII TestSensor AllIm.xml Adj_SPOT_Deg2 TestCDI=true InObjCoordWorld=XingWGS84 InObjMesInstr=XingWGS84 NbProc=1

#---------------------- WITH DEGREE 0 + TieP -----------------------------------------------

#------------------- [1] Perfect data just to check TieP -------------------------------------------
MMVII OriParametrizeSensor AllIm.xml SPOT_Init SPOT_D0 0
MMVII OriBundleAdj AllIm.xml SPOT_D0 Test GCPDir=RefInit GCPW=[0,1] TPDir=V1 TiePWeight=[1] NbIter=1
MMVII OriBundleAdj AllIm.xml SPOT_D0 Test GCP2D=[[RefInit,1]] GCP3D=[[RefInit,0]] TPDir=V1 TiePWeight=[1] NbIter=1

MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D0 Test GCPDir=RefInit GCPW=[0,1] TPDir=V1 TiePWeight=[1] NbIter=5
MMVII OriBundleAdj AllIm.xml SPOT_Perturb_D0 Test GCP2D=[[RefInit,1]] GCP3D=[[RefInit,0]] TPDir=V1 TiePWeight=[1] NbIter=5



Expand Down
4 changes: 2 additions & 2 deletions MMVII/src/BundleAdjustment/cAppliBundAdj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ std::vector<tREAL8> cAppliBundlAdj::ConvParamStandard(const std::vector<std::st
{
if ((aVParStd.size() <aSzMin) || (aVParStd.size() >aSzMax))
{
MMVII_UnclasseUsEr("Bad size of AddOneSetGCP, exp in ["+ToStr(aSzMin)+","+ToStr(aSzMax)+"] got : " + ToStr(aVParStd.size()));
MMVII_UnclasseUsEr("Bad size of AddOneSetGCP/TieP, exp in ["+ToStr(aSzMin)+","+ToStr(aSzMax)+"] got : " + ToStr(aVParStd.size()));
}
mMeasureAdded = true; // to avoid message corresponding to trivial error

Expand Down Expand Up @@ -208,7 +208,7 @@ void cAppliBundlAdj::AddOneSetGCP2D(const std::vector<std::string> & aVParStd)
void cAppliBundlAdj::AddOneSetTieP(const std::vector<std::string> & aVParStd)
{
std::string aFolder = aVParStd.at(0); // folder
std::vector<tREAL8> aTiePW = ConvParamStandard(aVParStd,3,6);
std::vector<tREAL8> aTiePW = ConvParamStandard(aVParStd,2,5);
cStdWeighterResidual aWeighter(aTiePW,0);
mBA.AddMTieP(aFolder,AllocStdFromMTPFromFolder(aFolder,VectMainSet(0),mPhProj,false,true,false),aWeighter);
}
Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/ImportFormat/ImportMes32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int cAppli_ImportM32::Exe()
}

// save object
mPhProj.SaveGCP3D(aSetGCP);
mPhProj.SaveGCP3D(aSetGCP,mPhProj.DPGndPt3D().FullDirOut());
mPhProj.SaveMeasureIm(aSetIm);

if (mPhProj.SysCoIsInit())
Expand Down

0 comments on commit 68b18a0

Please sign in to comment.