• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Tiff_Im类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Tiff_Im的典型用法代码示例。如果您正苦于以下问题:C++ Tiff_Im类的具体用法?C++ Tiff_Im怎么用?C++ Tiff_Im使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Tiff_Im类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: MakeFCol

void MakeFCol()
{
     Tiff_Im Tif("../TMP/f3Reduc4.tif");
     Tiff_Im NewTif
             (
                 "../TMP/Col.tif",
		 Tif.sz(),
		 GenIm::u_int1,
		 Tiff_Im::No_Compr,
		 Tiff_Im::RGB, 
		   ElList<Arg_Tiff> ()
                 + Arg_Tiff(Tiff_Im::ATiles(Pt2di(1024,1024)))
		 + Arg_Tiff(Tiff_Im::APlanConf(Tiff_Im::Chunky_conf))
             );
      ELISE_COPY
      (
         Tif.all_pts(),
         its_to_rgb
         (Virgule(
              Tif.in(0),
              FX,
	      Abs((FY%512)-256)
         )),
	NewTif.out()
      );
}
开发者ID:jakexie,项目名称:micmac,代码行数:26,代码来源:b_0_49.cpp


示例2: FLoc

void cImage_LumRas::CalculShadeByDiff()
{

   mImShade.Resize(mAppli.mImGr.sz());

   std::string aNameOut = mDir+ "LumRas_"+StdPrefix(mName) + ".tif";
   Tiff_Im TifTest
           (
                 aNameOut.c_str(),
                 mIm.sz(),
                 // GenIm::u_int1,
                 GenIm::real4,
                 Tiff_Im::No_Compr,
                 Tiff_Im::BlackIsZero
           );

    Fonc_Num aFRas  =  FLoc(6,50,mIm);
    Fonc_Num aFStd  =  FLoc(6,50,mAppli.mImGr);
    Tiff_Im::Create8BFromFonc("Test-Ras.tif",mIm.sz(),aFRas*100);
    Tiff_Im::Create8BFromFonc("Test-Std.tif",mIm.sz(),aFStd*100);
// Fonc_Num     cImage_LumRas::FLoc(int aNbIter,int aSzW,Fonc_Num aF)

   ELISE_COPY(mImShade.all_pts(),(aFRas-aFStd),mImShade.out());

   ELISE_COPY
   (
      TifTest.all_pts(),
      // Max(0,Min(255,128 * (1 + 2*mImShade.in()))),
      mImShade.in(),
      TifTest.out()
   );

}
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:33,代码来源:CPP_LumRas.cpp


示例3: PartitionRenato

void PartitionRenato(int argc,char** argv)
{
    std::string aName;
    double  aPropSzW=0.1,aSeuil=75;
    double aPropExag = 0.1;
    int aNbIter = 3;
    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(aName,"Name Input"),
        LArgMain()  <<  EAM(aPropSzW,"PropSzW",true,"Prop Size of W, def =0.1")
                     <<  EAM(aSeuil,"Seuil",true,"Threshold beetween Black & White, Def=75")
    );
    

    Tiff_Im aTIn = Tiff_Im::UnivConvStd(aName);
    Pt2di aSz = aTIn.sz();
    int aSzW = round_ni((euclid(aSz)*aPropSzW) / sqrt(aNbIter));
    Im2D_REAL4 anIm0(aSz.x,aSz.y);
    Im2D_REAL4 anIm1(aSz.x,aSz.y);
    Im2D_U_INT1 aImInside(aSz.x,aSz.y,1);

    ELISE_COPY(anIm0.all_pts(),255-aTIn.in(),anIm0.out());

    int aNbF = 3;
    for (int aKF=0 ; aKF<aNbF ; aKF++)
    {
        Im2D_REAL4 anImFond(aSz.x,aSz.y);
        Fonc_Num aFIn = anIm0.in(0);
        for (int aK=0 ; aK<aNbIter ; aK++)
           aFIn = (rect_som(aFIn,aSzW)*aImInside.in(0)) / Max(1.0,rect_som(aImInside.in(0),aSzW));

       ELISE_COPY(anImFond.all_pts(),aFIn,anImFond.out());
       if (aKF == (aNbF-1))
       {
              Fonc_Num aF = anIm0.in()-anImFond.in();
              aF = aF / aSeuil;
              aF = (aF -0.1) / (1-2*aPropExag);
              aF = Max(0.0,Min(1.0,aF));
              ELISE_COPY(anIm1.all_pts(),255.0 *(1-aF),anIm1.out());
       }
       else
       {
            ELISE_COPY
            (
                 aImInside.all_pts(),
                 anIm0.in() < anImFond.in()+aSeuil,
                 aImInside.out()
            );
       }
       
    }
    


    Tiff_Im::Create8BFromFonc(std::string("Bin-")+StdPrefix(aName)+".tif",aTIn.sz(),anIm1.in());
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:57,代码来源:CPP_MPDtest.cpp


示例4:

bool MultiChannel<tData>::read_tiff( Tiff_Im &i_tiff ) // Tiff_Im is not const because of ReadVecOfIm
{
	if ( i_tiff.type_el()!=typeEl() ) return false;

	vector<Im2DGen *> tiffChannels = i_tiff.ReadVecOfIm();
	resize( i_tiff.sz().x, i_tiff.sz().y, i_tiff.nb_chan() );

	for ( size_t i=0; i<mChannels.size(); i++ )
		set( i, *(Im2D<tData,tBase>*)tiffChannels[i] );

	return true;
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:12,代码来源:MultiChannel.cpp


示例5: Write_Vignette

void Write_Vignette(string aDir, string aNameOut,vector<double> aParam,string aDirOut, Pt2di aSz){

    //Bulding the output file system
    ELISE_fp::MkDirRec(aDir + aDirOut);

    //Reading the image and creating the objects to be manipulated
    aNameOut=aDir + aDirOut + aNameOut;
    Tiff_Im aTF=Tiff_Im(aNameOut.c_str(), aSz, GenIm::real4, Tiff_Im::No_Compr, Tiff_Im::BlackIsZero);

    Im2D_REAL4  aIm(aSz.x,aSz.y);

    ELISE_COPY
    (
        aTF.all_pts(),
        aTF.in(),
        aIm.out()
    );

    REAL4 ** aData = aIm.data();

    for (int aY=0 ; aY<aSz.y  ; aY++)
        {
            for (int aX=0 ; aX<aSz.x  ; aX++)
            {
                double x0=aSz.x/2;
                double y0=aSz.y/2;
                double D=pow(aX-x0,2)+pow(aY-y0,2);
                double aCor=1+aParam[0]*D+aParam[1]*pow(D,2)+aParam[2]*pow(D,3);
                if(aCor<1){aData[aY][aX]=1;}else{aData[aY][aX]=aCor;}
            }
        }

        Tiff_Im  aTOut
        (
            aNameOut.c_str(),
            aSz,
            GenIm::real4,
            Tiff_Im::No_Compr,
            Tiff_Im::BlackIsZero
        );

        ELISE_COPY
            (
                aTOut.all_pts(),
                aIm.in(),
                aTOut.out()
            );

}
开发者ID:,项目名称:,代码行数:49,代码来源:


示例6: aSO

void  cPackObsLiaison::GetPtsTerrain
      (
          const cParamEstimPlan & aPEP,
          cSetName &                    aSelectorEstim,
          cArgGetPtsTerrain &           anArg,
          const char *                  anAttr
      )
{
    cStatObs  aSO(false);
    if ( aPEP.AttrSup().IsInit())
       anAttr =  aPEP.AttrSup().Val().c_str();
    ELISE_ASSERT
    (
         mIsMult,
         "Require PMUL for cPackObsLiaison::GetPtsTerrain"
    );
    cPonderationPackMesure aPPM = aPEP.Pond();
    aPPM.Add2Compens().SetVal(false);
    for
    (
           std::map<std::string,cObsLiaisonMultiple *>::iterator itOML=mDicoMul.begin();
           itOML!=mDicoMul.end();
           itOML++
    )
    {
          cObsLiaisonMultiple * anOLM = itOML->second;
          std::string aNameP = anOLM->Pose1()->Name();
          if (aSelectorEstim.IsSetIn(aNameP))
          {
              Im2D_Bits<1> aM(1,1);
              if (aPEP.KeyCalculMasq().IsInit())
              {
                  std::string aNameM =  
                        anAttr ?
                        mAppli.ICNM()->Assoc1To2(aPEP.KeyCalculMasq().Val(),aNameP,anAttr,true):
                        mAppli.ICNM()->StdCorrect(aPEP.KeyCalculMasq().Val(),aNameP,true);
                  aNameM = mAppli.DC() + aNameM;

                  Tiff_Im aTF = Tiff_Im::UnivConvStd(aNameM);
                  Pt2di aSz = aTF.sz();
                  aM = Im2D_Bits<1>(aSz.x,aSz.y);
                  ELISE_COPY(aTF.all_pts(),aTF.in_bool(),aM.out());
                  anArg.SetMasq(&aM);
              }
              anOLM->AddObsLM(aPPM,0,&anArg,(cArgVerifAero*)0,aSO,0);
              anArg.SetMasq(0);
          }
    }
}
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:49,代码来源:cPackObsLiaison.cpp


示例7: TestNtt

void TestNtt(const std::string &aName)
{
    Tiff_Im aTF = Tiff_Im::StdConvGen(aName,1,true);

    Pt2di aSz = aTF.sz();
    Im2D_REAL4 aI0(aSz.x,aSz.y);
    ELISE_COPY( aTF.all_pts(),aTF.in(),aI0.out());

    int aWSz=2;

    TIm2D<REAL4,REAL8> aTIm(aI0);

     double aSomGlob=0.0;
     double aNbGlob=0.0;

     for (int aKdx=-aWSz ; aKdx<=aWSz ; aKdx+=aWSz)
     {
         printf("## ");
         for (int aKdy=-aWSz ; aKdy<=aWSz ; aKdy+=aWSz)
         {
             int aDx = aKdx;
             int aDy = aKdy;
             Pt2di aDep(aDx,aDy);
             Pt2di aP;
             RMat_Inertie aMat;
             for (aP.x = aWSz ; aP.x<aSz.x-aWSz ; aP.x++)
             {
                 for (aP.y=aWSz ; aP.y<aSz.y-aWSz ; aP.y++)
                 {
                      aMat.add_pt_en_place(aTIm.get(aP),aTIm.get(aP+aDep));
                 }
             }
             double aC = aMat.correlation();
             aC = 1-aC;
             if (dist8(aDep) == aWSz)
             {
                aSomGlob += aC;
                aNbGlob ++;
             }
             printf(" %4d",round_ni(10000*(aC)));
         }
         printf("\n");
     }
     aSomGlob /= aNbGlob;
     std::cout  <<  " G:" << aSomGlob << "\n";
     printf("\n\n");
  
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:48,代码来源:CPP_MPDtest.cpp


示例8: DebugDrag

void DebugDrag()
{
   std::string aDir = "/media/data1/Jeux-Tests/Dragon-2/MEC2Im-Epi_Im1_Right_IMGP7511_IMGP7512.tif-Epi_Im2_Left_IMGP7511_IMGP7512.tif/";
   std::string aNamePx = "Px1_Num6_DeZoom2_LeChantier.tif";
   std::string aNameMasq = "AutoMask_LeChantier_Num_5.tif";

   Tiff_Im aTP = Tiff_Im::StdConv(aDir+aNamePx);
   Tiff_Im aTM = Tiff_Im::StdConv(aDir+aNameMasq);

   double aMinPx;
   ELISE_COPY
   (
        aTP.all_pts(),
        aTP.in() * aTM.in(),
        VMin(aMinPx)
   );

   std::cout << "MIN PX " << aMinPx << "\n";
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:19,代码来源:CPP_MPDtest.cpp


示例9: GetMasqSubResol

Im2D_Bits<1>  GetMasqSubResol(const std::string & aName,double aResol)
{
    Tiff_Im aTF = Tiff_Im::BasicConvStd(aName);

     Pt2di aSzF = aTF.sz();
     Pt2di aSzR = round_ni(Pt2dr(aSzF)/aResol);

     Im2D_Bits<1> aRes(aSzR.x,aSzR.y);


     Fonc_Num aFonc = aTF.in_bool_proj();
     aFonc = StdFoncChScale(aFonc,Pt2dr(0,0),Pt2dr(aResol,aResol));
     aFonc = aFonc > 0.75;

     ELISE_COPY (aRes.all_pts(), aFonc,aRes.out());




     return aRes;
}
开发者ID:,项目名称:,代码行数:21,代码来源:


示例10: Opt

void GMCube::Opt()
{ 
    REAL aCapaTot = 0;
    ElTimer aTimer;
    INT aCPT = 0;
    {
// if ((aCPT %10==0) || (aCPT>=155)) pSCA->NbChem();
           INT aCapa = pSCA->PccMaxFlow();
           aCapaTot += aCapa;

	   aCPT++;
           if ((aCPT%1 == 0) || (aCapa == 0))
                cout << "CPT " << aCPT 
		<< " Time : " << aTimer.uval() 
		<< " DCapa : " << aCapa 
                << " Som Capa = " << aCapaTot << "\n";



           {
cout << "AAAAAAAAAAA\n";
              Im2D_INT2 aZ = pSCA->Sol(0);

              Tiff_Im  aTif
                       (
                           "/home/pierrot/Data/Cox.tif",
                           mSz,
                           GenIm::u_int1,
                           Tiff_Im::No_Compr,
                           Tiff_Im::BlackIsZero 
                       );
              ELISE_COPY(aZ.all_pts(),aZ.in(),aTif.out());
              
	      ShowIm2(aZ,mW4);
cout << "BBBBBBBB\n";
	      return;
           }
    }
    
}
开发者ID:jakexie,项目名称:micmac,代码行数:40,代码来源:b_0_48_1.cpp


示例11: Virgule

void cMMTP::DoOneEnv(Im2D_REAL4 anEnvRed,Im2D_Bits<1> aNewM,bool isMax,const cXML_ParamNuage3DMaille & aTargetNuage,const cXML_ParamNuage3DMaille & aCurNuage,double aRedFact)
{
    int aSign  = isMax ? 1 : - 1;
    int aDefVal = -(aSign * 32000);


    Fonc_Num  aFMasqBin;
    Fonc_Num fChCo = Virgule(FX,FY)/ (aRedFact);
    Fonc_Num aRes = FoncChCoordWithMasq(anEnvRed.in(aDefVal),aNewM.in(0),fChCo,aDefVal,aFMasqBin);

    aRes = aRes + mDilatAlti * aSign;
    aRes  =  isMax ? rect_max(aRes,mDilatPlani)  : rect_min(aRes,mDilatPlani);
    aRes = ::AdaptDynOut(aRes,aTargetNuage,aCurNuage);

    Tiff_Im  aFileRes = FileEnv(isMax?"EnvMax":"EnvMin",false);
    ELISE_COPY(rectangle(mBoxOutEnv._p0,mBoxOutEnv._p1),trans(aRes * aFMasqBin,-mBoxInEnv._p0),aFileRes.out());

    if (isMax)
    {
        Tiff_Im  aFileMasq = FileEnv("EnvMasq",true);
        ELISE_COPY(rectangle(mBoxOutEnv._p0,mBoxOutEnv._p1),trans(aFMasqBin,-mBoxInEnv._p0),aFileMasq.out());
    }
}
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:23,代码来源:MMMaskByTP.cpp


示例12: SobelTestNtt

void SobelTestNtt(const std::string &aName)
{
    Tiff_Im aTF = Tiff_Im::StdConvGen(aName,1,true);

    Pt2di aSz = aTF.sz();
    Im2D_REAL4 aI0(aSz.x,aSz.y);
    ELISE_COPY( aTF.all_pts(),aTF.in(),aI0.out());

    Video_Win * aW=0;
    // aW = Video_Win::PtrWStd(aSz);

    if (aW)
    {
        ELISE_COPY(aW->all_pts(),Min(255,aI0.in()/256.0),aW->ogray());
        aW->clik_in();
    }
  
    Fonc_Num aF1 = sobel(aI0.in_proj());

    Fonc_Num aF2 = aI0.in_proj();
    for (int aK=0 ; aK<3 ; aK++)
        aF2 = rect_som(aF2,1) / 9.0;
    aF2 = sobel(aF2);

    if (aW)
    {
        ELISE_COPY(aW->all_pts(),Min(255, 200 * (aF1/Max(aF2,1e-7))),aW->ogray());
        aW->clik_in();
    }

    double aSF1,aSF2,aSomPts;
    ELISE_COPY(aI0.all_pts(),Virgule(aF1,aF2,1.0),Virgule(sigma(aSF1),sigma(aSF2),sigma(aSomPts)));

    std::cout << "Indice " << aSF1 / aSF2 << "\n";
  
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:36,代码来源:CPP_MPDtest.cpp


示例13: Pt2di

template <class Type> void Bench_PackB_IM<Type>::TiffVerif()
{

   Pt2di SzDalle = Pt2di(mPer,64);

    Tiff_Im  aTifFile
    (
         ELISE_BFI_DATA_DIR "ex.tif",  
         sz,
         type_of_ptr((Type *)0),
         Tiff_Im::NoByte_PackBits_Compr,
         Tiff_Im::BlackIsZero,
            L_Arg_Opt_Tiff()
           +  Arg_Tiff(Tiff_Im::ATiles(SzDalle))
    );


    

    ELISE_COPY(aTifFile.all_pts(),pck.in(),aTifFile.out());
    INT VDIF;
    ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aTifFile.in()),VMax(VDIF));

    BENCH_ASSERT(VDIF==0);

    if (type_of_ptr((Type *)0)==GenIm::u_int1)
    {
         PackB_IM<U_INT1> aPack2 = aTifFile.un_load_pack_bit_U_INT1();
         ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aPack2.in()),VMax(VDIF));
         BENCH_ASSERT(VDIF==0);
    }
    if (type_of_ptr((Type *)0)==GenIm::u_int2)
    {
         PackB_IM<U_INT2> aPack2 = aTifFile.un_load_pack_bit_U_INT2();
         ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aPack2.in()),VMax(VDIF));
         BENCH_ASSERT(VDIF==0);
    }
}
开发者ID:jakexie,项目名称:micmac,代码行数:38,代码来源:b_0_49.cpp


示例14: HomFilterMasq_main

int HomFilterMasq_main(int argc,char ** argv)
{
    // MemoArg(argc,argv);
    MMD_InitArgcArgv(argc,argv);
    std::string  aDir,aPat,aFullDir;
    bool ExpTxt=false;
    std::string PostPlan="_Masq";
    std::string KeyCalcMasq;
    std::string KeyEquivNoMasq;
    std::string MasqGlob;
    double  aResol=10;
    bool AcceptNoMask;
    std::string aPostIn= "";
    std::string aPostOut= "MasqFiltered";
    std::string aOriMasq3D,aNameMasq3D;
    cMasqBin3D * aMasq3D = 0;

    Pt2dr  aSelecTer;


    ElInitArgMain
    (
        argc,argv,
        LArgMain()  << EAMC(aFullDir,"Full name (Dir+Pat)", eSAM_IsPatFile),
        LArgMain()
                    << EAM(PostPlan,"PostPlan",true,"Post to plan, Def : toto ->toto_Masq.tif like with SaisieMasq")
                    << EAM(MasqGlob,"GlobalMasq",true,"Global Masq to add to all image")
                    << EAM(KeyCalcMasq,"KeyCalculMasq",true,"For tuning masq per image")
                    << EAM(KeyEquivNoMasq,"KeyEquivNoMasq",true,"When given if KENM(i1)==KENM(i2), don't masq")
                    << EAM(aResol,"Resol",true,"Sub Resolution for masq storing, Def=10")
                    << EAM(AcceptNoMask,"ANM",true,"Accept no mask, def = true if MasqGlob and false else")
                    << EAM(ExpTxt,"ExpTxt",true,"Ascii format for in and out, def=false")
                    << EAM(aPostIn,"PostIn",true,"Post for Input dir Hom, Def=")
                    << EAM(aPostOut,"PostOut",true,"Post for Output dir Hom, Def=MasqFiltered")
                    << EAM(aOriMasq3D,"OriMasq3D",true,"Orientation for Masq 3D")
                    << EAM(aNameMasq3D,"Masq3D",true,"File of Masq3D, Def=AperiCloud_${OriMasq3D}.ply")
                    << EAM(aSelecTer,"SelecTer",true,"[Per,Prop] Period of tiling on ground selection, Prop=proporion of selected")
    );
    bool aHasOri3D =  EAMIsInit(&aOriMasq3D);
    bool HasTerSelec = EAMIsInit(&aSelecTer);


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

    if (!EAMIsInit(&AcceptNoMask))
       AcceptNoMask = EAMIsInit(&MasqGlob) || aHasOri3D;


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

    std::string aKeyOri;
    if (aHasOri3D)
    {
        anICNM->CorrecNameOrient(aOriMasq3D);
        if (! EAMIsInit(&aNameMasq3D))
        {
              aNameMasq3D = aDir + "AperiCloud_" + aOriMasq3D + "_polyg3d.xml";
        }
        if (ELISE_fp::exist_file(aDir+aNameMasq3D))
        {
            aMasq3D = cMasqBin3D::FromSaisieMasq3d(aDir+aNameMasq3D);
        }
        else
        {
            ELISE_ASSERT(EAMIsInit(&aSelecTer),"Unused OriMasq3D");
        }
        aKeyOri = "[email protected]" + aOriMasq3D;
    }

    Im2D_Bits<1>  aImMasqGlob(1,1);
    if (EAMIsInit(&MasqGlob))
       aImMasqGlob = GetMasqSubResol(aDir+MasqGlob,aResol);


    const std::vector<std::string> *  aVN = anICNM->Get(aPat);
    std::vector<Im2D_Bits<1> >  aVMasq;

     std::vector<CamStenope *> aVCam;


    double aResolMoy = 0;

    for (int aKN = 0 ; aKN<int(aVN->size()) ; aKN++)
    {
        std::string aNameIm = (*aVN)[aKN];
        Tiff_Im aTF = Tiff_Im::StdConvGen(aNameIm,1,false);
        Pt2di aSzG = aTF.sz();
        Pt2di aSzR (round_ni(Pt2dr(aSzG)/aResol));
        Im2D_Bits<1> aImMasq(aSzR.x,aSzR.y,1);


        std::string aNameMasq = StdPrefix(aNameIm)+PostPlan + ".tif";
        if (EAMIsInit(&KeyCalcMasq))
//.........这里部分代码省略.........
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:101,代码来源:CPP_HomFilterMasq.cpp


示例15: PreparSift_Main

int PreparSift_Main(int argc,char ** argv)
{
    double aPEg = 1.0;
    double aPSrtEg = 3.0;
    double aPM = 2.0;


    std::string  aNameIn,aNameOut="Sift.tif";

    ElInitArgMain
    (
         argc,argv,
         LArgMain()  << EAMC(aNameIn,"Full name (Dir+Pattern)", eSAM_IsPatFile),
         LArgMain()  << EAM(aNameOut,"NameOut",true)
    );

    Tiff_Im aTif = Tiff_Im::StdConvGen(aNameIn,1,true);
    
    // Init Mems
    Pt2di aSz = aTif.sz();
    Im2D_U_INT2  anIm(aSz.x,aSz.y);

    Im1D_REAL8  aH(aNbH,0.0);


    // Load image
    {
       Symb_FNum aFTif(aTif.in());
       ELISE_COPY(aTif.all_pts(),aFTif,anIm.out()| (aH.histo().chc(aFTif)<<1) );
    }
    Im1D_REAL8  aHSqrt(aNbH,0.0);
    ELISE_COPY(aH.all_pts(),sqrt(aH.in()),aHSqrt.out());



    int aVMax =0;
    // Calcul Histo
    MakeFoncRepart(aH,&aVMax);
    MakeFoncRepart(aHSqrt);

    // Fonc Loc 

    Fonc_Num aFonc(Rconv(anIm.in_proj()));
    Fonc_Num aS1S2 = Virgule(aFonc,Square(aFonc));
    for (int aK=0 ; aK< TheNbIter ; aK++)
    {
        aS1S2 = rect_som(aS1S2,TheNbVois) / ElSquare(1+2*TheNbVois);
    }
    Symb_FNum aFS1 = aS1S2.v0();
    Symb_FNum aFS2 = aS1S2.v1()-Square(aFS1);
    Fonc_Num aFLoc = (anIm.in()-aFS1) / sqrt(Max(1.0,aFS2));

    // aFLoc = aFLoc * 20;
    aFLoc = atan(aFLoc) /(PI/2);

    
    // Symb_FNum aFonc(aTif.in());

    std::cout << "MaxMin "  << aVMax << "\n";

    Fonc_Num aFEg = aH.in()[anIm.in()];
    Fonc_Num aFEgS = aHSqrt.in()[anIm.in()];
    Fonc_Num aFM  = anIm.in() * (255.0 / aVMax);


    // Fonc_Num aFRes = (aFEg*aPEg + aFM * aPM + aFEgS*aPSrtEg + aFLoc) / (aPEg + aPM + aPSrtEg);

    Symb_FNum aFMoy = (aFEg*aPEg + aFM * aPM + aFEgS*aPSrtEg ) / (aPEg + aPM + aPSrtEg);
    Symb_FNum aFMarge = Min(64,Min(aFMoy,255-aFMoy));
    Fonc_Num aFRes  = aFMoy + aFMarge * aFLoc;


/*
    Fonc_Num aFRes = Max(0,Min(255,aFMoy + 60 * aFLoc));
*/

    Tiff_Im::Create8BFromFonc(aNameOut,aSz,aFRes);
    

     
    return EXIT_SUCCESS;
}
开发者ID:xialang2012,项目名称:micmac-archeos,代码行数:82,代码来源:CPP_Devlop.cpp


示例16: mVPts

cElNuageLaser::cElNuageLaser
(
     const std::string & aNameFile,
     const char *  aNameOri,
     const char *  aNameGeomCible ,
     const char *  aNameGeomInit

)  :
   mVPts (),
   mQt   (0)
{
   std::string aNameBin = StdPrefix(aNameFile) + ".tif";
   if (! ELISE_fp::exist_file(aNameBin))
   {
       INT aNb = 3;
       FILE * aFP = ElFopen(aNameFile.c_str(),"r");
       ELISE_ASSERT(aFP!=0,"Cannot Open File for Laser Data");

       char Buf[10000];
       INT aCpt =0;
       while (aNb>=3)
       {
           aNb=0;
           char * got = fgets(Buf,10000,aFP);
           Pt3dr aP;
           if (got)
           {
              aNb = sscanf(Buf,"%lf %lf %lf",&aP.x,&aP.y,&aP.z);
           }
	   if (aNb>=3)
              mVPts.push_back(aP);
	   aCpt++;
       }

       INT aNbPts = (INT) mVPts.size();
       Im2D_REAL8 aImPts(aNbPts,3);
       REAL ** aData = aImPts.data();
       for (INT aK=0 ; aK<aNbPts ; aK++)
       {
	   Pt3dr aP = mVPts[aK];
           aData[0][aK] = aP.x;
           aData[1][aK] = aP.y;
           aData[2][aK] = aP.z;
       }

       Tiff_Im aFile
	       (
                  aNameBin.c_str(),
		  Pt2di(aNbPts,3),
		  GenIm::real8,
		  Tiff_Im::No_Compr,
		  Tiff_Im::BlackIsZero,
		     Tiff_Im::Empty_ARG
		  +  Arg_Tiff(Tiff_Im::ANoStrip())
               );
       ELISE_COPY(aImPts.all_pts(),aImPts.in(),aFile.out());
   }
   else
   {
       Tiff_Im aFile(aNameBin.c_str());
       Pt2di aSz = aFile.sz();
       Im2D_REAL8 aImPts(aSz.x,aSz.y);
       ELISE_COPY(aImPts.all_pts(),aFile.in(),aImPts.out());

       REAL ** aD = aImPts.data();
       mVPts.reserve(aSz.x);
       for (INT aK=0 ; aK<aSz.x ; aK++)
       {
           Pt3dr aP(aD[0][aK],aD[1][aK],aD[2][aK]);
           mVPts.push_back(aP);
       }
   }


   Ori3D_Std * aOri = 0;
   eModeConvGeom aMode = eConvId;

   if (aNameOri)
   {
       if (!strcmp(aNameGeomInit,"GeomCarto"))
       {
           if (!strcmp(aNameGeomCible,"GeomCarto"))
           {
               aMode = eConvId;
           }
           else if (!strcmp(aNameGeomCible,"GeomTerrain"))
           {
               aMode = eConvCarto2Terr;
           }
           else if (!strcmp(aNameGeomCible,"GeomTerIm1"))
           {
               aMode = eConvCarto2TerIm;
           }
           else
           {
              ELISE_ASSERT(false,"Bad GeomCible in cElNuageLaser::cElNuageLaser");
           }
       }
       else
       {
//.........这里部分代码省略.........
开发者ID:archeos,项目名称:micmac-archeos,代码行数:101,代码来源:cElNuageLaser.cpp


示例17: TheDIRMergeEPI


//.........这里部分代码省略.........
    int     aSeuilNbV = 2 * (1+2*aSzFiltrer); // Au moins une bande de 2 pixel pour inferer qqch
    Pt2di aSzRed = round_up(Pt2dr(mSzTiep)/aStepSsEch);

    Im2D_Bits<1>    aMasqRed(aSzRed.x,aSzRed.y,0);
    TIm2DBits<1>    aTMR(aMasqRed);
/*
    TIm2D<INT2,INT> aPMaxRed(aSzRed);
    TIm2D<INT2,INT> aPMinRed(aSzRed);
*/
    TIm2D<REAL4,REAL> aPMaxRed(aSzRed);
    TIm2D<REAL4,REAL> aPMinRed(aSzRed);

    // Calcul du filtre de reduction
    Pt2di aPRed;
    for (aPRed.y = 0 ; aPRed.y<aSzRed.y ; aPRed.y++)
    {
        for (aPRed.x = 0 ; aPRed.x<aSzRed.x ; aPRed.x++)
        {
             Pt2di aPR1 = round_ni(Pt2dr(aPRed)*aStepSsEch);
             int anX0 = ElMax(0,aPR1.x-aSzFiltrer);
             int anX1 = ElMin(mSzTiep.x-1,aPR1.x+aSzFiltrer);
             int anY0 = ElMax(0,aPR1.y-aSzFiltrer);
             int anY1 = ElMin(mSzTiep.y-1,aPR1.y+aSzFiltrer);
             std::vector<REAL> aVVals;
             Pt2di aVoisR1;
             for (aVoisR1.x=anX0 ; aVoisR1.x<=anX1 ; aVoisR1.x++)
             {
                  for (aVoisR1.y=anY0 ; aVoisR1.y<=anY1 ; aVoisR1.y++)
                  {
                     if (mTImMasqInit.get(aVoisR1))
                        aVVals.push_back( mTCBT.get(aVoisR1));
                        // aVVals.push_back( mTImProf.get(aVoisR1));
                  }
             }
             if (int(aVVals.size()) >= aSeuilNbV)
             {
                  REAL4 aVMax = KthValProp(aVVals,aProp);
                  REAL4 aVMin = KthValProp(aVVals,1-aProp);
                  aPMaxRed.oset(aPRed,aVMax);
                  aPMinRed.oset(aPRed,aVMin);
                  aTMR.oset(aPRed,1);
                  ELISE_ASSERT(aVMin<=aVMax,"Mic>Max !!!! in BasicMMTiep");
             }
             else
             {
                  aPMaxRed.oset(aPRed,-32000);
                  aPMinRed.oset(aPRed, 32000);
             }
        }
    }
    //Tiff_Im::Create8BFromFonc("TDifInit.tif",aSzRed,Max(0,Min(255,Iconv(aPMaxRed._the_im.in()-aPMinRed._the_im.in()))));

    Im2D_Bits<1> aNewM(1,1);
    Im2D_REAL4  aNewMax = ProlongByCont (aNewM,aMasqRed,aPMaxRed._the_im,aDistProl,aDistAdd,aDistCum);
    Im2D_REAL4  aNewMin = ProlongByCont (aNewM,aMasqRed,aPMinRed._the_im,aDistProl,-aDistAdd,aDistCum);
    ELISE_COPY(select(aNewM.all_pts(),!aNewM.in()),0,aNewMax.out()|aNewMin.out());

    // fChCo = Virgule(FX,FY)/ (aStepSsEch * aZoomRel);
    // fMasq = aNewM.in(0)[fChCo];
    // fMasqBin = fMasq>0.5;


    mDilatPlani = ElMax(aCAEE.DilatPlaniCible().Val(),round_up(aCAEE.DilatPlaniCur().Val()*aZoomRel));
    mDilatAlti  = ElMax(aCAEE.DilatAltiCible ().Val(),round_up(aCAEE.DilatPlaniCur().Val()*aZoomRel));
    
    DoOneEnv(aNewMax,aNewM,true ,aTargetNuage,aCurNuage,aStepSsEch * aZoomRel);
    DoOneEnv(aNewMin,aNewM,false,aTargetNuage,aCurNuage,aStepSsEch * aZoomRel);


    Fonc_Num  aFMasqBin;
    Fonc_Num fChCo = Virgule(FX,FY)/ aZoomRel;

std::cout  << "ZRRRR  " << aZoomRel <<  " 1/Z " << (1/aZoomRel) 
           <<   " ;; " << mAppli.CurEtape()->DeZoomTer() << " , " << mZoomTargetEnv << "\n";
// Tiff_Im::CreateFromIm(mContBT,DirOfFile(mNameTargetEnv)+"CONTBT.tif");


    Fonc_Num aFoncProf = FoncChCoordWithMasq(mContBT.in(0),mImMasqFinal.in(0),fChCo,0,aFMasqBin);
    aFoncProf = ::AdaptDynOut(aFoncProf,aTargetNuage,aCurNuage);

    Tiff_Im aFileProf = FileEnv("Depth",false);
    ELISE_COPY(rectangle(mBoxOutEnv._p0,mBoxOutEnv._p1),trans(aFoncProf,-mBoxInEnv._p0),aFileProf.out());


    Tiff_Im aFileMasq = FileEnv("Masq",true);
    ELISE_COPY(rectangle(mBoxOutEnv._p0,mBoxOutEnv._p1),trans(aFMasqBin,-mBoxInEnv._p0),aFileMasq.out());


#ifdef ELISE_X11
   if (0 && TheWTiePCor)
   {
       ELISE_COPY(TheWTiePCor->all_pts(),aFMasqBin,TheWTiePCor->odisc());
       std::cout << "AAAAAAAAAAAAAAAAAAAAa\n";
       TheWTiePCor->clik_in();
       ELISE_COPY(TheWTiePCor->all_pts(),aFileMasq.in(),TheWTiePCor->odisc());
       std::cout << "bbBBbbBBBBBBBbbb\n";
       TheWTiePCor->clik_in();
   }
#endif
}
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:101,代码来源:MMMaskByTP.cpp


示例18: SaisieAppuisPredic

void SaisieAppuisPredic(int argc, char ** argv,
                      Pt2di &aSzW,
                      Pt2di &aNbFen,
                      std::string &aFullName,
                      std::string &aDir,
                      std::string &aName,
                      std::string &aNamePt,
                      std::string &anOri,
                      std::string &aModeOri,
                      std::string &aNameMesure,
                      std::string &aTypePts,
                      std::string &aMasq3D,
                      std::string &PIMsFilter,
                      double &aFlou,
                      bool &aForceGray,
                      double &aZMoy,
                      double &aZInc,
                      std::string & aInputSec)
{
    MMD_InitArgcArgv(argc,argv);

    ElInitArgMain
            (
                argc,argv,
                LArgMain()  << EAMC(aFullName,"Full Name (Dir+Pattern)", eSAM_IsPatFile)
                            << EAMC(anOri,"Orientation", eSAM_IsExistDirOri)
                            << EAMC(aNamePt,"File for Ground Control Points", eSAM_IsExistFile)
                            << EAMC(aNameMesure,"File for Image Measurements", eSAM_IsExistFile),
                LArgMain()  << EAM(aSzW,"SzW",true,"Size of global window (Def 800 800)")
                            << EAM(aNbFen,"NbF",true,"Number of Sub Window (Def 2 2)")
                            << EAM(aFlou,"WBlur",true,"Size IN GROUND GEOMETRY of bluring for target")
                            << EAM(aTypePts,"Type",true,"in [MaxLoc,MinLoc,GeoCube]")
                            << EAM(aForceGray,"ForceGray",true,"Force gray image, def=true")
                            << EAM(aModeOri,"OriMode", true, "Orientation type (GRID) (Def=Std)")
                            << EAM(aZMoy,"ZMoy",true,"Average Z, Mandatory in PB", eSAM_NoInit)
                            << EAM(aZInc,"ZInc",true,"Incertitude on Z, Mandatory in PB", eSAM_NoInit)
                            << EAM(aMasq3D,"Masq3D",true,"3D Masq used for visibility", eSAM_NoInit)
                            << EAM(PIMsFilter,"PIMsF",true,"PIMs filter used for visibility", eSAM_NoInit)
                            << EAM(aInputSec,"InputSec",true,"PIMs filter used for visibility", eSAM_NoInit)
                );

    if (!MMVisualMode)
    {
        aTypePts = "eNSM_" + aTypePts;

        SplitDirAndFile(aDir,aName,aFullName);


        cInterfChantierNameManipulateur * aCINM = cInterfChantierNameManipulateur::BasicAlloc(aDir);
        aCINM->CorrecNameOrient(anOri);
        const cInterfChantierNameManipulateur::tSet  *  aSet = aCINM->Get(aName);

        //std::cout << "Nb Image =" << aSet->size() << "\n";
        ELISE_ASSERT(aSet->size()!=0,"No image found");

        if (aNbFen.x<0)
        {
            if (aSet->size() == 1)
            {
                aNbFen = Pt2di(1,2);
            }
            else if (aSet->size() == 2)
            {
                Tiff_Im aTF = Tiff_Im::StdConvGen(aDir+(*aSet)[0],1,false,true);
                Pt2di aSzIm = aTF.sz();
                aNbFen = (aSzIm.x>aSzIm.y) ? Pt2di(1,2) : Pt2di(2,1);
            }
            else
            {
                aNbFen = Pt2di(2,2);
            }
        }

        aCINM->MakeStdOrient(anOri,false);
    }
}
开发者ID:jakexie,项目名称:micmac-archeos,代码行数:76,代码来源:CPP_SaisieAppuisPredic.cpp


示例19: ApplyParralaxCor_main

int ApplyParralaxCor_main(int argc, char ** argv)
{
	//std::string aNameIm, aNameIm2, aNameParallax, aNameDEM;
	std::string aNameIm, aNameParallax;
	std::string aNameOut = "";
	//Reading the arguments
	ElInitArgMain
		(
		argc, argv,
		LArgMain()
		<< EAMC(aNameIm, "Image to be corrected", eSAM_IsPatFile)
		//<< EAMC(aNameIm2, "Other image", eSAM_IsPatFile)
		<< EAMC(aNameParallax, "Paralax correction file", eSAM_IsPatFile),
		//<< EAMC(aNameDEM, "DEM file", eSAM_IsPatFile),
		LArgMain()
		<< EAM(aNameOut, "Out", true, "Name of output image (Def=ImName_corrected.tif")
		);

	std::string aDir, aPatIm;
	SplitDirAndFile(aDir, aPatIm, aNameIm);

	cout << "Correcting " << aNameIm << endl;
	if (aNameOut == "")
		aNameOut = aNameIm + "_corrected.tif";

	//Reading the image and creating the objects to be manipulated
	Tiff_Im aTF = Tiff_Im::StdConvGen(aDir + aNameIm, 1, false);

	Pt2di aSz = aTF.sz(); cout << "size of image = " << aSz << endl;
	Im2D_U_INT1  aIm(aSz.x, aSz.y);

	ELISE_COPY
		(
		aTF.all_pts(),
		aTF.in(),
		aIm.out()//Virgule(aImR.out(),aImG.out(),aImB.out())
		);

	U_INT1 ** aData = aIm.data();

	//Reading the parallax correction file
	Tiff_Im aTFPar = Tiff_Im::StdConvGen(aDir + aNameParallax, 1, false);
	Im2D_REAL8  aPar(aSz.x, aSz.y);
	ELISE_COPY
		(
		aTFPar.all_pts(),
		aTFPar.in(),
		aPar.out()//Virgule(aImR.out(),aImG.out(),aImB.out())
		);
	REAL8 ** aDatPar = aPar.data();
	

	//Output container
	Im2D_U_INT1  aImOut(aSz.x, aSz.y);
	U_INT1 ** aDataOut = aImOut.data();

	/*Things needed for RPC angle computation, not main goal of this function
	
	//Read RPCs
	RPC aRPC;
	string aNameRPC1 = "RPC_" + StdPrefix(aNameIm) + ".xml";
	aRPC.ReadDimap(aNameRPC1);
	cout << "Dimap File " << aNameRPC1 << " read" << endl;
	RPC aRPC2;
	string aNameRPC2 = "RPC_" + StdPrefix(aNameIm2) + ".xml";
	aRPC2.ReadDimap(aNameRPC2);
	cout << "Dimap File " << aNameRPC2 << " read" << endl;
	
	//Reading the DEM file
	Tiff_Im aTFDEM = Tiff_Im::StdConvGen(aDir + aNameDEM, 1, false);
	Im2D_REAL8  aDEM(aSz.x, aSz.y);
	ELISE_COPY
	(
	aTFDEM.all_pts(),
	aTFDEM.in(),
	aDEM.out()
	);
	REAL8 ** aDatDEM = aDEM.data();

	//Output angle container 1
	Im2D_REAL8  aAngleBOut(aSz.x, aSz.y);
	REAL8 ** aDataAngleBOut = aAngleBOut.data();
	string aNameAngleB = "AngleB.tif";

	//Output angle container 2
	Im2D_REAL8  aAngleNOut(aSz.x, aSz.y);
	REAL8 ** aDataAngleNOut = aAngleNOut.data();
	string aNameAngleN = "AngleN.tif";
	*/
	//Pt3dr PBTest(1500,3000, 0);
	//Pt3dr PWTest = aRPC.DirectRPC(PBTest);
	//Pt3dr PNTest = aRPC2.InverseRPC(PWTest);
	//cout << "PB0 = " << PBTest << endl;
	//cout << "PW0 = " << PWTest << endl;
	//cout << "PN0 = " << PNTest << endl;
	//cout << aRPC.height_scale << " " << aRPC.height_off << endl;
	//PBTest.z=1000;
	//PWTest = aRPC.DirectRPC(PBTest);
	//PNTest = aRPC2.InverseRPC(PWTest);
	//cout << "PB1 = " << PBTest << endl;
//.........这里部分代码省略.........
开发者ID:archeos,项目名称:micmac-archeos,代码行数:101,代码来源:CPP_ApplyParralaxCor.cpp


示例20: GrShade_main

int GrShade_main(int argc,char ** argv)
{
     std::string aNameIn;
     std::string aNameOut;
     std::string aNameCol="";
     Pt2di aP0Glob(0,0),aSzGlob(0,0);
     INT aNbDir = 20;
     REAL aFZ = 1.0;

     REAL aPdsAnis = 0.95;
     INT  aBrd = -1;
     std::string aTMNt = "real4";
     std::string aTShade = "real4";
     INT aDequant =0;
     INT aVisu = 0;
     REAL aHypsoDyn = -1.0;
     REAL aHypsoSat = 0.5;

     Pt2di aSzMaxDalles (3000,3000);
     INT aSzRecDalles = 300;
     std::string aModeOmbre="CielVu";
     std::string modeOmbre[] = {aModeOmbre,"IgnE","Local","Med","Mixte"};
     std::list<std::string> lModeOmbre(modeOmbre, modeOmbre + sizeof(modeOmbre) / sizeof(std::string) );
     std::string aFileMasq="";

     double  aDericheFact=2.0;
     int     aNbIterF = 4;
     double  aFactExp = 0.95;
     double aDyn = 1.0;
     int aNbMed = 100;
     int aNbIterMed = 1;

     Tiff_Im::SetDefTileFile(1<<15);

     std::vector<double> aVPdsFiltre;


     std::string aModeColor = "IntensShade";
     std::string modeColor[] = {aModeColor,"BackRGB","GrayBackRGB"};
     std::list<std::string> lModeColor(modeColor, modeColor + sizeof(modeColor) / sizeof(std::string) );

     double aTetaH = 25.0;
     double anAzimut = 0.0;
     double aDynMed = 1.0;

     ElInitArgMain
     (
           argc,argv,
           LArgMain() << EAMC(aNameIn, "File name", eSAM_IsExistFile) ,
           LArgMain() << EAM(aNameOut,"Out",true)
                      << EAM(aNameCol,"FileCol",true, "Color file", eSAM_IsExistFile)
                      << EAM(aVisu,"Visu",true)
                      << EAM(aP0Glob,"P0",true)
                      << EAM(aSzGlob,"Sz",true)
                      << EAM(aFZ,"FZ",true)
                      << EAM(aDynMed,"DynMed",true)
                      << EAM(aPdsAnis,"Anisotropie",true)
                      << EAM(aNbDir,"NbDir",true)
                      << EAM(aBrd,"Brd",true)
                      << EAM(aTMNt,"TypeMnt",true, "Type", eSAM_None, ListOfVal(GenIm::bits1_msbf, ""))
                      << EAM(aTShade,"TypeShade",true, "Type", eSAM_None, ListOfVal(GenIm::bits1_msbf, ""))
                      << EAM(aDequant,"Dequant",true)
                      << EAM(aHypsoDyn,"HypsoDyn",true)
                      << EAM(aHypsoSat,"HypsoSat",true)
              << EAM(aSzMaxDalles,"SzMaxDalles",true)
              << EAM(aSzRecDalles,"SzRecDalles",true)
              << EAM(aModeOmbre,"ModeOmbre",true,"in {CielVu,IgnE,Local,Med,Mixte}",eSAM_None,lModeOmbre)
              << EAM(aFileMasq,"Mask",true, "Mask file", eSAM_IsExistFile)
              << EAM(aDericheFact,"DericheFact",true)
              << EAM(aNbIterF,"NbIterF",true)
          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ Tile类代码示例发布时间:2022-05-31
下一篇:
C++ TiffIFD类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap