Skip to content

Commit 121892c

Browse files
author
deseilligny
committed
Merge branch 'mpd'
2 parents 0e79501 + bc5b6fe commit 121892c

25 files changed

+837
-107
lines changed

MMVII/MMVII-UseCaseDataSet/Tests/Cmd-NewBlock.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,37 @@
22

33
set -e
44

5+
MMVII BlockInstrEdit BL0 FromScratch=1
56
MMVII BlockInstrEdit BL0 "PatsIm4Cam=[Im-Calib.xml,.*_(.*).tif]" # InMeasureClino=MesClinFilA_043
67
MMVII BlockInstrEdit BL0 InMeasureClino=MesClinFilA_043
78
MMVII BlockInstrEdit BL0 CRO=[[A1,A2,1e-6,i-kj]]
89
MMVII BlockInstrEdit BL0 CRO=[[B1,B2,1e-6,i-kj]]
910

1011

12+
# ---------------- 0 Block inside pannel ----------------------------
1113

14+
# --- 0.1 Initiale
1215
MMVII BlockInstrInitCam Im-Calib_OK_Resec.xml BL0 Pannel_BA2_311 BL1
1316

14-
17+
# --- 0.2 Adjust
1518
MMVII OriBundleAdj Im-Calib_OK_Resec.xml Pannel_BA2_311 Pannel_BA3_311 "GCP3D=[[Pannel,1]]" "GCP2D=[[Pannel,0.1,0.2,1,2]]" InInstrBlock=BL1 OutInstrBlock=BL2 BOI=[[,0.01,0.01,1],[]] NbIter=10
1619

1720

18-
#MMVII BlockInstrInitClino Im-Calib_OK_Resec.xml BL2 Pannel_BA3_311
21+
# ---------------- 1 Block on polyg ----------------------------
22+
23+
24+
MMVII OriBundleAdj Im-Clino_OK_Resec.xml BA_UC_Clino_311 BA2_Clino_RigPannel GCP3D=[[Polyg,1]] GCP2D=[[Polyg-Completed,0.1,0.5,5,2]] PPFzCal=.* InInstrBlock=BL2 OutInstrBlock=BL3 BOI=[[,0.001,0.001,1],[],[0.001,0.001]] NbIter=40
25+
26+
MMVII OriBundleAdj Im-Clino_OK_Resec.xml BA_UC_Clino_311 BA2_Clino_RigPolyg GCP3D=[[Polyg,1]] GCP2D=[[Polyg-Completed,0.1,0.5,5,2]] PPFzCal=.* InInstrBlock=BL2 OutInstrBlock=BL4 BOI=[[,0.001,0.001,1],[],] NbIter=40
27+
28+
29+
MMVII BlockInstrInitClino Im-Clino_OK_Resec.xml BL3 BA2_Clino_RigPannel MesClinPolyg_043 BL5
30+
31+
MMVII BlockInstrInitClino Im-Clino_OK_Resec.xml BL3 BA2_Clino_Rig MesClinPolyg_043 BL5
32+
33+
34+
#BRDirIn=BlockAdjust_${ImM} BRW=[5e-5,2e-5] OutRigBlock=BlocClino_${ImM}
35+
1936

2037

2138
#MMVII BlockInstrEdit BL2 InMeasureClino=MesClinFilA_043 OutInstrBlock=BL3

MMVII/include/MMVII_2Include_Serial_Tpl.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,19 @@ template <class Type> void AddData(const cAuxAr2007 & anAux, cDenseVect<Type>& a
365365
}
366366

367367
/// if we want a human readable vector for small vect ..
368-
template <class Type> void AddDataAsStdVect(const cAuxAr2007 & anAux,cDenseVect<Type>& aDenseV)
368+
template <class Type> void AddDataAsStdVect(const cAuxAr2007 & anAux0,cDenseVect<Type>& aDenseV)
369369
{
370+
cAuxAr2007 anAuxVect("StdVect",anAux0);
370371
std::vector<Type> aStdV;
371-
if (anAux.Input())
372+
if (anAux0.Input())
372373
{
373-
MMVII::AddData(anAux,aStdV);
374+
MMVII::AddData(anAuxVect,aStdV);
374375
aDenseV = cDenseVect<Type>(aStdV);
375376
}
376377
else
377378
{
378379
aStdV = aDenseV.ToStdVect();
379-
MMVII::AddData(anAux,aStdV);
380+
MMVII::AddData(anAuxVect,aStdV);
380381
}
381382
}
382383

MMVII/include/MMVII_InstrumentalBlock.h

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ class cIrbCal_CamSet : public cMemCheck
142142
std::vector<cIrbCal_Cam1> & VCams();
143143
cIrbCal_Cam1 & MasterCam();
144144

145+
void SetNumPoseInstr (const std::vector<int> & aVNums);
146+
// Correct -1 => master
147+
std::vector<int> NumPoseInstr() const;
145148
private :
146149
void AddCam
147150
(
@@ -152,6 +155,8 @@ class cIrbCal_CamSet : public cMemCheck
152155
);
153156

154157
int mNumMaster; //< num of "master" image
158+
// special case [] -> all [-1] master
159+
std::vector<int> mNumsPoseInstr;
155160
std::vector<cIrbCal_Cam1> mVCams; //< set of camerascIrbCal_Block
156161
cIrbCal_Block * mCalBlock;
157162
};
@@ -168,11 +173,18 @@ class cIrbCal_Clino1 : public cMemCheck
168173
cIrbCal_Clino1(const std::string & aName); //< "Real" constructor
169174
const std::string & Name() const; //< accessor
170175
void AddData(const cAuxAr2007 & anAux); //< serializer
176+
177+
void SetPNorm(const cPt3dr & aTr);
178+
179+
cP3dNormWithUK& CurPNorm();
180+
bool IsInit() const;
181+
void UnInit();
171182
private :
172-
std::string mName; //< name of the clino
173-
bool mIsInit; //< was values computed ?
174-
tRotR mOrientInBloc; //< Position in the block
175-
tREAL8 mSigmaR; //< sigma on orientation
183+
std::string mName; //< name of the clino
184+
bool mIsInit; //< was values computed ?
185+
cP3dNormWithUK * mTrInBlock; //< Position in the block
186+
std::vector<tREAL8> mPolCorr; //< Polynomial correction 2 angles, def [0,1,0]
187+
// tREAL8 mSigmaR; //< sigma a priori on orientation
176188
};
177189
void AddData(const cAuxAr2007 & anAux,cIrbCal_Clino1 & aClino);
178190

@@ -186,9 +198,14 @@ class cIrbCal_ClinoSet : public cMemCheck
186198
cIrbCal_ClinoSet();
187199
void AddData(const cAuxAr2007 & anAux);
188200
std::vector<std::string> VNames() const;
201+
size_t NbClino() const;
202+
203+
int IndexClinoFromName(const std::string& aName) const;
204+
cIrbCal_Clino1 & KthClino(int aK);
205+
189206
private :
190207
cIrbCal_Clino1 * ClinoFromName(const std::string& aName);
191-
void AddClino(const std::string &,bool SVP=false);
208+
void AddClino(const std::string &,tREAL8 aSigma,bool SVP=false);
192209

193210
std::vector<cIrbCal_Clino1> mVClinos; //< set of clinos
194211
cIrbCal_Block * mCalBlock;
@@ -212,6 +229,17 @@ class cIrb_CstrRelRot
212229

213230
void AddData(const cAuxAr2007 & anAux,cIrb_CstrRelRot & aSigma);
214231

232+
class cIrb_CstrOrthog
233+
{
234+
public :
235+
cIrb_CstrOrthog(const tREAL8 & aSigma);
236+
cIrb_CstrOrthog();
237+
void AddData(const cAuxAr2007 & anAux);
238+
private :
239+
tREAL8 mSigma;
240+
};
241+
void AddData(const cAuxAr2007 & anAux,cIrb_CstrOrthog & aSigma);
242+
215243

216244
/*
217245
class cIrb_ConstrInstr
@@ -302,7 +330,11 @@ class cIrbCal_Block : public cMemCheck
302330
void AvgIndivSigma(); //< Set all sigma of object ir global average
303331
void AvgSigma();
304332
cIrb_Desc1Intsr & AddSigma_Indiv(std::string aN1,eTyInstr aType1);
333+
305334
void AddCstrRelRot(std::string aN1,std::string aN2,tREAL8 aSigma,tRotR aRot);
335+
void AddCstrRelOrthog(std::string aN1,std::string aN2,tREAL8 aSigma);
336+
337+
const std::map<tNamePair,cIrb_CstrOrthog> & CstrOrthog() const;
306338

307339
private :
308340

@@ -318,9 +350,15 @@ class cIrbCal_Block : public cMemCheck
318350
cIrbCal_CamSet mSetCams; //< Cameras used in the bloc
319351
cIrbCal_ClinoSet mSetClinos; //< Clinos used in the bloc
320352

353+
// A priori external constraint
321354
std::map<tNamePair,cIrb_SigmaInstr> mSigmaPair; //< Sigmas between pair of instr
322355
std::map<std::string,cIrb_Desc1Intsr> mDescrIndiv; //< Sigmas of each instrument
356+
357+
// A priori external constraint
323358
std::map<tNamePair,cIrb_CstrRelRot> mCstrRelRot;
359+
std::map<tNamePair,cIrb_CstrOrthog> mCstrOrthog;
360+
361+
324362

325363
};
326364
void AddData(const cAuxAr2007 & anAux,cIrbCal_Block & aRBoI);
@@ -382,6 +420,7 @@ class cIrbComp_Clino1 : public cMemCheck
382420
{
383421
public :
384422
cIrbComp_Clino1(tREAL8 anAngle);
423+
tREAL8 Angle() const;
385424
private :
386425
tREAL8 mAngle;
387426
};
@@ -391,6 +430,8 @@ class cIrbComp_ClinoSet : public cMemCheck
391430
public :
392431
cIrbComp_ClinoSet();
393432
void SetClinoValues(const cOneMesureClino&);
433+
const cIrbComp_Clino1 & KthMeasure(int aK) const;
434+
size_t NbMeasure() const;
394435

395436
private :
396437
std::vector<cIrbComp_Clino1> mVCompClinos;
@@ -405,15 +446,19 @@ class cIrbComp_TimeS : public cMemCheck
405446
cIrbComp_TimeS (const cIrbComp_Block &);
406447
const cIrbComp_CamSet & SetCams() const; //< Accessor
407448
cIrbComp_CamSet & SetCams(); //< Accessor
449+
const cIrbComp_ClinoSet & SetClino() const;
408450

409451
const cIrbComp_Block & CompBlock() const; //< Accessor
410452
const cIrbCal_Block & CalBlock() const; //< Accessor or Accessor
411453
// cIrbComp_Block & CompBlock() ; //< Accessor
412454

413455
// if not SVP and cannot compute : error
414-
void ComputePoseInstrument(bool SVP = false);
456+
void ComputePoseInstrument(const std::vector<int> & aVNumCam,bool SVP = false);
415457
void SetClinoValues(const cOneMesureClino&);
416458

459+
tREAL8 ScoreDirClino(const cPt3dr& aDir,size_t aKClino) const;
460+
461+
417462
private :
418463
cIrbComp_TimeS(const cIrbComp_TimeS&) = delete;
419464
const cIrbComp_Block & mCompBlock;
@@ -468,6 +513,9 @@ class cIrbComp_Block : public cMemCheck
468513
void SetClinoValues(const cSetMeasureClino&,bool OkNewTimeS=false );
469514
/// call previous by using std measure on phproj
470515
void SetClinoValues(bool OkNewTimeS=false);
516+
517+
tREAL8 ScoreDirClino(const cPt3dr& aDir,size_t aKClino) const;
518+
471519
private :
472520
/// non copiable, too "dangerous"
473521
cIrbComp_Block(const cIrbComp_Block & ) = delete;

MMVII/include/MMVII_PCSens.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ class cPoseWithUK : public cObjWithUnkowns<tREAL8>
450450
*/
451451
void PushObs(std::vector<double> &,bool TransposeMatr);
452452

453-
cPoseWithUK(const tPoseR & aPose);
453+
cPoseWithUK(const tPoseR & aPose);
454454
void SetPose(const tPoseR & aPose);
455455

456456
// different accessor to the pose
@@ -467,24 +467,47 @@ class cPoseWithUK : public cObjWithUnkowns<tREAL8>
467467
tPoseR & Pose() ;
468468

469469
/// The interval is specified as the object can be used as helperto to other classes
470-
void PutUknowsInSetInterval(cSetInterUK_MultipeObj<tREAL8> * aSetInterv) ;
470+
void PutUknowsInSpecifiedSetInterval(cSetInterUK_MultipeObj<tREAL8> * aSetInterv) ;
471471
void OnUpdate() override; // "reaction" after linear update
472-
void FillGetAdrInfoParam(cGetAdrInfoParam<tREAL8> &) override;
472+
void FillGetAdrInfoParam(cGetAdrInfoParam<tREAL8> &) override;
473473
// std::vector<tPtrOUK> GetAllUK() override;
474474

475475
// Val axiator should have to "equal" fix rot
476476
cPt3dr ValAxiatorFixRot(const cRotation3D<tREAL8> & aRotFix) const;
477477

478478

479479
private :
480-
cPoseWithUK(const cPoseWithUK&) = delete;
480+
cPoseWithUK(const cPoseWithUK&) = delete;
481481
void PutUknowsInSetInterval() override ; // add the interval on udpate
482482

483483
tPoseR mPose; ///< transformation Cam to Word
484484
cPt3dr mOmega; ///< vector for tiny rotation when used in unknown, mW in code gene ...
485485
};
486486
void AddData(const cAuxAr2007 & anAux,cPoseWithUK & aPUK);
487487

488+
/// class for modelizing a normaliezd 3D-Vect when used as unknown in non linear system
489+
class cP3dNormWithUK : public cObjWithUnkowns<tREAL8>
490+
{
491+
public :
492+
cP3dNormWithUK(const cPt3dr &aPt,const std::string& aNameType,const std::string & aNameGrp);
493+
~cP3dNormWithUK();
494+
void OnUpdate() override; // "reaction" after linear update
495+
void FillGetAdrInfoParam(cGetAdrInfoParam<tREAL8> &) override;
496+
497+
void SetPNorm(const cPt3dr & aTr);
498+
cPt3dr GetPNorm () const;
499+
private :
500+
// normalize , compute U & V, set mDuDv to 0
501+
void Init();
502+
void PutUknowsInSetInterval() override ;
503+
504+
cPt3dr mPNorm; // curent value of PNorm
505+
cPt3dr mU; // first vector Orthog to mPNorm
506+
cPt3dr mV; // seconf vector Orthog to PNorm
507+
cPt2dr mDuDv; //
508+
509+
};
510+
488511

489512
/** Class for modelizing the geometry of perspective-central image, contain essentially a pose (Centre+rotation)
490513
* and a pointer to a (generally) shared internall calibration

MMVII/include/MMVII_Ptxd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ template <class Type> inline bool InfEq (const cPtxd<Type,4> & aP1,const cPtxd<
569569

570570

571571
template<class T,const int Dim> cPtxd<T,Dim> VUnit(const cPtxd<T,Dim> & aP);
572+
template <class TypePt> std::pair<TypePt,TypePt> OrthogonalizePair(const TypePt & aP1,const TypePt & aP2);
573+
572574
// template<const int Dim> cPtxd<tREAL8 ,Dim> VUnit(const cPtxd<tREAL8 ,Dim> & aP);
573575
// template<const int Dim> cPtxd<tREAL16,Dim> VUnit(const cPtxd<tREAL16,Dim> & aP);
574576

MMVII/include/MMVII_Stringifier.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ template <> const std::string cStrIO<eTopoObsType>::msNameType;
133133
template <> const std::string cStrIO<eTopoObsSetType>::msNameType;
134134
template <> const std::string cStrIO<eTopoStOriStat>::msNameType;
135135
template <> const std::string cStrIO<eTyClino>::msNameType;
136+
template <> const std::string cStrIO<eTyInstr>::msNameType;
137+
136138
#endif
137139

138140
/** These functions offer an"easy" interface to cStrIO, however I think

MMVII/include/MMVII_enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ enum class eTyUnitAngle
279279
eUA_radian,
280280
eUA_degree,
281281
eUA_gon,
282+
eUA_DMgon,
282283
eNbVals
283284
};
284285

MMVII/include/MMVII_nums.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ template <class Type> Type Average(const Type * aTab,size_t aNb);
1616
template <class Type> Type Average(const std::vector<Type> &);
1717

1818

19-
tREAL8 AngleInRad(eTyUnitAngle);
19+
tREAL8 AngleFromRad(eTyUnitAngle);
20+
tREAL8 AngleFromRad(tREAL8 aAngInRad,eTyUnitAngle);
21+
tREAL8 Rad2DMgon(tREAL8 aAngInRad);
22+
23+
2024
bool AssertRadAngleInOneRound(tREAL8 aAngleRad, bool makeError=true);
2125

2226
// some time needs a null val for any type with + (neutral for +)

MMVII/include/MMVII_util_tpl.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#include "MMVII_enums.h"
77
#include "MMVII_Error.h"
88
#include "MMVII_nums.h"
9+
#include "MMVII_Stringifier.h"
10+
911

1012
namespace MMVII
1113
{
@@ -268,7 +270,7 @@ template<class TCont,class TKey> const typename TCont::mapped_type * MapGet(co
268270
auto anIter = aCont.find(aKey);
269271
if (anIter==aCont.end())
270272
{
271-
MMVII_INTERNAL_ASSERT_tiny(SVP,"MapGet");
273+
MMVII_INTERNAL_ASSERT_tiny(SVP,"MapGet for Key="+ cStrIO<TKey>::ToStr(aKey));
272274
return nullptr;
273275
}
274276
return & anIter->second;
@@ -591,6 +593,22 @@ class cComputeAssociation
591593
};
592594
void AddData(const cAuxAr2007 & anAux,cComputeAssociation & aTransl);
593595

596+
597+
598+
template <class TypeCont> typename TypeCont::value_type SumElem(const TypeCont &aCont)
599+
{
600+
typename TypeCont::value_type aResult = cNV<typename TypeCont::value_type>::V0();
601+
for (const auto aVal : aCont)
602+
aResult += aVal;
603+
return aResult;
604+
}
605+
606+
template <class TypeCont> typename TypeCont::value_type AvgElem(const TypeCont &aCont)
607+
{
608+
MMVII_INTERNAL_ASSERT_tiny(!aCont.empty(),"AvgElem on empty vect");
609+
return SumElem(aCont) / double (aCont.size());
610+
}
611+
594612
};
595613

596614
#endif // _MMVII_Util_TPL_H_

0 commit comments

Comments
 (0)