Ejemplo n.º 1
0
cAppli_MPI2Ply::cAppli_MPI2Ply(int argc,char ** argv):
    mDS (1.0)
{
    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(mName,"Dir or PMI-Type (QuickMac ....)",eSAM_None,ListOfVal(eNbTypeMMByP)),
        LArgMain()
        << EAM(mDS,"DS",true,"Dowscale, Def=1.0")
        << EAM(mMergeOut,"Out",true,"Ply File Results")
        << EAM(mPat,"Pat",true,"Pattern for selecting images (Def=All image in files)",eSAM_IsPatFile)
    );

    if(MMVisualMode) return;

    mCFPI = new cChantierFromMPI(mName,mDS,mPat);

    mComNuageMerge =       MM3dBinFile("TestLib  MergeCloud ")
                           +   mCFPI-> mStrImOri0
                           + " ModeMerge=" + mCFPI->mStrType
                           + " DownScale=" +ToString(mDS)
                           + " SzNorm=3"
                           + " PlyCoul=true"
                           ;

    std::string aPatPly = "Nuage-Merge-" +mPat + ".*.ply";


    if (! EAMIsInit(&mMergeOut)) mMergeOut =  mCFPI->mFullDirChantier+"C3DC_"+ mCFPI->mStrType + ".ply";
    mComCatPly =  MM3dBinFile("MergePly ") + QUOTE( mCFPI->mFullDirPIm + aPatPly) + " Out="  + mMergeOut;

}
Ejemplo n.º 2
0
void detect_points(const string &aSrcFilename, const string &aDetectTool, const string &aDetectToolOptions, const string &aDstFilename)
{
	stringstream ss;
	ss << MM3dBinFile(aDetectTool) << aDetectToolOptions << ' ' << aSrcFilename << " -o " << aDstFilename;
	ElSystem(ss.str());

	if ( !ELISE_fp::exist_file(aDstFilename)) ELISE_ERROR_EXIT("failed to create points file [" << aDstFilename << "]");
	cout << '\t' << "-- points file [" << aDstFilename << "] created" << endl;
}
Ejemplo n.º 3
0
void match_points(const string &aSrcFilename0, const string &aSrcFilename1, const string &aDstFilename)
{
	stringstream ss;
	ss << MM3dBinFile("Ann") << aSrcFilename0 << ' ' << aSrcFilename1 << ' ' << aDstFilename;
	ElSystem(ss.str());

	if ( !ELISE_fp::exist_file(aDstFilename)) ELISE_ERROR_EXIT("failed to create matches file [" << aDstFilename << "]");
	cout << '\t' << "-- matches file [" << aDstFilename << "] created" << endl;
}
Ejemplo n.º 4
0
void cAppli_MPI2Mnt::DoMerge()
{

    std::string aCom =       MM3dBinFile("SMDM ")
                             +   QUOTE(mDirApp+mDirBasc + NameBascOfIm(mCFPI->mPatFilter)) + BLANK
                             +   "Out=" + mNameMerge + BLANK
                             // +   "TargetGeom=" +   mTargetGeom + BLANK

                             ;

    ExeCom(aCom);

}
Ejemplo n.º 5
0
int ChgSysCo_main(int argc,char ** argv)
{
    MMD_InitArgcArgv(argc,argv);

    std::string aFullDir= "";
    std::string AeroIn= "";
    std::string aStrChSys="";
    std::string AeroOut="";
    bool        ForceRot = false;


    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(aFullDir,"Full Directory (Dir+Pattern)", eSAM_IsPatFile)
                    << EAMC(AeroIn,"Input Orientation", eSAM_IsExistDirOri)
                    << EAMC(aStrChSys,"Change coordinate file", eSAM_IsExistFile)
                    << EAMC(AeroOut,"Output Orientation", eSAM_IsOutputDirOri),
        LArgMain()  << EAM(ForceRot,"FR",true,"Force orientation matrix to be pure rotation (Def = true)", eSAM_IsBool)
    );

    if (!MMVisualMode)
    {
        std::string aDir,aPat;
    #if (ELISE_windows)
        replace( aFullDir.begin(), aFullDir.end(), '\\', '/' );
    #endif
        SplitDirAndFile(aDir,aPat,aFullDir);
        StdCorrecNameOrient(AeroIn,aDir);

        std::cout << "DPPPP= " << aDir << " " << aPat << "\n";



        std::string aCom =       MM3dBinFile( "Apero" )
                              +  XML_MM_File("Apero-ChCo.xml")
                              +  std::string(" DirectoryChantier=") + aDir + " "
                              +  std::string(" +SetIm=") + aPat + " "
                              +  std::string(" +AeroIn=-") + AeroIn + " "
                              +  std::string(" +AeroOut=-") + AeroOut + " "
                              +  std::string(" +ChC=") + aStrChSys + " "
                              +  std::string(" +ChCFR=") + ToString(ForceRot)
                           ;


       std::cout << "COM = " << aCom << "\n";
       int aRes = system_call(aCom.c_str());
       return aRes;
    }
    else return EXIT_SUCCESS;
}
Ejemplo n.º 6
0
int MMAllAuto_main(int argc,char ** argv)
{
    MMD_InitArgcArgv(argc,argv);

    std::string  aDir,aPat,aFullDir;
    std::string  AeroIn;
    int          aZoomF = 2;


    ElInitArgMain
    (
    argc,argv,
    LArgMain()  << EAMC(aFullDir,"Dir + Pattern", eSAM_IsPatFile)
                    << EAMC(AeroIn,"Orientation", eSAM_IsExistDirOri),
    LArgMain()
                    << EAM(aZoomF,"ZoomF",true,"Zoom Final, def=2",eSAM_IsPowerOf2)
    );

#if (ELISE_windows)
    replace( aFullDir.begin(), aFullDir.end(), '\\', '/' );
#endif
    SplitDirAndFile(aDir,aPat,aFullDir);
    StdCorrecNameOrient(AeroIn,aDir);

    cInterfChantierNameManipulateur * aICNM =  cInterfChantierNameManipulateur::BasicAlloc(aDir);

    // Genere les pyramides pour que le paral ne s'ecrase pas les 1 les autres

    const cInterfChantierNameManipulateur::tSet * aSetIm = aICNM->Get(aPat);


    for (int aKIm=0 ; aKIm<int(aSetIm->size()) ; aKIm++)
    {
        std::string aCom =   MM3dBinFile("MICMAC")
                              + XML_MM_File("MM-AllAuto.xml")
                              + std::string(" WorkDir=") +aDir +  std::string(" ")
                              + std::string(" +Im1=") + QUOTE((*aSetIm)[aKIm]) + std::string(" ")
                              + std::string(" +Ori=-") + AeroIn
                              + std::string(" +ZoomF=") + ToString(aZoomF)
                    ;



        system_call(aCom.c_str());
  }

 // int aRes = system_call(aCom.c_str());


   return 0;
}
Ejemplo n.º 7
0
void cAppli_MPI2Mnt::DoMTD()
{
    std::string aCom =      MM3dBinFile("Malt ")
                            + std::string( " UrbanMNE ")
                            + std::string(" ") + mCFPI->mStrPat
                            + std::string(" ") + mCFPI->mMMI->GetOriOfEtat()
                            + mStrRep
                            + " DoMEC=0  Purge=true ZoomI=4 ZoomF=2  IncMax=1.0 " +
                            + " DirMEC=" + mDirMTD
                            + " ZoomF=" + ToString(mDeZoom)
                            ;

    ExeCom(aCom);
}
Ejemplo n.º 8
0
int CASA_main(int argc,char ** argv)
{
    std::string aNameN1;
    std::string aNameN2;
    std::string aNameN3;
    std::string aNameN4;
    std::string Out="TheCyl.xml";
    std::vector<std::string> aVPts;

    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(aNameN1,"Name of Cloud", eSAM_IsExistFile),
        LArgMain()  << EAM(Out,"Out",true,"Name of result (Def=TheCyl.xml)")
                    <<  EAM(aNameN2,"N2",true,"Name of optional second cloud", eSAM_IsExistFile)
                    <<  EAM(aNameN3,"N3",true,"Name of optional third cloud", eSAM_IsExistFile)
                    <<  EAM(aNameN4,"N4",true,"Name of optional fourth cloud", eSAM_IsExistFile)
                    <<  EAM(aVPts,"PtsOri",true,"[Pts2D.xml,Ori], points and Orientation (used for seizing) to specify surface")
     );

     if (MMVisualMode) return EXIT_SUCCESS;

     std::string aCom =   MM3dBinFile(" TestLib CASALL ")
                       + XML_MM_File("ParamCasa.xml")
                       + " +Out=" + Out
                       + " +N1=" + aNameN1;

     if (EAMIsInit(&aNameN2))
        aCom = aCom + " +UseN2=true +N2=" + aNameN2;

     if (EAMIsInit(&aNameN3))
        aCom = aCom + " +UseN3=true +N3=" + aNameN3;

     if (EAMIsInit(&aNameN4))
        aCom = aCom + " +UseN4=true +N4=" + aNameN4;

     if (EAMIsInit(&aVPts))
     {
         ELISE_ASSERT(aVPts.size()==2,"Require 2 args for PtsOri");
         aCom = aCom + " +Pts=" + aVPts[0] + " +PtsOri=" + aVPts[1] + " +UsePts=true" ;
     }

     System(aCom);

     Casa_Banniere();

     return 1;
}
Ejemplo n.º 9
0
void cAppli_MPI2Mnt::DoBascule()
{

    std::list<std::string> aLCom;



    // std::cout << "DIRAP " << mDirApp << " NBI " << mSetIm->size() << "\n";

    for (int aK=0 ; aK<int(mSetIm->size()) ; aK++)
    {
        std::string aNameIm =  (*mSetIm)[aK];
        std::string aNameBascInput = mCFPI->mFullDirPIm+   "Nuage-Depth-"+ aNameIm +  ".xml";

        if (ELISE_fp::exist_file(aNameBascInput))
        {
            std::string aCom =      MM3dBinFile("NuageBascule ")
                                    // +   mCFPI->mFullDirPIm+   "Nuage-Depth-"+ aNameIm +  ".xml" + BLANK
                                    +   aNameBascInput + BLANK
                                    +   mTargetGeom + BLANK
                                    +   mDirApp+mDirBasc + NameBascOfIm(aNameIm) + BLANK
                                    +   "Paral=0 ";

            aLCom.push_back(aCom);
            if (mDebug &&(aK<2))
                std::cout << aCom << "\n\n";
        }
    }
    if (mDebug)
    {
    }
    else
    {
        cEl_GPAO::DoComInParal(aLCom);
    }

    // SMDM

// mm3d NuageBascule "P=PIMs-MicMac/Nuage-Depth-(.*).xml" TmpPMI2Mnt/NuageImProf_STD-MALT_Etape_5.xml  "c=Bascule/Basc-\$1.xml"  Paral=0

}
Ejemplo n.º 10
0
void cAppli_MPI2Mnt::DoOrtho()
{
    std::string aCom =       MM3dBinFile("MICMAC ")
                             +    XML_MM_File("MM-PIMs2Ortho.xml") + BLANK
                             +    " +Pat=" +  mCFPI->mStrPat       + BLANK
                             +    " +Ori=" +  mCFPI->mOri                 + BLANK
                             +    " +DeZoom=" +ToString(mDeZoom)   + BLANK
                             +    " WorkDir=" + mDirApp
                             ;
    if (EAMIsInit(&mMasqImGlob)) aCom +=  " +UseGlobMasqPerIm=1  +GlobMasqPerIm="+mMasqImGlob;

    if (EAMIsInit(&mRep))
    {
        aCom +=  " +Repere="+mRep;
        if (mRepIsAnam)
            aCom += " +RepereIsAnam=true";
        else
            aCom += " +RepereIsCart=true";
    }

    ExeCom(aCom);

}
Ejemplo n.º 11
0
cAppliTarama::cAppliTarama(int argc,char ** argv) :
    cAppliWithSetImage(argc-1,argv+1,0)
{
    NoInit = "XXXXXXXXXX";

    // MemoArg(argc,argv);
    MMD_InitArgcArgv(argc,argv);
    std::string  aDir,aPat,aFullDir;
    std::string Aero;
    int  Zoom = 8;
    std::string  NOREP = "NO-REPERE";
    std::string Repere = NOREP;
    std::string DirOut = "TA";
    double   aZMoy = 0;
    int    aKNadir = -1;
    double aIncidMax = 1e5;
    bool   UnUseAXC = false;


    ElInitArgMain
    (
    argc,argv,
    LArgMain()  << EAMC(aFullDir,"Full Image (Dir+Pat)", eSAM_IsPatFile)
                    << EAMC(Aero,"Orientation", eSAM_IsExistDirOri),
    LArgMain()
                    << EAM(Zoom,"Zoom",true,"Resolution, (Def=8, must be pow of 2)",eSAM_IsPowerOf2)
                    << EAM(Repere,"Repere",true,"Local coordinate system as created with RepLocBascule",eSAM_IsExistFile)
                    << EAM(DirOut,"Out",true,"Directory for output (Deg=TA)")
                    << EAM(aZMoy,"ZMoy",true,"Average value of Z")
                    << EAM(aKNadir,"KNadir",true,"KBest image or Nadir (when exist)")
                    << EAM(aIncidMax,"IncMax",true,"Maximum incidence of image", eSAM_NoInit)
                    << EAM(UnUseAXC,"UnUseAXC",true,"Internal use for unanamorphosed ortho",eSAM_InternalUse)
    );

    if (!MMVisualMode)
    {
#if (ELISE_windows)
        replace( aFullDir.begin(), aFullDir.end(), '\\', '/' );
#endif
        SplitDirAndFile(aDir,aPat,aFullDir);

        StdCorrecNameOrient(Aero,aDir);


        MMD_InitArgcArgv(argc,argv);

        std::string aCom =  MM3dBinFile( "MICMAC" )
                + MMDir() + std::string("include/XML_MicMac/MM-TA.xml ")
                + std::string(" WorkDir=") +aDir +  std::string(" ")
                + std::string(" +PatternAllIm=") + QUOTE(aPat) + std::string(" ")
                + std::string(" +Zoom=") + ToString(Zoom)
                + std::string(" +Aero=") + Aero
                + std::string(" +DirMEC=") + DirOut
                ;

        if (EAMIsInit(&aIncidMax))
        {
            aCom = aCom + " +DoIncid=true +IncidMax=" + ToString(aIncidMax) + " " + " +ZMoy=" + ToString(AltiMoy()) + " " ;
;
        }

        if (EAMIsInit(&aKNadir))
            aCom = aCom + " +KBestMasqNadir=" + ToString(aKNadir);

        if (EAMIsInit(&aZMoy))
        {
            aCom = aCom + " +FileZMoy=File-ZMoy.xml"
                    + " +ZMoy=" + ToString(aZMoy);
        }
        if (EAMIsInit(&UnUseAXC)) aCom = aCom + " +UnUseAXC=" + ToString(UnUseAXC);

        if (Repere!=NOREP)
        {
            bool IsOrthoXCste;
            bool IsAnamXsteOfCart;
            if (RepereIsAnam(aDir+Repere,IsOrthoXCste,IsAnamXsteOfCart))
            {
                aCom =    aCom
                        +  std::string(" +DoAnam=true ")
                        +  std::string(" +DoIncid=true ")
                        +  std::string(" +ParamAnam=") + Repere;
            }
            else
            {
                aCom =     aCom    + std::string(" +Repere=") + Repere ;
            }
        }

#if (ELISE_windows)
		aCom = "\"" + aCom + "\"";
#endif		
        std::cout << "Com = " << aCom << "\n";
        mResult = system_call(aCom.c_str());

    }
    else
    {
       mResult = EXIT_SUCCESS;
    }
}
Ejemplo n.º 12
0
cAppli_C3DC::cAppli_C3DC(int argc,char ** argv,bool DoMerge) :
    cAppliWithSetImage  (argc-2,argv+2,TheFlagDev16BGray|TheFlagAcceptProblem),
    mTuning             (MPD_MM()),
    mPurge              (true),
    mPlyCoul            (true),
    mMergeOut           ("C3DC.ply"),
    mSzNorm             (3),
    mDS                 (1.0),
    mZoomF              (1),
    mDoMerge            (DoMerge),
    mMMIN               (0),
    mUseGpu	       (false),
    mArgSupEpip         (""),
    mDebugMMByP         (false)
{


#if(ELISE_QT_VERSION >= 4)

    if (MMVisualMode)
    {
        QApplication app(argc, argv);

        LArgMain LAM;
        LAM << EAMC(mStrType,"Mode",eSAM_None,ListOfVal(eNbTypeMMByP));

        std::vector <cMMSpecArg> aVA = LAM.ExportMMSpec();

        cMMSpecArg aArg = aVA[0];

        list<string> liste_valeur_enum = listPossibleValues(aArg);

        QStringList items;
        list<string>::iterator it=liste_valeur_enum.begin();
        for (; it != liste_valeur_enum.end(); ++it)
            items << QString((*it).c_str());

        setStyleSheet(app);

        bool ok = false;
        int  defaultItem = 0;

        if(argc > 1)
            defaultItem = items.indexOf(QString(argv[1]));

        QInputDialog myDialog;
        QString item = myDialog.getItem(NULL, app.applicationName(),
                                        QString (aArg.Comment().c_str()), items, defaultItem, false, &ok);

        if (ok && !item.isEmpty())
            mStrType = item.toStdString();
        else
            return;

        ReadType(mStrType);
    }
    else
    {
        ELISE_ASSERT(argc >= 2,"Not enough arg");
        ReadType(argv[1]);
    }
#else
    ELISE_ASSERT(argc >= 2,"Not enough arg");
    ReadType(argv[1]);
#endif

    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(mStrType,"Type in enumerated values", eSAM_None,ListOfVal(eNbTypeMMByP))
        << EAMC(mEASF.mFullName,"Full Name (Dir+Pattern)", eSAM_IsPatFile)
        << EAMC(mOriFull,"Orientation", eSAM_IsExistDirOri),
        LArgMain()
        << EAM(mMasq3D,"Masq3D",true,"3D masq for point selection",eSAM_IsExistFileRP)
        << EAM(mMergeOut,"Out",true,"final result (Def=C3DC.ply)")
        << EAM(mSzNorm,"SzNorm",true,"Sz of param for normal evaluation (<=0 if none, Def=2 means 5x5) ")
        << EAM(mPlyCoul,"PlyCoul",true,"Colour in ply ? (Def = true)")
        << EAM(mTuning,"Tuning",true,"Will disappear one day ...",eSAM_InternalUse)
        << EAM(mPurge,"Purge",true,"Purge result, (Def=true)")
        << EAM(mDS,"DownScale",true,"DownScale of Final result, Def depends on mode")
        << EAM(mZoomF,"ZoomF",true,"Zoom final, Def depends on mode",eSAM_IsPowerOf2)
        << EAM(mUseGpu,"UseGpu",false,"Use cuda (Def=false)")
        << EAM(mDefCor,"DefCor",true,"Def correlation, context depend")
        << EAM(mZReg,"ZReg",true,"Regularisation, context depend")
        << EAM(mFilePair,"FilePair",true,"Explicit pairs of images (as in Tapioca)", eSAM_IsExistFileRP)
        << EAM(mDebugMMByP,"DebugMMByP",true,"Debug MMByPair ...")
    );

    if (MMVisualMode) return;

    if (!EAMIsInit(&mDS))
    {
        // if (mType==eQuickMac) mDS = 2.0;
    }
    if (!EAMIsInit(&mZoomF))
    {
        if (mType==eBigMac)   mZoomF = 2;
        if (mType==eMicMac)   mZoomF = 4;
        if (mType==eQuickMac) mZoomF = 8;
        if (mType==eStatue)   mZoomF = 2;
        if (mType==eForest)   mZoomF = 4;
    }

    if (EAMIsInit(&mDefCor)) mArgSupEpip +=  " DefCor=" + ToString(mDefCor);
    if (EAMIsInit(&mZReg)) mArgSupEpip +=  " ZReg=" + ToString(mZReg);

    if (! EAMIsInit(&mMergeOut)) mMergeOut = "C3DC_"+ mStrType + ".ply";

    mStrImOri0  =  BLANK + QUOTE(mEASF.mFullName) +  BLANK + Ori() + BLANK;
    mStrImOriApSec = BLANK +  DirAndPatFileMMByP() +  BLANK + Ori() + BLANK;
    mArgMasq3D = "";
    if (EAMIsInit(&mMasq3D))
        mArgMasq3D = std::string(" Masq3D=" + mMasq3D + BLANK) ;


    //=====================================

    mBaseComMMByP =    MM3dBinFile("MMByP ")
                       +  BLANK + mStrType
                       +  mStrImOri0
                       +  mArgMasq3D
                       +  " UseGpu=" + ToString(mUseGpu);
    if (mDebugMMByP)
        mBaseComMMByP = mBaseComMMByP + " DebugMMByP=true";

    if (EAMIsInit(&mFilePair))
        mBaseComMMByP  += " FilePair=" + mFilePair;


    //=====================================
    mBaseComEnv =      MM3dBinFile("TestLib MMEnvlop ")
                       +  mStrImOriApSec
                       +  std::string(" 16 ")  + ToString(mZoomF) + " "
                       +  mArgMasq3D
                       +  std::string(" AutoPurge=") + ToString(mPurge)
                       +  " Out=" + mStrType
                       ;

    /*
    if (mTuning)
    {
       mBaseComEnv = mBaseComEnv + " DoPlyDS=true";
    }
    */

    //=====================================

    mComMerge =      MM3dBinFile("TestLib  MergeCloud ")
                     +  mStrImOri0 + " ModeMerge=" + mStrType
                     +  " DownScale=" +ToString(mDS)
                     ;

    if (mSzNorm>=0)
    {
        mComMerge = mComMerge + " SzNorm=" + ToString(1+2*mSzNorm);
    }

    mComMerge +=  " PlyCoul=" + ToString(mPlyCoul);

    mMMIN = cMMByImNM::ForGlobMerge(Dir(),mDS,mStrType);

    //=====================================

    std::string aDirFusMM = mMMIN->FullDir();

    mComCatPly =  MM3dBinFile("MergePly ") + QUOTE( aDirFusMM + ".*Merge.*ply") + " Out="  + mMergeOut;

    mStrZ0ZF = " Zoom0=" + ToString(mZoomF) + " ZoomF=" + ToString(mZoomF);
    mMMIN->SetOriOfEtat(mOri);
}
int SBGlobBascule_main(int argc,char ** argv)
{
    NoInit = "NoP1P2";
    aNoPt = Pt2dr(123456,-8765432);

    // MemoArg(argc,argv);
    MMD_InitArgcArgv(argc,argv);
    std::string  aDir,aPat,aFullDir;
    bool ExpTxt=false;
    std::string AeroIn;
    std::string AeroOut;
    std::string PostPlan="_Masq";
    std::string FileMesures ;
    std::string TargetRep = "ki" ;
    bool  CPI = false;


    double DistFE = 0;
    //Pt3dr  Normal;
    //Pt3dr  SNormal;

    ElInitArgMain
    (
    argc,argv,
    LArgMain()  << EAMC(aFullDir,"Full name (Dir+Pat)", eSAM_IsPatFile )
                    << EAMC(AeroIn,"Orientation in", eSAM_IsExistDirOri)
                    << EAMC(FileMesures,"Images measures xml file", eSAM_IsExistFile)
                    << EAMC(AeroOut,"Out : orientation ", eSAM_IsOutputDirOri),
    LArgMain()
                    << EAM(ExpTxt,"ExpTxt",true)
                    << EAM(PostPlan,"PostPlan",true)
                    << EAM(DistFE,"DistFS",true,"Distance between Ech1 and Ech2 to fix scale (if not given no scaling)")
                    << EAM(TargetRep,"Rep",true,"Target coordinate system (Def = ki, ie normal is vertical)")
                    << EAM(CPI,"CPI",true,"Calibration Per Image (Def=false)")

    );

    if (!MMVisualMode)
    {
#if (ELISE_windows)
        replace( aFullDir.begin(), aFullDir.end(), '\\', '/' );
#endif
        SplitDirAndFile(aDir,aPat,aFullDir);
        if (EAMIsInit(&PostPlan))
        {
            CorrecNameMasq(aDir,aPat,PostPlan);
        }

        StdCorrecNameOrient(AeroIn,aDir);


        MMD_InitArgcArgv(argc,argv);

        std::string aCom =   MM3dBinFile( "Apero" )
                + MMDir() + std::string("include/XML_MicMac/Apero-SB-Bascule.xml ")
                + std::string(" DirectoryChantier=") +aDir +  std::string(" ")
                + std::string(" +PatternAllIm=") + QUOTE(aPat) + std::string(" ")
                + std::string(" +AeroOut=-") +  AeroOut
                + std::string(" +Ext=") + (ExpTxt?"txt":"dat")
                + std::string(" +AeroIn=-") + AeroIn
                + std::string(" +PostMasq=") + PostPlan
                + std::string(" +DistFE=") + ToString(DistFE)
                + std::string(" +RepNL=") + TargetRep
                + std::string(" +FileMesures=") + FileMesures
                + std::string(" +CPI=") + ToString(CPI)
                ;



        std::cout << "Com = " << aCom << "\n";
        int aRes = system_call(aCom.c_str());


        return aRes;
    }
    else
    {
        return EXIT_SUCCESS;
    }
}
Ejemplo n.º 14
0
int Tawny_main(int argc,char ** argv)
{
    // MemoArg(argc,argv);
    MMD_InitArgcArgv(argc,argv);
    std::string  aDir;

    int mDeq = 1;
    Pt2di mDeqXY(-1,-1);
    bool mAddCste = false;
    int mDegRap = 0;
    Pt2di mDegRapXY(-1,-1);
    bool mRapGlobPhys = true;
    double mDynGlob=1.0;

    std::string mImPrio0 = ".*";
    int mSzV = 1;
    double mCorrThresh = 0.8;
    double mNbPerIm = 1e4;
    bool  DoL1Filter=false;

    double  aSatThresh = 1e9;
    string aNameOut="Ortho-Eg-Test-Redr.tif";

    ElInitArgMain
    (
    argc,argv,
    LArgMain()   << EAMC(aDir,"Data directory", eSAM_IsDir),
    LArgMain()   << EAM(mDeq,"DEq",true,"Degree of equalization (Def=1)")
                 << EAM(mDeqXY,"DEqXY",true,"Degree of equalization, if diff in X and Y")
                 << EAM(mAddCste,"AddCste",true,"Add unknown constant for equalization (Def=false)", eSAM_IsBool)
                 << EAM(mDegRap,"DegRap",true,"Degree of rappel to initial values, Def = 0")
                 << EAM(mDegRapXY,"DegRapXY",true,"Degree of rappel to initial values, Def = 0")
                 << EAM(mRapGlobPhys,"RGP",true,"Rappel glob on physically equalized, Def = true")
                 << EAM(mDynGlob,"DynG",true,"Global Dynamic (to correct saturation problems)")
                 << EAM(mImPrio0,"ImPrio",true,"Pattern of image with high prio, def=.*", eSAM_IsPatFile)
                 << EAM(mSzV,"SzV",true,"Sz of Window for equalization (Def=1, means 3x3)")
                 << EAM(mCorrThresh,"CorThr",true,"Threshold of correlation to validate homologous (Def 0.7)")
                 << EAM(mNbPerIm,"NbPerIm",true,"Average number of point per image (Def = 1e4)")
                 << EAM(DoL1Filter,"L1F",true,"Do L1 Filter on couple, def=true (change when process is blocked)", eSAM_IsBool)
                 << EAM(aSatThresh,"SatThresh",true,"Threshold determining saturation value (pixel >SatThresh will be ignored)")
                 << EAM(aNameOut,"Out",true,"Name of output file (in the folder)", eSAM_IsOutputFile)
    );

    if (!MMVisualMode)
    {
#if (ELISE_windows)
        replace( aDir.begin(), aDir.end(), '\\', '/' );
#endif

        if ( (!aDir.empty()) && (*aDir.rbegin() != '/') )
            aDir.append("/");

        if (! EAMIsInit(&mDeqXY))
            mDeqXY = Pt2di(mDeq,mDeq);

        if (! EAMIsInit(&mDegRapXY))
            mDegRapXY = Pt2di(mDegRap,mDegRap);

        Pt2di aDegCste = mAddCste  ? Pt2di(0,0) : Pt2di(-1,-1);

        MMD_InitArgcArgv(argc,argv);

        std::string aCom =    MM3dBinFile( "Porto" )
                + MMDir() +std::string("include/XML_MicMac/Param-Tawny.xml ")
                + std::string(" %WD=") + aDir
                + std::string(" +DR1X=") + ToString(mDeqXY.x)
                + std::string(" +DR1Y=") + ToString(mDeqXY.y)
                + std::string(" +DR0X=") + ToString(aDegCste.x)
                + std::string(" +DR0Y=") + ToString(aDegCste.y)
                + std::string(" +DegRapX=") + ToString(mDegRapXY.x)
                + std::string(" +DegRapY=") + ToString(mDegRapXY.y)
                + std::string(" +RapGlobPhys=") + ToString(mRapGlobPhys)
                + std::string(" +DynGlob=") + ToString(mDynGlob)
                + std::string(" +NameOrtho=") + aNameOut
                ;

        if (mImPrio0!="") aCom = aCom+ " +ImPrio="+QUOTE(mImPrio0);
        if (EAMIsInit(&mSzV)) aCom  = aCom + " +SzV=" + ToString(mSzV);
        if (EAMIsInit(&mNbPerIm)) aCom  = aCom + " +NbPerIm=" + ToString(mNbPerIm);
        if (EAMIsInit(&mCorrThresh)) aCom  = aCom + " +CorrThresh=" + ToString(mCorrThresh);

        if (!DoL1Filter) aCom  = aCom +" +DoL1Filter=false ";

        std::cout << aCom << "\n";
        int aRes = system_call(aCom.c_str());

        BanniereMM3D();
        return aRes;
    }
    else return EXIT_SUCCESS;
}
Ejemplo n.º 15
0
int SEL_main(int argc,char ** argv)
{
    MMD_InitArgcArgv(argc,argv);


    Pt2di aSzW(1000,900);
/*
    if (! ELISE_fp::exist_file(MMDir() + "bin/MICMACSaisieLiaisons"))
       VoidSystem("make -f MakeMICMAC  bin/MICMACSaisieLiaisons");
*/

    std::string aDir;
    std::string aN1;
    std::string aN2;
    std::string aKeyH;

    int aRedr=0;
    std::string aFilter="";
    bool aRedrL1 = false;
    bool ModeEpip = false;

    std::string aKeyCompl="Cple2HomAp";

    std::string SH="";
    ElInitArgMain
    (
           argc,argv,
           LArgMain() << EAMC(aDir,"Directory", eSAM_IsDir)
                      << EAMC(aN1,"First image name", eSAM_IsExistFile)
                      << EAMC(aN2,"Second image name", eSAM_IsExistFile) ,
           LArgMain() << EAM(aRedr,"R",true)
                      << EAM(aRedrL1,"RL1",true,"Estimate Homography using L1 mode")
                      << EAM(aFilter,"F",true)
                      << EAM(aKeyH,"KH",true,"In P PB PBR M S NB NT MMD",eSAM_None,ListOfVal(eTS_NbVals,"eTS_"))
                      << EAM(aKeyCompl,"KCpl",true)
                      << EAM(aSzW,"SzW",true)
                      << EAM(ModeEpip,"ModeEpip",true,"If mode epip, the y displacement are forced to 0")
                      << EAM(SH,"SH",true,"Homologue extenion for NB/NT mode")
    );

    if (!MMVisualMode)
    {

        std::string aCom =   MM3dBinFile("MICMACSaisieLiaisons")
                           // + MMDir()+std::string("applis/XML-Pattron/Pattron-MicMacLiaison.xml ")
                           + MMDir()+std::string("include/XML_MicMac/Pattron-MicMacLiaison.xml ")
                           + " WorkDir=" + aDir
                           + " %Im1=" + aN1
                           + " %Im2=" + aN2
                           + " %SL_XSzW=" + ToString(aSzW.x)
                           + " %SL_YSzW=" + ToString(aSzW.y)
                           + " %SL_Epip=" + ToString(ModeEpip)
                         ;

        if (aRedr)
           aCom = aCom + " SL_NewRedrCur=true";

        if (aRedrL1)
           aCom = aCom + " SL_L2Estim=false";

       if (aFilter!="")
           aCom = aCom
                  /* + " SL_TJS_FILTER=true" */
              +  " SL_FILTER=" +aFilter;

       if (aKeyH!="")
       {
           if (aKeyH=="P")
           {
              aKeyCompl = "PastisHom";
           }
           else if (aKeyH=="PB")
           {
              aKeyCompl = "Key-Assoc-CpleIm2HomolPastisBin";
           }
           else if (aKeyH=="PBR")
           {
              aKeyCompl = "Key-Assoc-SsRes-CpleIm2HomolPastisBin";
           }
           else if (aKeyH=="M")
           {
              aKeyCompl = "MarcHom";
           }
           else if (aKeyH=="S")
           {
              // aKeyCompl = "Key-Assoc-StdHom";
              aKeyCompl = "NKS-Assoc-CplIm2Hom@-Man@xml";
           }
           else if (aKeyH=="NB")
           {
              aKeyCompl = "NKS-Assoc-CplIm2Hom@"+SH+"@dat";
           }
           else if (aKeyH=="NT")
           {
              aKeyCompl = "NKS-Assoc-CplIm2Hom@"+SH+"@txt";
           }
           else if (aKeyH=="MMD")
           {
              aKeyCompl = "NKS-Assoc-CplIm2Hom@-DenseM@dat";
           }
           else
           {
               std::cout << "For Key=[" << aKeyH << "]\n";
               ELISE_ASSERT(false,"Do Not know key");
           }
       }

       aCom = aCom + " FCND_CalcHomFromI1I2=" + aKeyCompl;


        std::cout << aCom << "\n";
        Sys(aCom);
        Banniere_SEL();

        return 0;
    }
    else
        return EXIT_SUCCESS;
}
Ejemplo n.º 16
0
int CPP_AllOptimTriplet_main(int argc,char ** argv)
{
   ElTimer aChrono;
   std::string aFullPat,aNameCalib;
   bool inParal=true;
   bool Quick = false;
   std::string aPrefHom="";
   bool Debug  = false;

   ElInitArgMain
   (
        argc,argv,
        LArgMain() << EAMC(aFullPat,"Pattern"),
        LArgMain() << EAM(aNameCalib,"OriCalib",true,"Orientation for calibration ", eSAM_IsExistDirOri)
                   << EAM(inParal,"Paral",true,"Execute in parallel ", eSAM_IsBool)
                   << EAM(Quick,"Quick",true,"Quick version", eSAM_IsBool)
                   << EAM(aPrefHom,"PrefHom",true,"Prefix Homologous points, def=\"\"")
                   << EAM(Debug,"Debug",true,"Debugging mode (tuning purpose)", eSAM_IsBool)
    );

   cElemAppliSetFile anEASF(aFullPat);
   const cInterfChantierNameManipulateur::tSet * aVIm = anEASF.SetIm();

   cSetName * aSetN= anEASF.mICNM->KeyOrPatSelector(aFullPat);
   std::set<std::string> aSetName(aVIm->begin(),aVIm->end());
   std::string aDir = anEASF.mDir;

   cNewO_NameManager * aNM =  new cNewO_NameManager(aPrefHom,Quick,aDir,aNameCalib,"dat");

   cSauvegardeNamedRel aLCpl =  StdGetFromPCP(aNM->NameCpleOfTopoTriplet(true),SauvegardeNamedRel);
   std::list<std::string> aLCom;
   int aNb= 0 ;
   int aNb2 = (int)aLCpl.Cple().size();
   for (std::vector<cCpleString>::const_iterator itC=aLCpl.Cple().begin() ; itC!=aLCpl.Cple().end() ; itC++)
   {
       aNb++;
       const std::string & aN1 = itC->N1();
       const std::string & aN2 = itC->N2();
       if (aSetN->SetBasicIsIn(aN1) && aSetN->SetBasicIsIn(aN2))
       {
            std::string aCom =   MM3dBinFile("TestLib NO_OneImOptTrip") 
                            + " " + aN1
                            + " " + aN2
                            + " " + cAppliOptimTriplet::KeyCple;
            if (EAMIsInit(&aNameCalib))
               aCom +=  " OriCalib=" + aNameCalib;

            aCom += " Quick=" + ToString(Quick);
            aCom += " PrefHom=" + aPrefHom;

            if (inParal)
            {
                aLCom.push_back(aCom);
                if ((aNb%40) == 0)
                {
                    cEl_GPAO::DoComInParal(aLCom);
                    aLCom.clear();
                    std::cout << "Optim triplets Done " << aNb << " pairs out of " << aNb2  << " in " << aChrono.uval() << "\n";
                }
            }
            else
            {
                std::cout << "COM " << aCom << "\n";
                System(aCom);
            }
       }
   }
   cEl_GPAO::DoComInParal(aLCom);

   return EXIT_SUCCESS;
}
Ejemplo n.º 17
0
cAppliMMTestOrient::cAppliMMTestOrient(int argc,char ** argv)
{
    MMD_InitArgcArgv(argc,argv);

    std::string anIm1,anIm2;
    std::string AeroIn= "";
    std::string AeroInSsMinus= "";
    std::string aDir="./";
    int Zoom0=32;
    int ZoomF=2;

    double LargMin=30.0;

    bool mModePB = false;
    std::string mModeOri;
    double aZMoy,aZInc;
    bool    ShowCom = false;
    bool ExportDepl = false;
    bool mModeGB = false;

    ElInitArgMain
    (
    argc,argv,
    LArgMain()  << EAMC(anIm1,"First Image", eSAM_IsExistFile)
                    << EAMC(anIm2,"Second Image", eSAM_IsExistFile)
                    << EAMC(AeroIn,"Orientation", eSAM_IsExistFile),
    LArgMain()  << EAM(aDir,"Dir",true,"Directory, Def=./")
                    << EAM(Zoom0,"Zoom0",true,"Zoom init, pow of 2  in [128,8], Def depend of size", eSAM_IsPowerOf2)
                    << EAM(ZoomF,"ZoomF",true,"Zoom init,  pow of 2  in [4,1], Def=2",eSAM_IsPowerOf2)
                    << EAM(mModePB,"PB",true,"Push broom sensor")
                    << EAM(mModeGB,"GB",true,"Gen Bundle Mode")
                    << EAM(mModeOri,"MOri",true,"Mode Orientation (GRID or RTO), Mandatory in PB", eSAM_NoInit)
                    << EAM(aZMoy,"ZMoy",true,"Average Z, Mandatory in PB", eSAM_NoInit)
                    << EAM(aZInc,"ZInc",true,"Incertitude on Z, Mandatory in PB", eSAM_NoInit)
                    << EAM(ShowCom,"ShowCom",true,"Show MicMac command (tuning purpose)")
                    << EAM(ExportDepl,"ExportDepl",true,"Export result as displacement maps")
    );

    // cInterfChantierNameManipulateur * aICNM = cInterfChantierNameManipulateur::BasicAlloc(DirOfFile(anIm1));

    mVIms.push_back(anIm1);
    mVIms.push_back(anIm2);

    mMMV = MMVisualMode;
    if (MMVisualMode) 
    {
        return;
    }

    if (!mModePB)
    {
        StdCorrecNameOrient(AeroIn,aDir);
    }


    if (!EAMIsInit(&mModePB))
        mModePB = EAMIsInit(&mModeOri);



    std::string aFullModeOri = "eGeomImageOri";
    if (mModePB)
    {
         ELISE_ASSERT(EAMIsInit(&mModeOri) , "MOri is Mandatory in PB");
         ELISE_ASSERT(EAMIsInit(&aZMoy)    , "ZMoy is Mandatory in PB");
         ELISE_ASSERT(EAMIsInit(&aZInc)    , "ZInc is Mandatory in PB");

         if (mModeOri=="GRID")     aFullModeOri= "eGeomImageGrille";
         else if (mModeOri=="RTO") aFullModeOri= "eGeomImageRTO";
         else  {ELISE_ASSERT(false,"Unknown mode ori");}
    }

    if (mModeGB)
    {
         ELISE_ASSERT(EAMIsInit(&aZMoy)    , "ZMoy is Mandatory in GB");
         ELISE_ASSERT(EAMIsInit(&aZInc)    , "ZInc is Mandatory in GB");
         aFullModeOri= "eGeomGen";

    }

// eGeomImageRTO
// eGeomImageGrille

    if (! EAMIsInit(&Zoom0))
    {
         Zoom0 = FixSizeImage(128,aDir+anIm1,LargMin,4);
    }

#if (ELISE_windows)
     replace( aDir.begin(), aDir.end(), '\\', '/' );
#endif




   mCom =     MM3dBinFile( "MICMAC" ) + " "
                       +  Basic_XML_MM_File("MM-PxTransv.xml")
                       +  std::string(" WorkDir=") + aDir + " "
                       +  std::string(" +Im1=") + QUOTE(anIm1) + " "
                       +  std::string(" +Im2=") + QUOTE(anIm2) + " "
                       +  std::string(" +AeroIn=-") + AeroIn + " "
                       +  std::string(" +AeroInSsMinus=") + AeroIn + " "
                       +  std::string(" +Zoom0=") + ToString(Zoom0) + " "
                       +  std::string(" +ZoomF=") + ToString(ZoomF) + " "
                      ;

    if (mModePB)
    {
         mCom = mCom + " +Conik=false "
                     +  " +ModeOriIm=" + aFullModeOri + std::string(" ")
                     + " +PostFixOri=" + AeroIn     + std::string(" ")
                     + " +Px1Inc=" + ToString(aZInc) + std::string(" ")
                     + " +Px1Moy=" + ToString(aZMoy) + std::string(" ") ;
    }
    if (mModeGB)
    {
         mCom = mCom + " +Conik=false "
                     + " +UseGenBundle=true"
                     + " +ModeOriIm=" + aFullModeOri + std::string(" ")
                     + " +Px1Inc=" + ToString(aZInc) + std::string(" ")
                     + " +Px1Moy=" + ToString(aZMoy) + std::string(" ") ;
    }

    if (ShowCom) std::cout << mCom << "\n";


   if (ExportDepl) mCom = mCom + " +ExporFieldsHom=true ";
}