当前位置: 首页>>代码示例>>C++>>正文


C++ Tiff_Im类代码示例

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


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


注:本文中的Tiff_Im类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。