Skip to content

Commit

Permalink
Clino : Calib Init, Read-Write : OK (4 now...)
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Mar 28, 2024
1 parent de3abca commit 7fb7e16
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 4 deletions.
5 changes: 5 additions & 0 deletions MMVII/include/MMVII_AllClassDeclare.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ class cBlocMatrixSensor;
class cDataBlocCam;
class cBlocOfCamera;

// Clino
class cOneCalibRelClino;
class cOneCalibClino;
class cCalibSetClino;

// sys co

class cSysCoordV2;
Expand Down
7 changes: 6 additions & 1 deletion MMVII/include/MMVII_Clino.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "MMVII_Geom3D.h"
#include "MMVII_PCSens.h"
#include "MMVII_memory.h"


namespace MMVII
Expand Down Expand Up @@ -33,6 +34,7 @@ class cOneCalibRelClino
tRotR mRot; ///< Value of relative rotation
private :
};
void AddData(const cAuxAr2007 & anAux,cOneCalibRelClino & aSet);

/** Calibrarion of 1 Clino : Orient to camera + optional relative calib */
class cOneCalibClino
Expand All @@ -43,9 +45,10 @@ class cOneCalibClino
tRotR mRot; ///< Value of rotation
std::optional<cOneCalibRelClino> mLinkRel; ///< Possible relative calib
};
void AddData(const cAuxAr2007 & anAux,cOneCalibClino & aSet);

/** Global calibration : name of the camera + vector of all individual calibs */
class cCalibSetClino
class cCalibSetClino : public cMemCheck
{
public :

Expand All @@ -56,6 +59,8 @@ class cCalibSetClino
/// Set of all clinometers calibration
std::vector<cOneCalibClino> mClinosCal ;
};
void AddData(const cAuxAr2007 & anAux,cCalibSetClino & aSet);




Expand Down
14 changes: 14 additions & 0 deletions MMVII/include/MMVII_Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,20 @@ class cPhotogrammetricProject
const cSysCoordV2 & SysCo() const ;
bool SysCoIsInit() const;
void AssertSysCoIsInit() const;

//===================================================================
//================== Clinometers ========================
//===================================================================

/// Standard name for clino file using DPClinoMeters, in or out
std::string NameFileClino(const std::string &aNameCam ,bool Input) const;
/// Save clinometer calib in santdard out folder of DPClinoMeters
void SaveClino(const cCalibSetClino &) const;
/// Is there clinometer in santdard input folder of DPClinoMeters ?
bool HasClinoCalib(const cPerspCamIntrCalib &) const;
/** Read the clinometers calib in standard input folder of DPClinoMeters, create a dyn objec because
* probably "cCalibSetClino" will evolve in a not copiable object*/
cCalibSetClino * GetClino(const cPerspCamIntrCalib &) const;

//===================================================================
//================== Rigid Bloc =========================
Expand Down
19 changes: 16 additions & 3 deletions MMVII/src/Instrumental/cClinoInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ cCollecSpecArg2007 & cAppli_ClinoInit::ArgOpt(cCollecSpecArg2007 & anArgOpt)
<< AOpt2007(mNbIter,"NbIter","Number of iteration",{eTA2007::HDV})
<< AOpt2007(mASim,"AmplSim","Amplitude of rotation is simul [W,P,K,BS]",{{eTA2007::ISizeV,"[5,5]"}})
<< AOpt2007(mNameRel12,"Rel12","orientation relative 2 to 1, if several clino",{eTA2007::HDV})
<< mPhProj.DPClinoMeters().ArgDirInOpt() // Just for temporart test we can re-read, to supress later
;
}

Expand Down Expand Up @@ -419,6 +420,7 @@ int cAppli_ClinoInit::Exe()
StdOut() << "ExeExe " << aVNamesClino << "\n";

std::string aNameCalibCam;
cPerspCamIntrCalib * aCalib = nullptr;
// put low level in a more structured data
for (size_t aKLine=0 ; aKLine<aNbMeasures ; aKLine++)
{
Expand Down Expand Up @@ -452,7 +454,8 @@ int cAppli_ClinoInit::Exe()
cSensorCamPC * aCam = mPhProj.ReadCamPC(aNameIm,true);
mVMeasures.push_back(cClinoCalMes1Cam(aCam,aRFS.VNums().at(aKLine)));

aNameCalibCam = aCam->InternalCalib()->Name();
aCalib = aCam->InternalCalib();
aNameCalibCam = aCalib->Name();

// We cannnot have multiple camera for now
if ((mCalibSetClino.mNameCam !="") && (mCalibSetClino.mNameCam != aNameCalibCam))
Expand Down Expand Up @@ -520,10 +523,20 @@ int cAppli_ClinoInit::Exe()
}

// Save the result in standard file
std::string aNameOut = mPhProj.DPClinoMeters().FullDirOut() + "ClinoCalib-" + aNameCalibCam + "."+ GlobTaggedNameDefSerial();
SaveInFile(mCalibSetClino,aNameOut);
mPhProj.SaveClino(mCalibSetClino);

if (mPhProj.DPClinoMeters().DirInIsInit())
{
cCalibSetClino* aClinoTest = mPhProj.GetClino(*aCalib);
SaveInFile(*aClinoTest,"TestReWriteClino.xml");

delete aClinoTest;

}
/*
std::string aNameOut = mPhProj.DPClinoMeters().FullDirOut() + "ClinoCalib-" + aNameCalibCam + "."+ GlobTaggedNameDefSerial();
SaveInFile(mCalibSetClino,aNameOut);
*/
return EXIT_SUCCESS;
}

Expand Down
31 changes: 31 additions & 0 deletions MMVII/src/Sensors/cPhotogrammetricProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "MMVII_2Include_Serial_Tpl.h"
#include "MMVII_BlocRig.h"
#include "MMVII_DeclareCste.h"
#include "MMVII_Clino.h"
#include "cExternalSensor.h"


Expand Down Expand Up @@ -965,6 +966,36 @@ void cPhotogrammetricProject::ReadHomol
std::string aName = NameTiePIn(aNameIm1,aNameIm2,aDirIn);
ReadFromFile(aSetHCI.SetH(),aName);
}
// ============= Clino meters =================

std::string cPhotogrammetricProject::NameFileClino(const std::string &aNameCam,bool Input) const
{
static const std::string TheClinoPrefix = "ClinoCalib-";
return mDPClinoMeters.FullDirInOut(Input) + TheClinoPrefix + aNameCam + "."+ GlobTaggedNameDefSerial();
}

void cPhotogrammetricProject::SaveClino(const cCalibSetClino & aCalib) const
{
SaveInFile(aCalib,NameFileClino(aCalib.mNameCam,false));
}

bool cPhotogrammetricProject::HasClinoCalib(const cPerspCamIntrCalib & aCalib) const
{
return ExistFile(NameFileClino(aCalib.Name(),true));
}


cCalibSetClino * cPhotogrammetricProject::GetClino(const cPerspCamIntrCalib & aCalib) const
{
return ObjectFromFile<cCalibSetClino,cCalibSetClino>(NameFileClino(aCalib.Name(),true));
}

/*
cCalibSetClino * GetClino(const cPerspCamIntrCalib &);
*/



// ============= Rigid bloc =================

// RIGIDBLOC
Expand Down

0 comments on commit 7fb7e16

Please sign in to comment.