Skip to content

Commit 42e4fde

Browse files
author
deseilligny
committed
Merge branch 'mpd'
2 parents 19fd35c + 39ddb38 commit 42e4fde

File tree

5 files changed

+32
-7
lines changed

5 files changed

+32
-7
lines changed

MMVII/src/BundleAdjustment/BundleAdjustment.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,16 @@ class cMMVII_BundleAdj
454454
void SetSharedIntrinsicParams(const std::vector<std::string> &);
455455

456456

457-
void AddPoseViscosity();
458-
void AddConstrainteRefPose();
457+
void AddPoseViscosity();
458+
void AddConstrainteRefPose();
459459
void AddConstrainteRefPose(cSensorCamPC & aCam,cSensorCamPC & aCamRef);
460460

461461

462-
void AddLineAdjust(const std::vector<std::string> &);
462+
void AddLineAdjust(const std::vector<std::string> &);
463+
void DeleteLineAdjust();
464+
void IterAdjustOnLine();
463465

464-
void SaveBlocRigid();
466+
void SaveBlocRigid();
465467
void Save_newGCP3D();
466468
void SaveTopo();
467469

@@ -477,7 +479,6 @@ class cMMVII_BundleAdj
477479

478480
cSetInterUK_MultipeObj<tREAL8> & SetIntervUK();
479481
private :
480-
void DeleteLineAdjust();
481482

482483
//============== Methods =============================
483484
cMMVII_BundleAdj(const cMMVII_BundleAdj &) = delete;

MMVII/src/BundleAdjustment/BundleLines.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ cOneData_L23::cOneData_L23(cSensorCamPC * aCam,const tSeg2dr & aSeg,int aKIm) :
106106
mSeg (aSeg),
107107
mPlane (mCam->SegImage2Ground(mSeg)),
108108
mKIm (aKIm),
109-
mLineM (nullptr)
109+
mLineM (nullptr),
110+
mCalcEqSeg (nullptr)
110111
{
111112
}
112113

@@ -317,6 +318,7 @@ void cUK_Line3D_4BA::AddOneEquation(tREAL8 aLambda,tREAL8 aWeight,const cOneData
317318
cPt2dr aTgtL2 = aLDM->TgSpace(aPImOnL2).at(0);
318319
cPt2dr aNormL2 = Rot90(aTgtL2);
319320

321+
//StdOut() << " PIMG=" << aPImPG << " PL=" << aPImOnL2 << "\n";
320322

321323
// std::vector<std::string> aVecLIne2D = Append(NamesP2("Line2D_Pt"),NamesP2("Line2D_Norm"));
322324
aPImOnL2.PushInStdVector(aVObs);
@@ -352,6 +354,7 @@ void cUK_Line3D_4BA::AddOneEquation(tREAL8 aLambda,tREAL8 aWeight,const cOneData
352354
}
353355
}
354356

357+
355358
mBA->Sys()->R_CalcAndAddObs(aData.SetAndGet_CalcEqSeg(),aVIndexes,aVObs,aWeight);
356359
}
357360

@@ -367,6 +370,12 @@ void cUK_Line3D_4BA::AddEquation()
367370
}
368371
}
369372

373+
/* *********************************************************** */
374+
/* */
375+
/* cMMVII_BundleAdj */
376+
/* */
377+
/* *********************************************************** */
378+
370379
void cMMVII_BundleAdj::AddLineAdjust(const std::vector<std::string> & aVParam)
371380
{
372381
tREAL8 aSigmaIm = cStrIO<double>::FromStr(aVParam.at(0));
@@ -376,6 +385,11 @@ void cMMVII_BundleAdj::AddLineAdjust(const std::vector<std::string> & aVParam)
376385
mSetIntervUK.AddOneObj(mLineAdjust);
377386
}
378387

388+
void cMMVII_BundleAdj::IterAdjustOnLine()
389+
{
390+
if (mLineAdjust)
391+
mLineAdjust->AddEquation();
392+
}
379393

380394

381395
// cUK_Line3D_4BA::cUK_Line3D_4BA(const std::vector<cSensorCamPC *> & aVCam,cPhotogrammetricProject * aPhProj,cMMVII_BundleAdj * aBA) :

MMVII/src/BundleAdjustment/cAppliBundAdj.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class cAppliBundlAdj : public cMMVII_Appli
101101
bool mShow_Cond; ///< compute and show system condition number
102102
std::vector<std::string> mParamShow_UK_UC;
103103
std::string mPostFixReport;
104+
std::vector<std::string> mParamLine;
104105
};
105106

106107
cAppliBundlAdj::cAppliBundlAdj(const std::vector<std::string> & aVArgs,const cSpecMMVII_Appli & aSpec) :
@@ -164,6 +165,7 @@ cCollecSpecArg2007 & cAppliBundlAdj::ArgOpt(cCollecSpecArg2007 & anArgOpt)
164165
<< AOpt2007(mShow_Cond,"Cond","Compute and show system condition number")
165166
<< AOpt2007(mParamShow_UK_UC,"UC_UK","Param for uncertainty & Show names of unknowns (tuning)")
166167
<< AOpt2007(mPostFixReport,NameParamPostFixReport(),CommentParamPostFixReport())
168+
<< AOpt2007(mParamLine,"AdjLine3D","Parameter for line Adjustment [SigmaIm,NbPtsSampl]",{{eTA2007::ISizeV,"[2,2]"}})
167169
;
168170
}
169171

@@ -324,6 +326,10 @@ int cAppliBundlAdj::Exe()
324326
mBA.AddCamBlocRig(aNameIm);
325327
}
326328

329+
if (IsInit(&mParamLine))
330+
{
331+
mBA.AddLineAdjust(mParamLine);
332+
}
327333

328334
if (mPhProj.DPClinoMeters().DirInIsInit())
329335
{

MMVII/src/BundleAdjustment/cMMVII_BundleAdj.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ void cMMVII_BundleAdj::OneIteration(tREAL8 aLVM,bool isLastIter, bool doShowCond
388388
for (const auto & aLidarPh : mVBA_Lidar )
389389
aLidarPh->AddObs();
390390

391+
// Add observation for line adjustment
392+
IterAdjustOnLine();
393+
391394
if (mCompute_Uncert && isLastIter)
392395
{
393396
// StdOut() << "mCompute_UncertmCompute_UncertmCompute_Uncert--------------------------------\n";

MMVII/src/OrientReport/BlocReport.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ void cAppli_ReportBlock::AddStatDistWirePt
264264

265265
mStatWirePt[aNamePt].mStat3d.Add(Norm2(anEc));
266266

267-
AddOneReportCSV(mIdRepDWirePt,{aNamePt,ToStr(aD3),ToStr(aDH),ToStr(aDV)});
267+
// InitReportCSV(mIdRepDWirePt,"csv",false,{"TimeStamp","NamePt","D3","DH","DV"});
268+
AddOneReportCSV(mIdRepDWirePt,{anIdSync,aNamePt,ToStr(aD3),ToStr(aDH),ToStr(aDV)});
268269
}
269270

270271
cPt2dr cAppli_ReportBlock::CorrMesPt(cSensorCamPC * aCam,const cPt2dr & aPt)

0 commit comments

Comments
 (0)