Skip to content

Commit

Permalink
Merge branch 'mpd'
Browse files Browse the repository at this point in the history
deseilligny committed Dec 26, 2024
2 parents 8a8a692 + d9a18a3 commit d00b6b2
Showing 21 changed files with 528 additions and 965 deletions.
Original file line number Diff line number Diff line change
@@ -53,7 +53,8 @@ T poly_eval( const Polynomials& poly, const T& x )
{
T val=poly[0];
T inv_x = T(1)/x;
for( DenseIndex i=1; i<poly.size(); ++i ){
// for( DenseIndex i=1; i<poly.size(); ++i ){ MPD::MMVII
for( DenseIndex i=1; i<DenseIndex(poly.size()); ++i ){
val = val*inv_x + poly[i]; }

return numext::pow(x,(T)(poly.size()-1)) * val;
11 changes: 9 additions & 2 deletions MMVII/include/MMVII_nums.h
Original file line number Diff line number Diff line change
@@ -993,6 +993,7 @@ template <class Type> class cPolynom
{
public :
typedef std::vector<Type> tCoeffs;
typedef cPtxd<Type,2> tCompl;
cPolynom(const tCoeffs &);
cPolynom(const cPolynom &);
cPolynom(size_t aDegre);
@@ -1007,13 +1008,19 @@ template <class Type> class cPolynom
static cPolynom<Type> RandomPolyg(std::vector<Type> & aVRoots,int aNbRoot,int aNbNoRoot,Type Interv,Type MinDist);


Type Value(const Type & aVal) const;
Type Value(const Type & aVal) const;
tCompl Value(const tCompl & aVal) const;
/// return som(|a_k x^k|) , used for some bounding stuffs
Type AbsValue(const Type & aVal) const;


cPolynom<Type> operator * (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator + (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator - (const cPolynom<Type> & aP2) const;
cPolynom<Type> operator * (const Type & aVal) const;
std::vector<Type> RealRoots(const Type & aTol,int ItMax);
cPolynom<Type> Deriv() const;

std::vector<Type> RealRoots(const Type & aTol,int ItMax) const;


Type& operator [] (size_t aK) {return mVCoeffs[aK];}
13 changes: 9 additions & 4 deletions MMVII/src/Appli/cMMVII_CalcSet.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define WITH_MMV1_FUNCTION false

#include "MMVII_2Include_Serial_Tpl.h"
#include "MMVII_DeclareAllCmd.h"
#include "MMVII_Sensor.h"
@@ -90,7 +92,10 @@ static void OneBenchEditSet
const std::string & ExpSet // Expect set
)
{
// StdOut() << "OneBenchEditSet " << anOp << std::endl;
#if (!WITH_MMV1_FUNCTION)
aNumAskedOut = 0;
aRealNumOut = 2;
#endif

cMMVII_Appli & anAp = cMMVII_Appli::CurrentAppli();
std::string aDirI = anAp.InputDirTestMMVII() + "Files/" ;
@@ -196,15 +201,15 @@ int cAppli_EditSet::ExecuteBench(cParamExeBench & aParam)
aK, // Change test condition : Use or Not Dir Project
"+=", // operator for mpdi
false, // If true, Previous OutPut is moved on input, else Input is purged at end of process
".*txt", // Pattern of used files
"F.*txt", // Pattern of used files
0, // Required num version
2, // Real Num Version
10, // Number of element expected (become obsolet with expected set)
"", // Interval modifying the pattern if != ""
C09 // Ground truth, what the string should be
); //
OneBenchEditSet(aK,"+=",false,".*txt" ,1,1,10,"",C09);
OneBenchEditSet(aK,"+=",false,".*txt" ,2,2,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F.*txt" ,1,1,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F.*txt" ,2,2,10,"",C09);
OneBenchEditSet(aK,"+=",false,"F[02468].txt",2,2,5,"","02468");
// here we init from previous
OneBenchEditSet(aK,"+=",true ,"F[3-5].txt" ,2,2,7,"","0234568"); // 0234568
77 changes: 0 additions & 77 deletions MMVII/src/Bench/BenchGlob.cpp
Original file line number Diff line number Diff line change
@@ -1056,88 +1056,11 @@ int cAppli_MPDTest::Exe()
return EXIT_SUCCESS;
}
TTT ();
#if 1
{
StdOut() << "T0:" << cName2Calc<double>::CalcFromName("toto",10,true) << std::endl;
StdOut() << "T1:" << cName2Calc<double>::CalcFromName("EqDist_Dist_Rad3_Dec1_XY1",10) << std::endl;
return EXIT_SUCCESS;
}
#else
if (mMMV1_GenCodeTestCam)
{
//StdOut() << "kkk=[" << mTopDirMMVII <<"]" << std::endl;
MMV1_GenerateCodeTestCam();
return EXIT_SUCCESS;
}
{
// Si on le met a 10h => reveil a 6h20
double t = 8.0;
//sleep(3600.0 * t);
sleepcp(3600.0 * t * 1000);
std::string aName= "/home/mpd/Bureau/Perso1/Musik/Bach/bach-goldberg-variations-bwv-988-glenn-gould-1981.mp3";
aName = "cvlc " + aName;
StdOut() << system(aName.c_str()) << std::endl;;
}
{
cPt3dr * anAdr = nullptr;
StdOut () << "ADDDDDr " << anAdr << "\n";
StdOut () << "ADDDDDrx " << &(anAdr->x()) << "\n";
StdOut () << "ADDDDDry " << &(anAdr->y()) << "\n";
StdOut () << "ADDDDDrz " << &(anAdr->z()) << "\n";
ShowAdr(anAdr->y());
}
{
double aV= 3.3333;
printf("VVVVV=%05.2f\n",aV);
}
if ((UN>DEUX) && PrintAndTrue("aaaa"))
{
PrintAndTrue("bbbb");
}
PrintAndTrue("ccccc");
cRotation3D<double>::RandomRot();
/*
cSparseVect<float> aSV;
for (const auto & aP : aSV)
{
StdOut() << aP.mI << std::endl;
}
*/
/*
cIm2D<tU_INT1> aIm(cPt2di(3,3));
aIm.DIm().SetV(cPt2di(0,0),13);
// aIm.DIm().SetV(cPt2di(0,0),1000);
// aIm.DIm().SetV(cPt2di(-1,0),1);
// new cIm2D<tU_INT1>(cPt2di(3,3));
cDataIm2D<tU_INT1> & aDIm = aIm.DIm();
tU_INT1* aPtr = aDIm.RawDataLin();
StdOut() << "aIm=" << int(aPtr[0]) << std::endl;
aPtr[0] = 14;
StdOut() << "aIm=" << (int)aDIm.GetV(cPt2di(0,0)) << std::endl;
// aPtr[-1] = 0;
*/
/*
TestVectBool();
cMMVII_Ofs aOs1("toto1.txt");
cMMVII_Ofs aOs2("toto2.txt");
cMultipleOfs amOs; // (aOs1.Ofs(),aOs2.Ofs());
amOs.Add(aOs1.Ofs());
amOs.Add(aOs2.Ofs());
amOs << "1+1=" << 1+1 << "\n";
cMMVII_Ofs aFile("toto.txt");
std::ostream & anOFS = aFile.Ofs();
anOFS << "TEST OFFFSSSSSSSSSSSS\n";
*/
return EXIT_SUCCESS;
#endif
}

tMMVII_UnikPApli Alloc_MPDTest(const std::vector<std::string> & aVArgs,const cSpecMMVII_Appli & aSpec)
8 changes: 0 additions & 8 deletions MMVII/src/MMV1/DenseMapCorresp.cpp

This file was deleted.

22 changes: 20 additions & 2 deletions MMVII/src/MMV1/ExportHomMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

#include "MMVII_util.h"
#include "MMVII_MeasuresIm.h"

namespace MMVII
{

#if (WITH_MMV1_FUNCTION)
cHomogCpleIm ToMMVII(const cNupletPtsHomologues & aNUp)
{

@@ -75,13 +82,24 @@ void cImportHomV1::GetHom(cSetHomogCpleIm & aPackV2,const std::string & aNameIm
/* */
/* ************************************************* */

cInterfImportHom::~cInterfImportHom()
cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const std::string&aSubDir,const std::string&aExt)
{
return new cImportHomV1(aDir,aSubDir,aExt);
}
#else

cInterfImportHom * cInterfImportHom::CreateImportV1(const std::string&aDir,const std::string&aSubDir,const std::string&aExt)
{
return new cImportHomV1(aDir,aSubDir,aExt);
MMVII_INTERNAL_ERROR("No CreateImportV1 ");
return nullptr;
}
cInterfImportHom::~cInterfImportHom()
{
}

#endif




};
25 changes: 18 additions & 7 deletions MMVII/src/MMV1/ExportMeasuresImGCPMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

#include "MMVII_util.h"
#include "MMVII_MeasuresIm.h"

@@ -10,6 +15,8 @@ namespace MMVII
/* */
/* ************************************************* */

#if (WITH_MMV1_FUNCTION)

void ImportMesImV1(std::list<cSetMesPtOf1Im> & aResult,const std::string & aNameFileMesImV1)
{
aResult.clear();
@@ -36,20 +43,24 @@ cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::strin
cMes1GCP aMesV2(ToMMVII(aMesV1.Pt()),aMesV1.NamePt(),1.0);

aMesV2.SetSigma2(ToMMVII(aMesV1.Incertitude()));
/*
aMesV2.Sigma2() = {0,0,0,0,0,0};
(aMesV2.Sigma2())[cMes1GCP::IndXX] = Square(aMesV1.Incertitude().x);
(aMesV2.Sigma2())[cMes1GCP::IndYY] = Square(aMesV1.Incertitude().y);
(aMesV2.Sigma2())[cMes1GCP::IndZZ] = Square(aMesV1.Incertitude().z);
*/

aResult.AddMeasure(aMesV2);
}

return aResult;
}

#else
void ImportMesImV1(std::list<cSetMesPtOf1Im> & aResult,const std::string & aNameFileMesImV1)
{
MMVII_INTERNAL_ERROR("No ImportMesImV1 ");
}
cSetMesGCP ImportMesGCPV1(const std::string & aNameFileMesGCPV1,const std::string & aNameSet)
{
MMVII_INTERNAL_ERROR("No ImportMesGCPV1");
return cSetMesGCP (aNameSet);
}
#endif



23 changes: 22 additions & 1 deletion MMVII/src/MMV1/ExportSensorMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#include "MMVII_util.h"
#endif

#include "MMVII_MMV1Compat.h"

namespace MMVII
{

#if (WITH_MMV1_FUNCTION)
/* ************************************************* */
/* */
/* cExportV1StenopeCalInterne */
@@ -154,5 +160,20 @@ cExportV1StenopeCalInterne::cExportV1StenopeCalInterne
if ((aNbLayer>0) && (aNbPointPerDim>0))
DoCorresp(mCorresp,aCamV1,aNbPointPerDim,aNbLayer,aDS);
}
#else
cExportV1StenopeCalInterne::cExportV1StenopeCalInterne
(
bool isForCalib,
const std::string& aFile,
int aNbPointPerDim,
int aNbLayer,
tREAL8 aDS,
const std::string& aFileInterneCalib
) :
mPose (cIsometry3D<tREAL8>::Identity())
{
MMVII_INTERNAL_ERROR("Reading of MMV1 Camera is deprecated");
}
#endif

};
16 changes: 6 additions & 10 deletions MMVII/src/MMV1/FluxPtsMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define WITH_MMV1_FUNCTION false

#include "V1VII.h"
#include "MMVII_Geom2D.h"

@@ -35,6 +37,10 @@ Neighbourhood DiscNeich(const tREAL8 & aRay)

void FluxToV2Points(tResFlux & aRes,Flux_Pts aFlux)
{
//StdOut() << "FluxToV2PointsFluxToV2PointsFluxToV2PointsuuuuuuuuuuuuFluxToV2PointsFluxToV2PointsFluxToV2PointsFluxToV2PointsFluxToV2Points\n";
//getchar();


aRes.clear();
Liste_Pts<int,int> aLV1(2);

@@ -80,7 +86,6 @@ void GetPts_Ellipse(tResFlux & aRes,const cPt2dr & aC,double aRayA,double aRayB
}



void GetPts_Line(tResFlux & aRes,const cPt2dr & aP1,const cPt2dr &aP2,tREAL8 aDil)
{
Flux_Pts aFlux = line(ToMMV1(ToI(aP1)),ToMMV1(ToI(aP2)));
@@ -95,15 +100,6 @@ void GetPts_Line(tResFlux & aRes,const cPt2dr & aP1,const cPt2dr &aP2)
}


/*
void Txxxxxxxxx()
{
Flux_Pts disc(Pt2dr,REAL,bool front = true);
Neighbourhood
}
*/


};

197 changes: 0 additions & 197 deletions MMVII/src/MMV1/GenCodeTestCam.cpp

This file was deleted.

55 changes: 39 additions & 16 deletions MMVII/src/MMV1/ImageFilterMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define WITH_MMV1_BENCH false
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_BENCH)
#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

@@ -61,10 +61,17 @@ void Bench_LabMaj()
}


#if (WITH_MMV1_BENCH)
#if (WITH_MMV1_FUNCTION)

/* ************************************************* */
/* */
/* UNUSED */
/* */
/* ************************************************* */

// Stuffs not implemanted because not used in MMVII 4 now


// Not implemanted/used in MMVII 4 now
void MMV1_MakeImageDist(cIm2D<tU_INT1> aImIn,const std::string & aNameChamfer)
{
const Chamfer & aChamf = Chamfer::ChamferFromName(aNameChamfer);
@@ -97,8 +104,16 @@ void ExportHomMMV1(const std::string & aIm1,const std::string & aIm2,const std::
ExportHomMMV1(aIm1,aIm2,SH,aVR);
}

/* ************************************************* */
/* */
/* DEPRECATED V1 SOLUTION */
/* */
/* ************************************************* */

//================= V1 Solution ==================
// implemantation of methods that used to do be done unsing MMV1
// Activated with WITH_MMV1_FUNCTION , to check correctness

//================= Curvature of tangent line -> Courb Tgt ==================

template<class Type> cIm2D<Type> MMV1_CourbTgt(cIm2D<Type> aImIn)
{
@@ -117,6 +132,8 @@ template<class Type> void MMV1_SelfCourbTgt(cIm2D<Type> aImIn)
ELISE_COPY(aV1In.all_pts(),courb_tgt(aV1In.in_proj(),0.5),aV1In.out());
}

//================= Laplacian ==================

cIm2D<tREAL4> MMV1_Lapl(cIm2D<tREAL4> aImIn)
{
cIm2D<tREAL4> aRes(aImIn.DIm().Sz());
@@ -130,19 +147,9 @@ cIm2D<tREAL4> MMV1_Lapl(cIm2D<tREAL4> aImIn)
}


//================= Global Solution ==================


template<class Type> void BenchImFilterV1V2(cIm2D<Type> anI1,cIm2D<Type> anI2,tREAL8 aEps)
{

tREAL8 aRD = anI1.DIm().SafeMaxRelDif(anI2.DIm(),1e-2);
if ( aRD > aEps )
{
MMVII_INTERNAL_ASSERT_bench( false,"BenchImFilterV1V2 RD="+ToStr(aRD));
}

}
//================= Extremal value of image ==================

template <class Type> std::pair<Type,Type> MMV1_ValExtre(cIm2D<Type> aImIn)
{
@@ -151,6 +158,7 @@ template <class Type> std::pair<Type,Type> MMV1_ValExtre(cIm2D<Type> aImIn)
ELISE_COPY(aV1In.all_pts(),aV1In.in(),VMin(aVMin)|VMax(aVMax));
return std::pair<Type,Type>((Type)aVMin,(Type)aVMax);
}
//================= Average of absolute value ==================

template<class Type> double MMV1_MoyAbs(cIm2D<Type> aImIn)
{
@@ -160,6 +168,8 @@ template<class Type> double MMV1_MoyAbs(cIm2D<Type> aImIn)
return aSom[0] / aSom[1];
}

//================= Deriche gradient ==================

template<class Type> void MMV1_ComputeDeriche(cImGrad<Type> & aResGrad,const cDataIm2D<Type> & aImIn,double aAlpha)
{
auto aV1In = cMMV1_Conv<Type>::ImToMMV1(aImIn);
@@ -180,6 +190,8 @@ template<class Type> cImGrad<Type> MMV1_Deriche(const cDataIm2D<Type> & aImIn,do
return aResGrad;
}

//================= Make a visualisable image with adapative dyn ==================

void MMV1_MakeStdIm8BIts(cIm2D<tREAL4> aImIn,const std::string& aName)
{
Im2D<tREAL4,tREAL8> aV1In = cMMV1_Conv<tREAL4>::ImToMMV1(aImIn.DIm());
@@ -204,6 +216,17 @@ void MMV1_MakeStdIm8BIts(cIm2D<tREAL4> aImIn,const std::string& aName)
}


//============== BENCH with old MMV1 implementation and new one ===============

template<class Type> void BenchImFilterV1V2(cIm2D<Type> anI1,cIm2D<Type> anI2,tREAL8 aEps)
{
tREAL8 aRD = anI1.DIm().SafeMaxRelDif(anI2.DIm(),1e-2);
if ( aRD > aEps )
{
MMVII_INTERNAL_ASSERT_bench( false,"BenchImFilterV1V2 RD="+ToStr(aRD));
}
}


template <class Type> void Tpl_BenchImFilterV1V2(const cPt2di& aSz)
{
10 changes: 0 additions & 10 deletions MMVII/src/MMV1/Numerics.cpp
Original file line number Diff line number Diff line change
@@ -54,16 +54,6 @@ INST_V1ROOTS(tREAL8)
INST_V1ROOTS(tREAL16)


/*
template <class Type> void
RealRootsOfRealPolynome
(
ElSTDNS vector<Type> & Sols,
const ElPolynome<Type> &aPol,
Type tol,
INT ItMax
)
*/


};
63 changes: 57 additions & 6 deletions MMVII/src/MMV1/XmlMMV1.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#define WITH_MMV1_FUNCTION false

#if (WITH_MMV1_FUNCTION)
#include "V1VII.h"
#endif

#include "MMVII_Mappings.h"
#include "MMVII_AimeTieP.h"


#if (WITH_MMV1_FUNCTION)
#include "../src/uti_image/NewRechPH/cParamNewRechPH.h"
// #include "../CalcDescriptPCar/AimeTieP.h"

#include "im_tpl/cPtOfCorrel.h"
#include "algo_geom/qdt.h"
#include "algo_geom/qdt_implem.h"
#include "ext_stl/heap.h"
#endif



namespace MMVII
@@ -22,7 +27,11 @@ namespace MMVII
/* */
/* *********************************** */


#if (WITH_MMV1_FUNCTION)
/*
This class is an interface to use in MMV2, the 3d masq produce by SaisieMasqQT of MMV1,
using the MMV1 library
*/
class cMasq_MMV1asBoundeSet : public cDataBoundedSet<tREAL8,3>
{
public :
@@ -54,10 +63,18 @@ cDataBoundedSet<tREAL8,3> * MMV1_Masq(const cBox3dr &aBox,const std::string & a
{
return new cMasq_MMV1asBoundeSet(aBox,aNameFile);
}
#else
cDataBoundedSet<tREAL8,3> * MMV1_Masq(const cBox3dr &aBox,const std::string & aNameFile)
{
MMVII_INTERNAL_ERROR("Handling MMV1 3d-Masq is deprecated");
return nullptr;
}
#endif



//============= tNameRel ====================
#if (WITH_MMV1_FUNCTION)

void TestTimeV1V2()
{
@@ -595,13 +612,47 @@ template <class Type> void cImplem_ExportAimeTiep<Type>::FiltrageSpatialPts()
}
}

template class cImplem_ExportAimeTiep<tREAL4>;
template class cImplem_ExportAimeTiep<tINT2>;
#else
template <class Type> cInterf_ExportAimeTiep<Type>::~cInterf_ExportAimeTiep()
{
}

template <class Type> cInterf_ExportAimeTiep<Type> * cInterf_ExportAimeTiep<Type>::Alloc(const cPt2di& aSzIm0,bool IsMax,eTyPyrTieP ATypePt,const std::string & aName,bool ForInspect,const cGP_Params & aParam )
{

MMVII_INTERNAL_ERROR("Creating cInterf_ExportAimeTiep is deprecated");
return nullptr;
}

template<> void MMv1_SaveInFile(const tNameRel & aSet,const std::string & aName)
{
MMVII_INTERNAL_ERROR("Handling writing of MMV1 Relations is deprecated");
}
template<> void MMv1_SaveInFile(const tNameSet & aSet,const std::string & aName)
{
MMVII_INTERNAL_ERROR("Handling writing MMV1 Sets is deprecated");
}
tNameSet MMV1InitSet(const std::string & aName)
{
MMVII_INTERNAL_ERROR("Handling reaing of MMV1 Sets is deprecated");
return tNameSet();
}

tNameRel MMV1InitRel(const std::string & aName)
{
MMVII_INTERNAL_ERROR("Handling reaing of MMV1 Rels is deprecated");
return tNameRel();
}
#endif

// ============ INSTANTIATION ======================

template class cInterf_ExportAimeTiep<tREAL4>;
template class cInterf_ExportAimeTiep<tINT2>;
template class cImplem_ExportAimeTiep<tREAL4>;
template class cImplem_ExportAimeTiep<tINT2>;


};



542 changes: 0 additions & 542 deletions MMVII/src/MMV1/cGeneratedCodeTestCam.cpp

This file was deleted.

42 changes: 0 additions & 42 deletions MMVII/src/MMV1/cGeneratedCodeTestCam.h

This file was deleted.

8 changes: 6 additions & 2 deletions MMVII/src/Matrix/cEigenEigenDecompos.cpp
Original file line number Diff line number Diff line change
@@ -93,9 +93,13 @@ void Bench_EigenDecompos(cParamExeBench & aParam)
Tpl_Bench_EigenDecompos<tREAL8>(aParam);
}

#define INSTANTIATE_EIGEN_DECOMP(TYPE)\
template class cResulEigenDecomp<TYPE>;\
template class cDenseMatrix<TYPE>;

template class cResulEigenDecomp<tREAL8>;
template class cDenseMatrix<tREAL8>;
INSTANTIATE_EIGEN_DECOMP(tREAL4);
INSTANTIATE_EIGEN_DECOMP(tREAL8);
INSTANTIATE_EIGEN_DECOMP(tREAL16);


};
4 changes: 4 additions & 0 deletions MMVII/src/Mesh/Ply.cpp
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
#include "MMVII_Geom3D.h"
#include "MMVII_Mappings.h"

#define WITH_MMV1_FUNCTION false

namespace MMVII
{

@@ -2114,12 +2116,14 @@ template <class Type> void cTriangulation3D<Type>::Bench()
MMVII_INTERNAL_ASSERT_bench(aTriBin3D.HeuristikAlmostEqual(aNewTriBin3D,1e-5,1e-5),"cTriangulation3D::Bench");
MMVII_INTERNAL_ASSERT_bench(aTriTxt3D.HeuristikAlmostEqual(aNewTriTxt3D,1e-5,1e-5),"cTriangulation3D::Bench");

#if (WITH_MMV1_FUNCTION)
cDataBoundedSet<tREAL8,3> * aMasq= MMV1_Masq(aNewTriBin3D.BoxEngl().ToR(),aDirI+"AperiCloud_Basc_selectionInfo.xml");
aNewTriBin3D.Filter(*aMasq);
aNewTriBin3D.WriteFile(aDirTmp+"MeshFilteredBin.ply",true);

// BREAK_POINT("BENCHTRI");
delete aMasq;
#endif
}

void BenchPly(cParamExeBench & aParam)
7 changes: 7 additions & 0 deletions MMVII/src/Sensors/cConvCalib.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#define WITH_MMV1_FUNCTION false

#include "MMVII_PCSens.h"
#include "MMVII_MMV1Compat.h"
#include "MMVII_DeclareCste.h"
#include "MMVII_BundleAdj.h"



/**
\file cConvCalib.cpp testgit
@@ -298,6 +302,9 @@ void BenchPoseImportV1(const std::string & aNameOriV1,double anAccuracy)

void BenchCentralePerspective_ImportV1(cParamExeBench & aParam)
{
#if (!WITH_MMV1_FUNCTION)
return;
#endif
BenchPoseImportV1("Orientation-_DSC8385.tif.xml" ,1e-5);
BenchPoseImportV1("Orientation-Img0937.tif.xml" ,1e-5);

11 changes: 11 additions & 0 deletions MMVII/src/Serial/ElemStrToVal.cpp
Original file line number Diff line number Diff line change
@@ -1395,6 +1395,17 @@ std::string FixDigToStr(double aSignedVal,int aNbBef,int aNbAfter)
return aBuf;
}

// ================ double ==============================================

template <> std::string cStrIO<tREAL16>::ToStr(const tREAL16 & aD)
{
return cStrIO<tREAL8>::ToStr((tREAL8) (aD));
}

template <> std::string cStrIO<tREAL4>::ToStr(const tREAL4 & aD)
{
return cStrIO<tREAL8>::ToStr((tREAL8) (aD));
}


// ================ std::string ==============================================
28 changes: 3 additions & 25 deletions MMVII/src/TestLibsExtern/TestJetsCam.cpp
Original file line number Diff line number Diff line change
@@ -284,8 +284,8 @@ void BenchJetsCam(cParamExeBench & aParam)
for (int aK=0 ; aK<aNb ; aK++)
{
std::vector<double> aVParam = StdParamTestCam(1.0);
std::vector<double> aValJet,aValV1,aVarValJet;
std::vector<std::vector<double> > aDerJet,aDerV1,aVarDerJet;
std::vector<double> aValJet,aVarValJet;
std::vector<std::vector<double> > aDerJet,aVarDerJet;

cJetsTestCam aCamJet;
aCamJet.InitFromParams(aVParam);
@@ -295,33 +295,11 @@ void BenchJetsCam(cParamExeBench & aParam)
aVarCamJet.InitFromParams(aVParam);
aVarCamJet.Compute(aVarValJet,aVarDerJet);


std::shared_ptr<cInterfaceTestCam> aCamV1 (cInterfaceTestCam::AllocMMV1());
aCamV1->InitFromParams(aVParam);
aCamV1->Compute(aValV1,aDerV1);

for (int aKXY=0 ; aKXY<2 ; aKXY++)
{
double aDif = aValJet[aKXY]-aValV1[aKXY];
MMVII_INTERNAL_ASSERT_bench(std::abs(aDif)<1e-5,"Jets/V1 vals");

aDif = aVarValJet[aKXY]-aValV1[aKXY];

// StdOut() << "DDD=" << aDif<< " " << aValJet[aKXY] << " " << aValV1[aKXY] << std::endl;
for (int aKD=0 ; aKD<SzJetCam ; aKD++)
{
double aDif = aDerV1[aKXY][aKD]-aDerJet[aKXY][aKD];
MMVII_INTERNAL_ASSERT_bench(std::abs(aDif)<1e-5,"Jets/V1 deriv");
aDif = aDerV1[aKXY][aKD]-aVarDerJet[aKXY][aKD];
MMVII_INTERNAL_ASSERT_bench(std::abs(aDif)<1e-5,"Jets/V1 deriv");
// StdOut() << " Der=" << aDif << " " << aDerV1[aKXY][aKD] << std::endl;
}
}
int aNbTest=1000 * (1+std::min(20,aParam.Level()));
double aT0 = cMMVII_Appli::CurrentAppli().SecFromT0();
aCamJet.Compute(aNbTest);
double aT1 = cMMVII_Appli::CurrentAppli().SecFromT0();
aCamV1->Compute(aNbTest);
// aCamV1->Compute(aNbTest);
double aT2 = cMMVII_Appli::CurrentAppli().SecFromT0();
// Now we now that sparse jets are slow save some time
double aT3 = aT2;
328 changes: 315 additions & 13 deletions MMVII/src/UtiMaths/Polynoms.cpp

Large diffs are not rendered by default.

0 comments on commit d00b6b2

Please sign in to comment.