Skip to content

Commit c906cf1

Browse files
author
deseilligny
committed
Merge branch 'mpd'
2 parents b3cd142 + 5a8f9db commit c906cf1

File tree

15 files changed

+714
-14
lines changed

15 files changed

+714
-14
lines changed

MMVII/include/MMVII_DeclareAllCmd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ extern cSpecMMVII_Appli TheSpec_ImportTxtCloud;
8989
extern cSpecMMVII_Appli TheSpec_MMVII_CloudClip;
9090
extern cSpecMMVII_Appli TheSpec_MMVII_Cloud2Ply;
9191
extern cSpecMMVII_Appli TheSpec_MMVII_CloudColorate;
92+
extern cSpecMMVII_Appli TheSpecTestLidarRevEng;
9293
extern cSpecMMVII_Appli TheSpec_ImportTiePMul;
9394
extern cSpecMMVII_Appli TheSpec_ImportMesImGCP;
9495
extern cSpecMMVII_Appli TheSpec_ImportM32;

MMVII/include/MMVII_ImageInfoExtract.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ namespace MMVII
2020
/* */
2121
/* *********************************************** */
2222

23+
24+
// see cPtxd<int,Dim> WhichMax(const cDataTypedIm<T1,Dim> & aIm) in MMVII_Tpl_Images.h
25+
26+
2327
/** Given three consecutive value interpole the extremum assumming a parabol, no value if alligned
2428
*/
2529
std::optional<double> InterpoleExtr(double V1,double V2,double V3);

MMVII/include/MMVII_Matrix.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ template <class TypeWeight,class TypeVal=TypeWeight> class cWeightAv
801801
TypeVal Average(const TypeVal & aDef) const;
802802
const TypeVal & SVW() const; /// Accessor to sum weighted vals
803803
const TypeWeight & SW() const; /// Accessor to sum weighted vals
804-
const long Nb() const; /// Accessor to number of elements
804+
long Nb() const; /// Accessor to number of elements
805805
void Reset();
806806
private :
807807
TypeWeight mSW; ///< Som of W
@@ -824,9 +824,10 @@ class cStdStatRes
824824
tREAL8 ErrAtProp(tREAL8 aProp) const;
825825
tREAL8 Min() const;
826826
tREAL8 Max() const;
827-
int NbMeasures() const;
827+
int NbMeasures() const;
828828

829-
std::string Show(const std::string & aPrefix,const std::vector<int> & aPerc) const;
829+
std::string Show(const std::string & aPrefix,const std::vector<int> & aPerc) const;
830+
const std::vector<tREAL8> & VRes() const;
830831
private :
831832
mutable std::vector<tREAL8> mVRes;
832833
cWeightAv<tREAL8,tREAL8> mAvgDist;

MMVII/include/MMVII_Ptxd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ template <class tContPts> class cComputeCentroids
613613
typedef typename tPts::tEl tEl;
614614

615615
static tPts MedianCentroids(const tContPts &);
616-
static tPts LinearWeigtedCentroids(const tContPts &,const tPts & aP0,double aSigma);
616+
static tPts LinearWeigtedCentroids(const tContPts &,const tPts & aP0,double aSigma,double aExpN2=1.0,double aErRej=1e10);
617617
static tREAL8 SigmaDist(const tContPts &,const tPts & aP0,double aProp);
618618

619619
static tPts StdRobustCentroid(const tContPts &,double aProp,int aNbIter);

MMVII/include/MMVII_StaticLidar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class cStaticLidarImporter
2727
cStaticLidarImporter();
2828
void readPlyPoints(std::string aPlyFileName);
2929
void readE57Points(std::string aE57FileName);
30+
bool read(const std::string & aName,bool OkNone=false); //< Addapt to adequate function from postfix, return is some read suceeded
31+
3032
void convertToThetaPhiDist();
3133
void convertToXYZ();
3234

MMVII/include/MMVII_nums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class cRandKAmongN
123123
/// K is the numbre to select, it will be selected regularly with a proportion aProp
124124
bool SelectWithProp(int aK,double aProp);
125125
bool SelectQAmongN(int aK,int aQ,int aN);
126+
int KthSelectQAmonN(int aKTh,int aQ,int aN,tREAL8 aPhase=0.5);
126127

127128

128129
/* ============ Definition of numerical type ================*/

MMVII/src/Appli/cMMVII_GenArgsSpec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static const std::vector<eTA2007> prjSubDirList = // c
3333
static const std::map<eTA2007,std::vector<std::string>> fileList = // clazy:exclude=non-pod-global-static
3434
{
3535
{eTA2007::FileImage,{".tif",".tiff",".jpg",".jpeg",".png",".jp2",".bmp",".cr2",".crw",".nef"}},
36-
{eTA2007::FileCloud,{".ply"}},
36+
{eTA2007::FileCloud,{".ply",".e57"}},
3737
{eTA2007::FileDmp,{"."+PostF_DumpFiles}},
3838
{eTA2007::File3DRegion,{""}},
3939
{eTA2007::XmlOfTopTag,{".xml",".json"}},

MMVII/src/Appli/cSpecMMVII_Appli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ std::vector<cSpecMMVII_Appli *> & cSpecMMVII_Appli::InternVecAll()
231231
TheVecAll.push_back(&TheSpec_ImportTxtCloud);
232232
TheVecAll.push_back(&TheSpec_MMVII_CloudClip);
233233
TheVecAll.push_back(&TheSpec_MMVII_Cloud2Ply);
234+
TheVecAll.push_back(&TheSpecTestLidarRevEng);
234235
{
235236
TheVecAll.push_back(&TheSpec_MMVII_CloudColorate);
236237
TheVecAll.push_back(&TheSpec_MMVII_CloudImProj);

MMVII/src/Geoms/PtsBox.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,30 @@ template <class tContPts> typename cComputeCentroids<tContPts>::tPts cComputeC
2626

2727
template <class tContPts>
2828
typename cComputeCentroids<tContPts>::tPts
29-
cComputeCentroids<tContPts>::LinearWeigtedCentroids(const tContPts & aContPts,const tPts & aP0,tREAL8 aSigma)
29+
cComputeCentroids<tContPts>::LinearWeigtedCentroids
30+
(
31+
const tContPts & aContPts,
32+
const tPts & aP0,
33+
tREAL8 aSigma,
34+
tREAL8 aExpN2,
35+
double aErRej
36+
)
3037
{
3138
tPts aRes = tPts::PCste(tEl(0));
3239
tEl aSomW = 0.0;
33-
tEl aS2 = Square(aSigma);
40+
tEl aS2P = std::pow(Square(aSigma),aExpN2);
41+
tEl aErRej2 = Square(aErRej);
3442

3543
for (const auto & aPt : aContPts)
3644
{
37-
tEl aW = aS2 / (aS2+SqN2(aPt-aP0));
38-
39-
aSomW += aW;
40-
aRes += aPt * aW;
45+
tEl aErr2 = SqN2(aPt-aP0);
46+
if (aErr2 < aErRej2)
47+
{
48+
tEl aW = aS2P / (aS2P+std::pow(aErr2,aExpN2));
49+
50+
aSomW += aW;
51+
aRes += aPt * aW;
52+
}
4153
}
4254

4355
return aRes/aSomW;
@@ -552,7 +564,7 @@ template <class T,const int Dim> T CosWDef(const cPtxd<T,Dim> &aP1,const cPtxd<
552564
template <class T,const int Dim> T AbsAngle(const cPtxd<T,Dim> &aP1,const cPtxd<T,Dim> & aP2)
553565
{
554566
T aCos = Cos(aP1,aP2);
555-
MMVII_INTERNAL_ASSERT_tiny((aCos>=1)&&(aCos<=-1),"AbsAngle cosinus out range");
567+
MMVII_INTERNAL_ASSERT_tiny((aCos<=1)&&(aCos>=-1),"AbsAngle cosinus out range");
556568
return acos(aCos);
557569
}
558570

MMVII/src/ImagesInfoExtract/ExtracExtremum.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ template void ExtractExtremum3(const cDataIm2D<Type> &anImUp,const cDataIm2D<Ty
488488

489489

490490

491+
MACRO_INSTANTIATE_ExtractExtremum(tREAL8);
491492
MACRO_INSTANTIATE_ExtractExtremum(tREAL4);
492493
MACRO_INSTANTIATE_ExtractExtremum(tINT2);
493494

0 commit comments

Comments
 (0)