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
  • Loading branch information
erupnik committed May 22, 2017
2 parents fc45d0b + ec576e9 commit be6d75c
Show file tree
Hide file tree
Showing 40 changed files with 748 additions and 373 deletions.
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ before_build:
- mkdir build
- cd build
- cmake .. -DWITH_QT5=OFF -DCMAKE_BUILD_TYPE=Release

build_script:
- cmake --build . --target INSTALL --config Release
- cd ..

Expand Down
3 changes: 2 additions & 1 deletion include/general/arg_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,12 @@ class LArgMain

template <class Type> LArgMain & operator << (const ElArgMain<Type> & v)
{
if (v.IsActif())
if (v.IsActif())
_larg.push_back(v.dup());
return * this;
}
~LArgMain();
LArgMain & operator << (const LArgMain & v);

int Size() const;

Expand Down
2 changes: 2 additions & 0 deletions include/general/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class ElEM // Elise Erreur Message
extern bool TheExitOnBrkp;
extern bool TheExitOnNan;
extern bool TheExitOnWarn;
extern bool TheGoonOnWarn;
extern bool TheMajickFile;
extern int TheNbIterProcess;

Expand Down Expand Up @@ -319,6 +320,7 @@ class cElWarning
static cElWarning AppuisMultipleDefined;
static cElWarning OnzeParamSigneIncoh;
static cElWarning ToleranceSurPoseLibre;
static cElWarning EigenValueInCholeski;

static void ShowWarns(const std::string & aFile);
private :
Expand Down
3 changes: 3 additions & 0 deletions include/general/photogram.h
Original file line number Diff line number Diff line change
Expand Up @@ -2828,6 +2828,7 @@ class cMirePolygonEtal
bool IsNegatif() const;
cMirePolygonEtal();
static const cMirePolygonEtal & IgnMireN6();
static const cMirePolygonEtal & ENSGMireN6();
static const cMirePolygonEtal & MtdMire9();
static const cMirePolygonEtal & IGNMire7();
static const cMirePolygonEtal & IGNMire5();
Expand All @@ -2845,6 +2846,7 @@ class cMirePolygonEtal
private :

static const double TheIgnN6[6];
static const double TheENSG6[6];
static const double TheMTD9[6];
static const double TheIGNDiams7[7];
static const double TheIGNDiams5[5];
Expand All @@ -2855,6 +2857,7 @@ class cMirePolygonEtal
static const double TheDiamMTClous1[1];

static cMirePolygonEtal TheNewIGN6;
static cMirePolygonEtal TheNewENSG6;
static cMirePolygonEtal TheMTDMire9;
static cMirePolygonEtal TheIGNMire7;
static cMirePolygonEtal TheIGNMire5;
Expand Down
2 changes: 2 additions & 0 deletions src/CBinaires/mm3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ int CPP_CmpDenseMap(int argc,char** argv);
int CPP_FermDenseMap(int argc,char** argv);
int ScalePat_main(int argc,char** argv);
int CPP_MakeMapEvolOfT(int argc,char ** argv);
int CPP_PolynOfImage(int argc,char ** argv);


const std::vector<cMMCom> & getAvailableCommands()
Expand Down Expand Up @@ -317,6 +318,7 @@ const std::vector<cMMCom> & getAvailableCommands()


aRes.push_back(cMMCom("StackFlatField",EstimFlatField_main,"Basic Flat Field estimation by image stacking"));
aRes.push_back(cMMCom("PolynOfImage",CPP_PolynOfImage,"Approximate image by polynom"));
aRes.push_back(cMMCom("Impaint",Impainting_main,"Basic Impainting"));
aRes.push_back(cMMCom("Gri2Bin",Gri2Bin_main," Do some stuff"));
aRes.push_back(cMMCom("MakeGrid",MakeGrid_main," Generate orientations in a grid format"));
Expand Down
19 changes: 18 additions & 1 deletion src/EtalonnagePolygone/CPP_ConvertPolygone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ void GenerePolyTxtRect

int ConvertPolygone_main(int argc,char ** argv)
{
/*
ConvertOnePolygone
(
Pt3dr(0,-1,0),
"/home/mehdi/Test_Pointe_Auto/resultat_cor.txt",
"/home/mehdi/Test_Pointe_Auto/resultat_cor.xml",
"ENSG-New-6Cercles","ENSG-New-6Cercles",
true,
false,
0,
0,
0,
false
);
*/

/*
{
double aProfClou[2] = {4.5,9.0};
Expand Down Expand Up @@ -415,7 +431,7 @@ int ConvertPolygone_main(int argc,char ** argv)
true
);
*/

/*
ConvertOnePolygone
(
Pt3dr(0,0,1),
Expand All @@ -427,6 +443,7 @@ int ConvertPolygone_main(int argc,char ** argv)
0,0,0,false,
false
);
*/
return 0;

}
Expand Down
2 changes: 2 additions & 0 deletions src/EtalonnagePolygone/lib/all_etal.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class cCibleRechImage
cSetEqFormelles mSetSR5;
cSetEqFormelles mSetMT0;
cSetEqFormelles mSetMN6;
cSetEqFormelles mSetME6;


cSetEqFormelles* pSet;
Expand All @@ -270,6 +271,7 @@ class cCibleRechImage
cEqEllipseImage * pEqElImSR5;
cEqEllipseImage * pEqElImMT0;
cEqEllipseImage * pEqElImN6;
cEqEllipseImage * pEqElImE6;
cEqEllipseImage * pEqElIm;

};
Expand Down
20 changes: 15 additions & 5 deletions src/EtalonnagePolygone/lib/cCibleRechImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ cCibleRechImage::cCibleRechImage
pWSynth (AllocW()),
pWFFT (AllocW()),
pWGlob (0),

mSetM7 (),
mSetM6 (),
mSetM5 (),
Expand All @@ -94,7 +93,7 @@ cCibleRechImage::cCibleRechImage
mSetSR5 (),
mSetMT0 (),
mSetMN6 (),

mSetME6 (),
pSet (0),
mDefLarg (anEtal.Param().DefLarg()),

Expand All @@ -107,6 +106,7 @@ cCibleRechImage::cCibleRechImage
pEqElImSR5 (mSetSR5.NewEqElIm(cMirePolygonEtal::SofianeMireR5())),
pEqElImMT0 (mSetMT0.NewEqElIm(cMirePolygonEtal::MT0())),
pEqElImN6 (mSetMN6.NewEqElIm(cMirePolygonEtal::IgnMireN6())),
pEqElImE6 (mSetME6.NewEqElIm(cMirePolygonEtal::ENSGMireN6())),

pEqElIm (0)
{
Expand All @@ -125,6 +125,7 @@ cCibleRechImage::cCibleRechImage
mSetSR5.SetClosed();
mSetMT0.SetClosed();
mSetMN6.SetClosed();
mSetME6.SetClosed();
}

void cCibleRechImage::ShowCible(Video_Win *pW,INT aCoul)
Expand Down Expand Up @@ -323,10 +324,19 @@ void cCibleRechImage::RechercheImage
{
pSet = & mSetMN6;
pEqElIm = pEqElImN6;
FPtsCorrel = 1.2;
FPtsRaff = 1.1;
FPtsCorrel = 1.2;
FPtsRaff = 1.1;

std::cout << "BL " << pEqElIm->CurBlanc() << " N " << pEqElIm->CurNoir() << "\n";
}
else if (& aMire == & cMirePolygonEtal::ENSGMireN6())
{
pSet = & mSetME6;
pEqElIm = pEqElImE6;
FPtsCorrel = 1.2;
FPtsRaff = 1.1;

std::cout << "BL " << pEqElIm->CurBlanc() << " N " << pEqElIm->CurNoir() << "\n";
std::cout << "BL " << pEqElIm->CurBlanc() << " N " << pEqElIm->CurNoir() << "\n";
}
else
{
Expand Down
90 changes: 67 additions & 23 deletions src/TpMMPD/Hugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ Header-MicMac-eLiSe-25/06/2007*/
#include "StdAfx.h"
#include "schnaps.h"

template <typename T>
std::string NumberToString ( T Number )
template <typename T> string NumberToString(T Number)
{
std::ostringstream ss;
ostringstream ss;
ss << Number;
return ss.str();
return ss.str();
}

//----------------------------------------------------------------------------
struct Couple{
std::string Img1;
Expand Down Expand Up @@ -183,6 +181,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
int aProj=0;
double aFov=50;
bool aFilter=true;
bool aClean=true;

ElInitArgMain
(
Expand All @@ -194,6 +193,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
<< EAM(aProj,"Proj",false,"Projection type (default: 0)")
<< EAM(aFov,"FOV",false,"Horizontal field of view of images (default: 50)")
<< EAM(aFilter,"FilterTP",true,"Use Schnaps to reduce tie points; Def=true")
<< EAM(aClean,"Clean",true,"Clean indivudual images after stitching ; Def=true")
);

// !!!!!!!! sort directories by name !!!!!!!
Expand Down Expand Up @@ -257,12 +257,12 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)

for(unsigned int aV=0; aV<aLFiles.size(); aV++)
{
std::cout << "Copy images of groupe : " << aV << std::endl;
std::cout << "Copy images of groupe " << aV+1 << " out of " << aLFiles.size() << " groups" << std::endl;
int aCompt = 1;
for(std::list<cElFilename>::iterator iT2 = aLFiles.at(aV).begin() ; iT2 != aLFiles.at(aV).end() ; iT2++)
{
std::cout << "---> Copy of file " << aCompt << " out of " << aLFiles.at(aV).size() << std::endl;
ELISE_fp::CpFile((*iT2).m_path.str() + (*iT2).m_basename,aNameProcFolder); //copy only if no file !!!!
ELISE_fp::CpFile((*iT2).m_path.str() + (*iT2).m_basename,aNameProcFolder); //to do : copy only if no file !!!!
aCompt++;
}
}
Expand All @@ -274,16 +274,20 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
ctPath aNWDir = getWorkingDirectory();
std::cout << "aNWDir = " << aNWDir << std::endl;
}

//vector of names of signe mosaic for each level
std::vector<std::string> aVOM;

//lauch all the commands in //
std::list<std::string> aListCom;

//pipeline to generate a pano for each level N
//pipeline to generate a pano for each level N :
//first tie points extraction using MicMac
for(unsigned int aP=0; aP<aDirectories.size(); aP++)
{
std::cout << "debugggggg" << std::endl;
std::string aPatL = GenPatFromLF(aLFiles.at(aP),false);
std::cout << "debugggggg" << std::endl;
//std::string aPatL2 = GenPatFromLF(aLFiles.at(aP+1),false);
std::cout << "debugggggg" << std::endl;
std::string aXmlOutFile = "NameCple_" + NumberToString(aP) + "_" + NumberToString(aP+1) + ".xml";
std::string aXmlOutFile = "NameCple_" + NumberToString(aP) + ".xml";
std::cout << "aXmlOutFile = " << aXmlOutFile << std::endl;

//generate a .xml file of all couples for level N & level N+1
Expand Down Expand Up @@ -332,7 +336,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
std::string aPatLH = GenPatFromLF(aLFiles.at(aP),true);
//std::string aPatL2H = GenPatFromLF(aLFiles.at(aP+1),true);

std::string aHNameProject = "Hugin_" + NumberToString(aP) + "_" + NumberToString(aP+1) + ".pto";
std::string aHNameProject = "Hugin_" + NumberToString(aP) + ".pto";
std::string aCom3 = "pto_gen -o"
+ std::string(" ")
+ aHNameProject
Expand All @@ -344,7 +348,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
+ std::string(" ")
+ "-f " + NumberToString(aFov);
std::cout << "aCom3 = " << aCom3 << std::endl;
system_call(aCom3.c_str());
//~ system_call(aCom3.c_str());

//specify the variables to be optimized
std::string aCom4 = "pto_var --opt=\"y, p, r, TrX, TrY, TrZ, Tpy, Tpp, v, a, b, c, d, e, g, t, Eev, Er, Eb, Vb, Vc, Vd, Vx, Vy, Ra, Rb, Rc, Rd, Re\""
Expand All @@ -353,7 +357,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
+ std::string(" ")
+ aHNameProject;
std::cout << "aCom4 = " << aCom4 << std::endl;
system_call(aCom4.c_str());
//~ system_call(aCom4.c_str());

//include tie points from MicMac in the project file
std::string aCom5 = MMDir()
Expand All @@ -368,7 +372,7 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
+ std::string(" ")
+ "HomolIn=_mini";
std::cout << "aCom5 = " << aCom5 << std::endl;
system_call(aCom5.c_str());
//~ system_call(aCom5.c_str());

//lanch Hugin optimizer
std::string aCom6 = "autooptimiser -a -l -s -m -v"
Expand All @@ -377,31 +381,71 @@ cOSPTPE_Appli::cOSPTPE_Appli(int argc,char ** argv)
+ "-o " + StdPrefixGen(aHNameProject) + "_Homol.pto"
+ std::string(" ") + StdPrefixGen(aHNameProject) + "_Homol.pto";
std::cout << "aCom6 = " << aCom6 << std::endl;
system_call(aCom6.c_str());
//~ system_call(aCom6.c_str());

//pano configuration
std::string aCom7 = "pano_modify -p " + NumberToString(aProj)
+ std::string(" ") + "-o "
+ StdPrefixGen(aHNameProject) + "_Homol.pto"
+ std::string(" ") + StdPrefixGen(aHNameProject) + "_Homol.pto";
std::cout << "aCom7 = " << aCom7 << std::endl;
system_call(aCom7.c_str());
//~ system_call(aCom7.c_str());

//generate individual images to be stiched
std::string aCom8 = "nona -z LZW -r ldr -m TIFF_m -o ImgsIndiv_" + NumberToString(aP) + "_" + NumberToString(aP+1) + "_" + std::string(" ") + StdPrefixGen(aHNameProject) + "_Homol.pto";
std::string aCom8 = "nona -z LZW -r ldr -m TIFF_m -o ImgsIndiv_" + NumberToString(aP) + "_" + std::string(" ") + StdPrefixGen(aHNameProject) + "_Homol.pto";
std::cout << "aCom8 = " << aCom8 << std::endl;
system_call(aCom8.c_str());
//~ system_call(aCom8.c_str());

//assembly for level N & level N+1
std::string aOutMosaic = "Mosaic_" + NumberToString(aP) + "_" + NumberToString(aP+1) + ".jpg";
std::string aCom9 = "enblend --compression=90 ImgsIndiv_" + NumberToString(aP) + "_" + NumberToString(aP+1) + "*.*tif -o " + aOutMosaic;
std::string aOutMosaic = "Mosaic_" + NumberToString(aP) + ".jpg";
aVOM.push_back(aOutMosaic);
std::string aCom9 = "enblend --compression=90 ImgsIndiv_" + NumberToString(aP) + "*.*tif -o " + aOutMosaic;
std::cout << "aCom9 = " << aCom9 << std::endl;
system_call(aCom9.c_str());
//~ system_call(aCom9.c_str());

//merge all in one commande
std::string aComM = aCom3
+ std::string(" ") + "&&" + std::string(" ")
+ aCom4
+ std::string(" ") + "&&" + std::string(" ")
+ aCom5
+ std::string(" ") + "&&" + std::string(" ")
+ aCom6
+ std::string(" ") + "&&" + std::string(" ")
+ aCom7
+ std::string(" ") + "&&" + std::string(" ")
+ aCom8
+ std::string(" ") + "&&" + std::string(" ")
+ aCom9;

std::cout << "aComM = " << aComM << std::endl;
aListCom.push_back(aComM);
}

cEl_GPAO::DoComInParal(aListCom,mDir);

if(aClean)
{
cInterfChantierNameManipulateur * aII = cInterfChantierNameManipulateur::BasicAlloc(mDir);
std::string aFPII = "ImgsIndiv_*.*tif";
const std::vector<std::string> * aSII = aII->Get(aFPII);
std::vector<std::string> aVII = *aSII;
std::cout << "aVII.size() = " << aVII.size() << std::endl;

for(unsigned int aC=0; aC<aVII.size(); aC++)
{
std::cout << "---> Deleting Image " << aC << " out of " << aVII.size() << " : " << aVII[aC] << std::endl;
ELISE_fp::RmFileIfExist(aVII[aC]);
}
}

//same pipeline to generate a global panoramique from each individual (level N & level N+1 pano)
for(unsigned int aL=0; aL<aVOM.size(); aL++)
{
//generate a .xml file of all individual panoramik
//~ std::list<cElFilename> aLMN;
//~ aLMN.push_back(
//~ std::string aPatL = GenPatFromLF(aLMN,false);

//compute tie points for all individual panoramik

Expand Down
2 changes: 1 addition & 1 deletion src/TpMMPD/TiePByMesh/TaskCorrel/cAppliTaskCorrel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void cAppliTaskCorrel::ExportXML(string aDirXML, Pt3dr clIni)
//====this thing is eat RAM so much ======
for (uint aKIi = 0; aKIi<mVImgs.size(); aKIi++)
{
if (aImg->Num() != aKIi)
if (aImg->Num() != int(aKIi))
aImg->Task().NameSec().push_back(mVImgs[aKIi]->Name());
}
//=========================================
Expand Down
2 changes: 1 addition & 1 deletion src/TpMMPD/TiePByMesh/TestGiang_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ int TestGiangNewHomol_Main(int argc,char ** argv)
//cout<<"Cnf : "<<aKCnf<<" - Nb Imgs : "<<aCnf->NbIm()<<" - Nb Pts : "<<aCnf->NbPts()<<endl;
std::vector<int> aVIdIm = aCnf->VIdIm();

for (uint aKPtCnf=0; aKPtCnf<aCnf->NbPts(); aKPtCnf++)
for (uint aKPtCnf=0; aKPtCnf<uint(aCnf->NbPts()); aKPtCnf++)
{
vector<Pt2dr> aVPtInter;
vector<CamStenope*> aVCamInter;
Expand Down
Loading

0 comments on commit be6d75c

Please sign in to comment.