Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/micmacIGN/micmac
Browse files Browse the repository at this point in the history
Fusion
  • Loading branch information
deseilligny committed Mar 13, 2018
2 parents e89af12 + c660a5c commit b750549
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 41 deletions.
3 changes: 2 additions & 1 deletion CodeGenere/File2String/Str_SuperposImage.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "StdAfx.h"
const char * (theNameVar_SuperposImage[1993]) = {
const char * (theNameVar_SuperposImage[1994]) = {
"<GenCpp>\n",
"\n",
"\n",
Expand Down Expand Up @@ -1653,6 +1653,7 @@ const char * (theNameVar_SuperposImage[1993]) = {
" <IndCol Nb=\"1\" Type=\"double\"> </IndCol>\n",
" <P1 Nb=\"1\" Type=\"Pt3dr\"> </P1>\n",
" <P2 Nb=\"1\" Type=\"Pt3dr\"> </P2>\n",
" <P3 Nb=\"*\" Type=\"Pt3dr\"> </P3>\n",
"</Xml_SLSRay>\n",
"\n",
"<Xml_OneLineSLS Nb=\"1\" Class=\"true\" ToReference=\"true\">\n",
Expand Down
4 changes: 4 additions & 0 deletions include/XML_GEN/SuperposImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -7403,10 +7403,14 @@ class cXml_SLSRay

Pt3dr & P2();
const Pt3dr & P2()const ;

std::list< Pt3dr > & P3();
const std::list< Pt3dr > & P3()const ;
private:
double mIndCol;
Pt3dr mP1;
Pt3dr mP2;
std::list< Pt3dr > mP3;
};
cElXMLTree * ToXMLTree(const cXml_SLSRay &);

Expand Down
1 change: 1 addition & 0 deletions include/XML_GEN/SuperposImage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,7 @@
<IndCol Nb="1" Type="double"> </IndCol>
<P1 Nb="1" Type="Pt3dr"> </P1>
<P2 Nb="1" Type="Pt3dr"> </P2>
<P3 Nb="*" Type="Pt3dr"> </P3>
</Xml_SLSRay>

<Xml_OneLineSLS Nb="1" Class="true" ToReference="true">
Expand Down
46 changes: 36 additions & 10 deletions src/SamplesLibElise/CPP_TestER.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Header-MicMac-eLiSe-25/06/2007*/
#include "StdAfx.h"
#include "../uti_phgrm/Apero/cCameraRPC.h"
#include "general/ptxd.h"

#include "../../include/im_tpl/cPtOfCorrel.h"

void CheckBounds(Pt2dr & aPmin, Pt2dr & aPmax, const Pt2dr & aP, bool & IS_INI);

Expand Down Expand Up @@ -1150,7 +1150,6 @@ int anAppli_PFM2Tiff::DoTif()

ReadPFMHeader(aFO);

std::cout << "EEEEEEEEEE Sz=" << mSz << "\n";

SkipSpace(aFO);

Expand Down Expand Up @@ -1188,8 +1187,10 @@ int anAppli_PFM2Tiff::DoTif()
ELISE_ASSERT(false,"anAppli_PFM2Tiff::DoTif(): File is too short ");

for (int aK1=0; aK1<mSz.x; aK1++)
{
//std::cout << aLine[aK1] << " " << "\n";
aRes.SetR(Pt2di(aK1,aK2),aLine[aK1]);

}

delete[] aLine;

Expand Down Expand Up @@ -1276,11 +1277,15 @@ class cImDir
ElSeg3D & OC();
const ElSeg3D & OC()const;

Pt2dr & PP();
const Pt2dr & PP()const;

std::vector<ElSeg3D> mDirs;

private :
const std::string mName;
ElSeg3D mOC;
Pt2dr mPP;
};

cImDir::cImDir(const std::string &aName) :
Expand All @@ -1294,6 +1299,12 @@ ElSeg3D & cImDir::OC()
const ElSeg3D & cImDir::OC()const
{ return mOC; }

Pt2dr & cImDir::PP()
{ return mPP; }

const Pt2dr & cImDir::PP()const
{ return mPP; }

class Appli_ImPts2Dir
{
public :
Expand Down Expand Up @@ -1325,14 +1336,14 @@ Appli_ImPts2Dir::Appli_ImPts2Dir(int argc,char ** argv) :
mSetIm (0)
{
std::string aPattern;
std::vector<std::string> aCirc;//not implemented for now
std::vector<std::string> aCircV = {"100","500"};//not implemented for now

ElInitArgMain
(
argc, argv,
LArgMain() << EAMC(aPattern,"Pattern of images")
<< EAMC(mOri,"Orientation directory"),
LArgMain() << EAM (aCirc,"Circ",true,"Vector of circle radii")
LArgMain() << EAM (aCircV,"Circ",true,"Vector of circle radii, Def=[100,500] px")
<< EAM (mOut,"Out",true,"Output file name")
);

Expand All @@ -1346,9 +1357,22 @@ Appli_ImPts2Dir::Appli_ImPts2Dir(int argc,char ** argv) :
mSetIm = mICNM->Get(mIms);
mNbIm = (int)mSetIm->size();

mListPt2d.push_back(Pt2dr(100,100));
mListPt2d.push_back(Pt2dr(200,200));
//circles wrt to "0"
for ( auto aCircRad : aCircV )
{
double aRadCur = RequireFromString<double>(aCircRad,"Radius i");

cFastCriterCompute * aCircRI = cFastCriterCompute::Circle(aRadCur);
const std::vector<Pt2di> & aVPt = aCircRI->VPt();

for ( auto aFlux : aVPt )
mListPt2d.push_back(Pt2dr(aFlux.x,aFlux.y));

}
mNbPts = int(mListPt2d.size());



}

int Appli_ImPts2Dir::DoCalc()
Expand All @@ -1364,11 +1388,13 @@ int Appli_ImPts2Dir::DoCalc()
//optical center
CamStenope * aCam = aCG->DownCastCS();
mMapImDirs[aNameIm]->OC() = aCam->Capteur2RayTer(aCam->PP());
mMapImDirs[aNameIm]->PP() = aCam->PP();


for (auto aKP : mListPt2d)
{
ElSeg3D aDir = aCG->Capteur2RayTer(aKP);
// std::cout << aKP + mMapImDirs[aNameIm]->PP() << " 0.0 " << "\n";
ElSeg3D aDir = aCG->Capteur2RayTer(aKP + mMapImDirs[aNameIm]->PP());

mMapImDirs[aNameIm]->mDirs.push_back(aDir);
}
Expand Down Expand Up @@ -1402,7 +1428,7 @@ int Appli_ImPts2Dir::Save()
for (int aP=0; aP<mNbPts; aP++)
{
cXml_SingleDir aXmlDir;
aXmlDir.PIm() = mListPt2d.at(aP);
aXmlDir.PIm() = mListPt2d.at(aP) + mMapImDirs[aNameIm]->PP();
aXmlDir.P1() = mMapImDirs[aNameIm]->mDirs.at(aP).P0();
aXmlDir.P2() = mMapImDirs[aNameIm]->mDirs.at(aP).P1();

Expand Down
40 changes: 37 additions & 3 deletions src/XML_GEN/SuperposImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24040,18 +24040,44 @@ const Pt3dr & cXml_SLSRay::P2()const
return mP2;
}


std::list< Pt3dr > & cXml_SLSRay::P3()
{
return mP3;
}

const std::list< Pt3dr > & cXml_SLSRay::P3()const
{
return mP3;
}

void BinaryUnDumpFromFile(cXml_SLSRay & anObj,ELISE_fp & aFp)
{
BinaryUnDumpFromFile(anObj.IndCol(),aFp);
BinaryUnDumpFromFile(anObj.P1(),aFp);
BinaryUnDumpFromFile(anObj.P2(),aFp);
{ int aNb;
BinaryUnDumpFromFile(aNb,aFp);
for( int aK=0 ; aK<aNb ; aK++)
{
Pt3dr aVal;
BinaryUnDumpFromFile(aVal,aFp);
anObj.P3().push_back(aVal);
}
} ;
}

void BinaryDumpInFile(ELISE_fp & aFp,const cXml_SLSRay & anObj)
{
BinaryDumpInFile(aFp,anObj.IndCol());
BinaryDumpInFile(aFp,anObj.P1());
BinaryDumpInFile(aFp,anObj.P2());
BinaryDumpInFile(aFp,(int)anObj.P3().size());
for( std::list< Pt3dr >::const_iterator iT=anObj.P3().begin();
iT!=anObj.P3().end();
iT++
)
BinaryDumpInFile(aFp,*iT);
}

cElXMLTree * ToXMLTree(const cXml_SLSRay & anObj)
Expand All @@ -24061,6 +24087,12 @@ cElXMLTree * ToXMLTree(const cXml_SLSRay & anObj)
aRes->AddFils(::ToXMLTree(std::string("IndCol"),anObj.IndCol())->ReTagThis("IndCol"));
aRes->AddFils(::ToXMLTree(std::string("P1"),anObj.P1())->ReTagThis("P1"));
aRes->AddFils(::ToXMLTree(std::string("P2"),anObj.P2())->ReTagThis("P2"));
for
( std::list< Pt3dr >::const_iterator it=anObj.P3().begin();
it !=anObj.P3().end();
it++
)
aRes->AddFils(::ToXMLTree(std::string("P3"),(*it))->ReTagThis("P3"));
aRes->mGXml = anObj.mGXml;
XMLPopContext(anObj.mGXml);
return aRes;
Expand All @@ -24076,9 +24108,11 @@ void xml_init(cXml_SLSRay & anObj,cElXMLTree * aTree)
xml_init(anObj.P1(),aTree->Get("P1",1)); //tototo

xml_init(anObj.P2(),aTree->Get("P2",1)); //tototo

xml_init(anObj.P3(),aTree->GetAll("P3",false,1));
}

std::string Mangling( cXml_SLSRay *) {return "004804A8DCBF1BA1FBBF";};
std::string Mangling( cXml_SLSRay *) {return "C65F5A5A245D11C2FD3F";};


double & cXml_OneLineSLS::IndLine()
Expand Down Expand Up @@ -24153,7 +24187,7 @@ void xml_init(cXml_OneLineSLS & anObj,cElXMLTree * aTree)
xml_init(anObj.Rays(),aTree->GetAll("Rays",false,1));
}

std::string Mangling( cXml_OneLineSLS *) {return "400084BE18ADACC5FA3F";};
std::string Mangling( cXml_OneLineSLS *) {return "AC21AFDE433F75E2FD3F";};


cTplValGesInit< bool > & cXml_ScanLineSensor::LineImIsScanLine()
Expand Down Expand Up @@ -24351,7 +24385,7 @@ void xml_init(cXml_ScanLineSensor & anObj,cElXMLTree * aTree)
xml_init(anObj.Lines(),aTree->GetAll("Lines",false,1));
}

std::string Mangling( cXml_ScanLineSensor *) {return "B848536DE6351DA5FB3F";};
std::string Mangling( cXml_ScanLineSensor *) {return "024C201F20E752A4FDBF";};


std::vector< cMonomXY > & cXml_PolynXY::Monomes()
Expand Down
27 changes: 0 additions & 27 deletions src/uti_phgrm/CPP_Malt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,6 @@ cAppliMalt::cAppliMalt(int argc,char ** argv) :
double aPCStd = 0.0;
std::string aMCorPoncCal = "xml";

// Proposition de reecriture MPD pour limiter duplication de code
if (EAMIsInit(&a12PixParam))
{
// Je pensei pas de pb pour admettre de de 0 a 5 arg, puisque tous ont une val def raisonnable ?
Expand All @@ -974,33 +973,7 @@ cAppliMalt::cAppliMalt(int argc,char ** argv) :
aMCorPoncCal = a12PixParam[4];
}

/*
if (int(a12PixParam.size())==3)
{
aZoomInitMCPonc = RequireFromString<double>(a12PixParam[0],"One-Two Pixel Matching : ZoomInit");
aPdsAttPix = RequireFromString<double>(a12PixParam[1],"One-Two Pixel Matching : PdsAttPix");
aPCCroise = RequireFromString<double>(a12PixParam[2],"One-Two Pixel Matching : aPCCroise");
}
else if (int(a12PixParam.size())==4)
{
aZoomInitMCPonc = RequireFromString<double>(a12PixParam[0],"One-Two Pixel Matching : ZoomInit");
aPdsAttPix = RequireFromString<double>(a12PixParam[1],"One-Two Pixel Matching : PdsAttPix");
aPCCroise = RequireFromString<double>(a12PixParam[2],"One-Two Pixel Matching : PCCroise");
aPCStd = RequireFromString<double>(a12PixParam[3],"One-Two Pixel Matching : PCStd");

}
else if (int(a12PixParam.size())==5)
{
aZoomInitMCPonc = RequireFromString<double>(a12PixParam[0],"One-Two Pixel Matching : ZoomInit");
aPdsAttPix = RequireFromString<double>(a12PixParam[1],"One-Two Pixel Matching : PdsAttPix");
aPCCroise = RequireFromString<double>(a12PixParam[2],"One-Two Pixel Matching : PCCroise");
aPCStd = RequireFromString<double>(a12PixParam[3],"One-Two Pixel Matching : PCStd");
aMCorPoncCal = a12PixParam[4];
}
else
ELISE_ASSERT( !((a12PixParam.size()==2) || (a12PixParam.size()>5)) ,"if 12PixP option used must be of size at least three");
*/

if (EAMIsInit(&mDoOrtho) && mDoOrtho)
{
Expand Down

0 comments on commit b750549

Please sign in to comment.