Skip to content

Commit

Permalink
Merge branch 'mpd'
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Dec 11, 2024
2 parents 2d71073 + 827315c commit 14b3dca
Show file tree
Hide file tree
Showing 19 changed files with 218 additions and 75 deletions.
9 changes: 9 additions & 0 deletions MMVII/Doc/Doc2007.tex
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,21 @@
\newcommand{\UNCLEAR}{}
\newcommand{\ISITCLEAR}{}
\newcommand{\PPP}{MMVII}

\newcommand{\MmVii}
{
\ensuremath{ \mbox{
{\bf $\mathcal{M}$}\hspace{-0.15em}\raisebox{-0.4ex}{$m$}\hspace{-0.3em}\raisebox{0.3ex}{$V$}\raisebox{-0.4ex}{$2$}
}}}

\newcommand{\CdPPP}{{\tt MMVII}}
\newcommand{\MMVIDIR}{{\tt MMVII-MainFolder/}}
\newcommand{\doxy}{\emph{doxygen}}
\newcommand{\MMNONE}{NONE}

%\includeonly{Methods/PoseGlobInit}
%\includeonly{Programmer/Interpolators}
\includeonly{Methods/LidarImageRegistration}

%---------------------------------------------
\begin{document}
Expand Down Expand Up @@ -196,6 +204,7 @@ \part{Methodologies}
\include{Methods/PushBroomSensor-Theory}
\include{Methods/PoseEstimation}
\include{Methods/PoseGlobInit}
\include{Methods/LidarImageRegistration}
\include{Methods/CodedTarget-Theory}
\include{Methods/Line-Detection-Theory}
\include{Methods/AimeDesc}
Expand Down
2 changes: 2 additions & 0 deletions MMVII/Doc/Programmer/Interpolators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,8 @@ \subsubsection{{\tt GetValueInterpol}}

\subsubsection{{\tt GetValueAndGradInterpol}}

\label{Method:GetValueAndGradInterpol}

{\tt std::pair<tREAL8,cPt2dr> GetValueAndGradInterpol(const cDiffInterpolator1D \&,const cPt2dr \& aP) const ;}

The method is similar to {\tt GetValueInterpol}, but instead of returning only the values, it
Expand Down
2 changes: 2 additions & 0 deletions MMVII/Doc/Programmer/NonLinearOptim.tex
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ \subsection{Motivation}

\subsection{class for specifying the formulas}

\label{Class:Specif:Formulas}

In this example, we have only one formula we need to compute and derivate, it's
the formula of equation~\ref{EqConsDist}. First introduce a bit of MMVII's jargon :

Expand Down
2 changes: 2 additions & 0 deletions MMVII/include/MMVII_Clino.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ class cSetMeasureClino

void SetNames(const std::vector<std::string> &);

void FilterByPatIdent(const std::string& aPat);

private :
std::vector<std::string> mNamesClino;
std::string mPatMatch;
Expand Down
3 changes: 3 additions & 0 deletions MMVII/include/MMVII_MeasuresIm.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ class cSetMesGCP : public cMemCheck
const std::vector<cMes1GCP> & Measures() const; ///< Accessor
static const std::string ThePrefixFiles;

std::list<std::string> ListOfNames() const;

private :
std::string mNameSet;
std::vector<cMes1GCP> mMeasures;
Expand Down Expand Up @@ -258,6 +260,7 @@ class cSetMesImGCP : public cMemCheck
cMes1GCP & MesGCPOfName(const std::string &) ;
const cMes1GCP & MesGCPOfNum(int) const;
const cMes1GCP & MesGCPOfMulIm(const cMultipleImPt &) const;
cSetMesGCP AllMesGCP() const;

bool NameIsGCP(const std::string &) const;
cSetMesGCP ExtractSetGCP(const std::string & aNameSet) const;
Expand Down
6 changes: 4 additions & 2 deletions MMVII/include/MMVII_Sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ class cPhotogrammetricProject
void LoadIm(cSetMesImGCP&,cSensorImage & ) const;

void SaveGCP(const cSetMesGCP&) const;
cSetMesGCP LoadGCPFromFolder(const std::string &) const;
cSetMesGCP LoadGCP() const;

/// Name of the file, usefull if we need to test existence before doing anything
std::string NameMeasureGCPIm(const std::string & aNameIm,bool isIn) const;
Expand Down Expand Up @@ -712,8 +714,8 @@ class cPhotogrammetricProject
/// Standard name for file of measures clino
std::string NameFileMeasuresClino(bool Input,const std::string & aNameFile="" ) const;
void SaveMeasureClino(const cSetMeasureClino &) const;
void ReadMeasureClino(cSetMeasureClino &) const;
cSetMeasureClino ReadMeasureClino() const;
void ReadMeasureClino(cSetMeasureClino &,const std::string * aPatSel=nullptr) const;
cSetMeasureClino ReadMeasureClino(const std::string * aPatSel=nullptr) const;

//===================================================================
//================== Rigid Bloc =========================
Expand Down
1 change: 0 additions & 1 deletion MMVII/src/Appli/cMMVII_Appli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,6 @@ void cMMVII_Appli::LogCommandOut(const std::string & aName,bool MainLogFile)
// Add id, if several process were throw in // there is a mix and we no longer know which was closed
aOfs.Ofs() << " ending correctly at : " << StrDateCur()
<< " Time=" << SecFromT0() - TimeSegm().CurBeginTime()
<< " TTT=" << SecFromT0()
<< " (Id=" << mPrefixNameAppli << ")\n\n";
aOfs.Ofs().close();
}
Expand Down
2 changes: 1 addition & 1 deletion MMVII/src/BundleAdjustment/Bundle_Clino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,4 @@ namespace MMVII
return aVRotR;
}

}
}
7 changes: 5 additions & 2 deletions MMVII/src/CodedTarget/CodedTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ class cParamCodedTarget : public cMemCheck
/// fix number of pixel 4 draw
void SetNbPixBin(int aNbPixBin);

/// Set default value that depend from the type , used only in create target
void FinishInitOfSpec(const cSpecBitEncoding & aSpec);
/** Set default value that depend from the type , used only in create target,
createInit : in mode read we dont do def init (would overwrite user's modif) */
void FinishInitOfSpec(const cSpecBitEncoding & aSpec,bool createInit);


int NbCodeAvalaible() const; // Number of different code we can generate
Expand Down Expand Up @@ -449,6 +450,8 @@ class cFullSpecifTarget : public cMemCheck
cParamRenderingTarget mRender;
std::vector<cPt2dr> mBitsCenters;
};
void AddData(const cAuxAr2007 & anAux,cFullSpecifTarget & aSpecif);


/** Helper class for computing an encoding from the colours affected to different bits */
class cDecodeFromCoulBits
Expand Down
44 changes: 27 additions & 17 deletions MMVII/src/CodedTarget/cCircTargetExtract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ class cAppliExtractCircTarget : public cMMVII_Appli,
int mZoomVisuLabel;
int mZoomVisuSeed;
int mZoomVisuElFinal;
bool mShowOnlyMul;
cExtract_BW_Ellipse * mExtrEll;
cParamBWTarget mPBWT;

Expand Down Expand Up @@ -790,6 +791,7 @@ cAppliExtractCircTarget::cAppliExtractCircTarget
mZoomVisuLabel (0),
mZoomVisuSeed (0),
mZoomVisuElFinal (0),
mShowOnlyMul (false),
mExtrEll (nullptr),
mImMarq (cPt2di(1,1)),
mPhProj (*this),
Expand Down Expand Up @@ -827,6 +829,7 @@ cCollecSpecArg2007 & cAppliExtractCircTarget::ArgOpt(cCollecSpecArg2007 & anArgO
<< AOpt2007(mZoomVisuLabel,"ZoomVisuLabel","Make a visualisation of labeled image",{eTA2007::HDV})
<< AOpt2007(mZoomVisuSeed,"ZoomVisuSeed","Make a visualisation of seed point",{eTA2007::HDV})
<< AOpt2007(mZoomVisuElFinal,"ZoomVisuEllipse","Make a visualisation extracted ellispe & target",{eTA2007::HDV})
<< AOpt2007(mShowOnlyMul,"ShowOnlyMul","Show Only Mutlipe detectection",{eTA2007::HDV})
<< AOpt2007(mPatHihlight,"PatHL","Pattern for highliting targets in visu",{eTA2007::HDV})

<< AOpt2007(mNbMaxMT_Init,"NbMMT0","Nb max of multiple target acceptable initial (for 0 image)",{eTA2007::HDV})
Expand Down Expand Up @@ -894,13 +897,16 @@ void cAppliExtractCircTarget::MakeImageFinalEllispe()
cPt2dr aSz(50,50);
cPt3dr aAlpha(0.7,0.7,0.7);

// In the case of simulation we know the ground truch
if (mUseSimul)
{
// show the missed target
for (const auto & aGT : mGTMissed)
{
if (aGT->mResExtr ==nullptr)
aImVisu.FillRectangle(cRGBImage::Red,ToI(aGT->mC-aSz),ToI(aGT->mC+aSz),aAlpha);
}
// show the wrong detection
for (const auto & anEE : mVCTE)
{
if ((anEE->mWithCode) && (anEE->mGT ==nullptr))
Expand All @@ -912,28 +918,32 @@ void cAppliExtractCircTarget::MakeImageFinalEllispe()

for (const auto & anEE : mVCTE)
{
const cEllipse & anEl = anEE->mEllipse;
bool doHL = MatchRegex(anEE->mEncode.Name(),mPatHihlight);
for (tREAL8 aMul = 1.0; aMul < (doHL ? 4.0 : 2.5); aMul += (doHL ? 0.05 : 0.4))
{
aImVisu.DrawEllipse
(
(anEE->mCardDetect==1) ? cRGBImage::Green : cRGBImage::Red , // anEE.mWithCode ? cRGBImage::Blue : cRGBImage::Red,
anEl.Center(),
anEl.LGa()*aMul , anEl.LSa()*aMul , anEl.TetaGa()
);
}
if ((!mShowOnlyMul) || (anEE->mCardDetect!=1))
{
const cEllipse & anEl = anEE->mEllipse;
bool doHL = MatchRegex(anEE->mEncode.Name(),mPatHihlight);
for (tREAL8 aMul = 1.0; aMul < (doHL ? 4.0 : 2.5); aMul += (doHL ? 0.05 : 0.4))
{
aImVisu.DrawEllipse
(
(anEE->mCardDetect==1) ? cRGBImage::Green : cRGBImage::Red ,
anEl.Center(),
anEl.LGa()*aMul , anEl.LSa()*aMul , anEl.TetaGa()
);

}
//BF
if (anEE->mWithCode)
{
aImVisu.DrawString
(
if (anEE->mWithCode)
{
aImVisu.DrawString
(
anEE->mEncode.Name(),cRGBImage::Red,
anEl.Center(),cPt2dr(0.5,0.5),
3
);
);

}
}
}
}

aImVisu.ToJpgFileDeZoom(mPhProj.DirVisuAppli()+mPrefixOut + "_Ellipses.tif",mZoomVisuElFinal);
Expand Down
28 changes: 28 additions & 0 deletions MMVII/src/CodedTarget/cGenerateEncoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "CodedTarget.h"
#include "MMVII_Stringifier.h"
#include "MMVII_MeasuresIm.h"
#include "MMVII_Sensor.h"


namespace MMVII
{
Expand Down Expand Up @@ -215,6 +217,8 @@ class cAppliGenerateEncoding : public cMMVII_Appli
cCollecSpecArg2007 & ArgOpt(cCollecSpecArg2007 & anArgOpt) override ;

cPrioCC * GetBest();
cPhotogrammetricProject mPhProj;


// tREAL8 ScoreOfCodeAndDist(,int aHamingDist);

Expand All @@ -241,6 +245,7 @@ cAppliGenerateEncoding::cAppliGenerateEncoding
const cSpecMMVII_Appli & aSpec
) :
cMMVII_Appli (aVArgs,aSpec),
mPhProj (*this),
mMiror (false),
mCEC (nullptr)
{
Expand Down Expand Up @@ -271,6 +276,7 @@ cCollecSpecArg2007 & cAppliGenerateEncoding::ArgOpt(cCollecSpecArg2007 & anArgOp
<< AOpt2007(mSpec.mPrefix,"Prefix","Prefix for output files")
<< AOpt2007(mMiror,"Mir","Unify mirro codes")
<< AOpt2007(mNameOut,"Out","Name for output file")
<< mPhProj.DPPointsMeasures().ArgDirInOpt("GCPNames","Dir GCP for code selection on names")
;
}

Expand Down Expand Up @@ -320,6 +326,7 @@ void MakeFile3DCern3DTargt(size_t aNBB,size_t aNbD)

int cAppliGenerateEncoding::Exe()
{
mPhProj.FinishInit();
int Num000 = 0;
// [0] ======== Finish initialization and checking ==================

Expand Down Expand Up @@ -438,6 +445,27 @@ int cAppliGenerateEncoding::Exe()

}
}

if (mPhProj.DPPointsMeasures().DirInIsInit())
{
cSetMesGCP aSetGCP = mPhProj.LoadGCP();
std::set<int> aLInt;
for (const auto & aGCP : aSetGCP.Measures())
aLInt.insert(cStrIO<int>::FromStr(aGCP.mNamePt));
// StdOut() << "VOOOCSIZE= " << mVOC.size() << " " << aSetGCP.Measures().size() << "\n";
erase_if
(
mVOC,
[aLInt] (const auto & aPtr) {return ! MapBoolFind(aLInt,aPtr->mNum);}
);
// StdOut() << "VOOOCSIZE= " << mVOC.size() << " " << aSetGCP.Measures().size() << "\n";
// getchar();
// std::vector<cCelCC*> mVOC;

// StdOut() << "VOOOCSIZE= " << mVOC.size() << "\n";
// StdOut() << " * N0=" << mVOC.at(0)->mNum << "\n";
// StdOut() << " * N1=" << mVOC.at(1)->mNum << "\n";
}

// [3.0] if we use hamming code, not all numbers are possible
if (mSpec.mUseHammingCode)
Expand Down
Loading

0 comments on commit 14b3dca

Please sign in to comment.