Esempio n. 1
0
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());
}
Esempio n. 2
0
Fonc_Num   cImage_LumRas::FMoy(int aNbIter,int aSzW,Fonc_Num aF)
{
   Fonc_Num aRes = aF;
   for (int aK=0 ; aK<aNbIter; aK++)
      aRes = rect_som(aF,aSzW) / ElSquare(1.0+2*aSzW);

   return aRes;
}
Esempio n. 3
0
Fonc_Num gauss_noise_1(INT nb)
{

    REAL nb_pts = ElSquare(2*nb+1);
    REAL moy = 0.5;
    REAL ect = 1 / sqrt(12*nb_pts);

    return rect_som(frandr()-moy,nb)/(nb_pts*ect) ;
}
Esempio n. 4
0
Im2D_U_INT1 Icone(const std::string & aName,const Pt2di & aSzCase,bool Floutage,bool Negatif)
{
   cElBitmFont & aFont = cElBitmFont::BasicFont_10x8() ;

   Im2D_Bits<1> aImBin = aFont.MultiLineImageString(aName,Pt2di(0,5),-aSzCase,0);
   ELISE_COPY(aImBin.border(3),1,aImBin.out());
   ELISE_COPY(aImBin.border(1),0,aImBin.out());

   Pt2di  aSz = aImBin.sz();
   Im2D_U_INT1 aRes(aSz.x,aSz.y);

   if (Negatif)
   {
      ELISE_COPY(line(Pt2di(0,0),aSz),1,aImBin.oclip());
      ELISE_COPY(line(Pt2di(aSz.x,0),Pt2di(0,aSz.y)),1,aImBin.oclip());
      ELISE_COPY(aImBin.all_pts(),!aImBin.in(),aImBin.out());
   }

   ELISE_COPY
   (
      aRes.all_pts(),
      (!aImBin.in(0)) *255,
      aRes.out()
   );


   if (Floutage)
   {
       ELISE_COPY
       (
            aRes.all_pts(),
            (  Negatif                                   ?
               Max(aRes.in(),rect_som(aRes.in(0),1)/9.0) :
               Min(aRes.in(),rect_som(aRes.in(0),1)/9.0)
            ),
            aRes.out()
       );

   }

   return aRes;
}
template <class Type,class TBase>  void  cElNuage3DMaille_FromImProf<Type,TBase>::ProfBouchePPV()
{
   Im2D<Type,TBase> aIPPV = BouchePPV(mIm,ImDef().in());


   int aNbTest = 7;
   for (int aK=0 ; aK< (aNbTest+2) ; aK++)
   {
       Symb_FNum aFMasq = ImDef().in();
       int aSzV = ElMax(1,ElSquare(aNbTest-aK));

       Fonc_Num aFLisse = rect_som(aIPPV.in_proj(),aSzV) /  ElSquare(1+2*aSzV);
       aFLisse  = aFLisse*(! aFMasq) + mIm.in() * aFMasq;
       ELISE_COPY(aIPPV.all_pts(),aFLisse,aIPPV.out());


   }
   ELISE_COPY(aIPPV.all_pts(),aIPPV.in(),mIm.out());
   ELISE_COPY(ImDef().all_pts(),1,ImDef().out());
}
Esempio n. 6
0
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";
  
}
int EstimFlatField_main(int argc,char ** argv)
{
    std::string aFullDir,aDir,aPat;
    std::string aNameOut;
    double aResol=1.0;
    double aDilate=1.0;
    int aNbMed = 1;
    int aNbMedSsRes = 3;
    bool ByMoy = false;
    double TolMed = 0.25;

    ElInitArgMain
    (
    argc,argv,
    LArgMain()  << EAMC(aFullDir,"Images = Dir + Pat", eSAM_IsPatFile)
                    << EAMC(aResol,"Resolution "),
    LArgMain()  << EAM(aNbMed,"NbMed",true)
                    << EAM(aNameOut,"Out",true,"Name of result")
                    << EAM(aDilate,"SousResAdd",true)
                    << EAM(aNbMedSsRes,"NbMedSsRes",true)
                    << EAM(TolMed,"TolMed",true)
                    << EAM(ByMoy,"ByMoy",true,"Average or median (def=false")
    );

    if (!MMVisualMode)
    {
    SplitDirAndFile(aDir,aPat,aFullDir);

    if (aNameOut=="")
       aNameOut = "FlatField.tif";
    aNameOut = aDir + aNameOut;

    cTplValGesInit<std::string> aTplN;
    cInterfChantierNameManipulateur * aICNM = cInterfChantierNameManipulateur::StdAlloc(0,0,aDir,aTplN);

    MakeXmlXifInfo(aFullDir,aICNM);


    std::list<std::string> aLName = aICNM->StdGetListOfFile(aPat);
    Paral_Tiff_Dev(aDir,std::vector<std::string> (aLName.begin(),aLName.end()),1,false);



    Pt2di aSzIm(-1,-1);
    double aNbPix=-1;
    Im2D_REAL4  aImIn(1,1);
    Im2D_REAL8  aFFRes1(1,1);
    Pt2di aSzF(-1,-1);


    int aNbIm = (int)aLName.size();
    int aCpt = aNbIm;

    std::vector<Im2D_REAL4> aVImRed;

    // for (std::list<std::string>::const_iterator itN=aLName.begin(); itN!=aLName.end() ; itN++)
    // for (std::list<std::string>::reverse_iterator itN=aLName.rbegin(); itN!=aLName.rend() ; itN++)
     for (std::list<std::string>::const_iterator itN=aLName.begin(); itN!=aLName.end() ; itN++)
     {
         std::cout << "To Do " << aCpt << *itN << "\n";
         Tiff_Im  aTIn = Tiff_Im::StdConvGen(aDir+*itN,1,true);
         std::string aImRefSz;
         if (aSzIm.x<0)
         {
            aImRefSz = *itN;
            aSzIm = aTIn.sz();
            aImIn = Im2D_REAL4(aSzIm.x,aSzIm.y,0.0);
            if (ByMoy)
               aFFRes1 = Im2D_REAL8(aSzIm.x,aSzIm.y,0.0);
            aNbPix = aSzIm.x*aSzIm.y;
            aSzF = round_up(Pt2dr(aSzIm)/aResol);
         }
         else
         {
             if (aSzIm!=aTIn.sz())
             {
                 std::cout << "For Image " << *itN <<  " sz=" << aTIn.sz()  << " Ref=" << aImRefSz << " Sz=" << aSzIm << "\n";
                 ELISE_ASSERT(false,"Different size");
             }
         }
         double aSom = 0;
         // ELISE_COPY(aImIn.all_pts(),aTIn.in(),aImIn.out()|sigma(aSom));

         Fonc_Num aFIN = aTIn.in();
         ELISE_COPY(aImIn.all_pts(),Rconv(aFIN),aImIn.out()|sigma(aSom));
         double aMoy = aSom/aNbPix;

         if (ByMoy)
         {
            ELISE_COPY
            (
                 aImIn.all_pts(),
                 aFFRes1.in()+(aImIn.in()/aMoy),
                 aFFRes1.out()
            );
         }
         else
         {
             Im2D_REAL4 aIRed(aSzF.x,aSzF.y);
             ELISE_COPY
             (
                   aIRed.all_pts(),
                   StdFoncChScale
                   (
                       aImIn.in_proj() / aMoy,
                       Pt2dr(0.0,0.0),
                       Pt2dr(aResol,aResol),
                       Pt2dr(aDilate,aDilate)
                   ),
                   aIRed.out()
             );
             aVImRed.push_back(aIRed);
         }

         aCpt--;
    }


    Fonc_Num aF;

    if (ByMoy)
    {

       std::cout << "Filtrage Median "<< aNbMed << "\n";
       ELISE_COPY
       (
             aFFRes1.all_pts(),
             MedianBySort(aFFRes1.in_proj()/aNbIm,aNbMed),
             aFFRes1.out()
       );


       aF =  StdFoncChScale
                   (
                       aFFRes1.in_proj() / aNbIm,
                       Pt2dr(0.0,0.0),
                       Pt2dr(aResol,aResol),
                       Pt2dr(aDilate,aDilate)
                   );
       if (aNbMedSsRes)
         aF = MedianBySort(aF,aNbMedSsRes);
    }
    else
    {
         int aMoyMed = 2;
         Im2D_REAL4 aRes = ImMediane<float,double>(aVImRed,-1e30,0.0,TolMed);
         aF = aRes.in_proj();

         for (int aK=0 ; aK<3 ; aK++)
             aF = MedianBySort(aF,4);

         for (int aK=0 ; aK<3 ; aK++)
             aF = rect_som(aF,aMoyMed)/ElSquare(1+2*aMoyMed);
    }


    Tiff_Im aTOut
            (
                 aNameOut.c_str(),
                 aSzF ,
                 GenIm::real8,
                 Tiff_Im::No_Compr,
                 Tiff_Im::BlackIsZero
             );
    ELISE_COPY
    (
         aTOut.all_pts(),
         aF,
         aTOut.out()
    );

    }

    return EXIT_SUCCESS;
}
Esempio n. 8
0
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;
}
Esempio n. 9
0
void cMMTP::ContAndBoucheTrou()
{
   int aDist32Close = 6;
   int aNbErod = 6;

   // 1- Quelques fitre morpho de base, pour calculer les points eligibles au bouche-trou
   int aLabelOut = 0;
   //int aLabelIn = 1;
   int aLabelClose = 2;
   int aLabelFront = 3;

   ELISE_COPY(mImMasqInit.all_pts(),mImMasqInit.in(),mImLabel.out());
   ELISE_COPY(mImLabel.border(2),aLabelOut,mImLabel.out());

      // 1.1 calcul des point dans le fermeture
   ELISE_COPY
   (
          select
          (
             mImLabel.all_pts(),
             close_32(mImLabel.in(0),aDist32Close) && (mImLabel.in()==aLabelOut)
          ),
          aLabelClose,
          mImLabel.out()
   );
   ELISE_COPY(mImLabel.border(2),aLabelOut,mImLabel.out());


      // 1.2 erosion de ces points
   Neighbourhood V4 = Neighbourhood::v4();
   Neighbourhood V8 = Neighbourhood::v8();
   Neigh_Rel aRelV4(V4);

   Liste_Pts_U_INT2 aLFront(2);
   ELISE_COPY
   (
          select
          (
             mImLabel.all_pts(),
             (mImLabel.in(0)==aLabelClose) &&  (aRelV4.red_max(mImLabel.in(0)==aLabelOut))
          ),
          aLabelFront,
          mImLabel.out() | aLFront
    );
    for (int aK=0 ; aK<aNbErod ; aK++)
    {
        Liste_Pts_U_INT2 aLNew(2);
        ELISE_COPY
        (
               dilate
               (
                  aLFront.all_pts(),
                  mImLabel.neigh_test_and_set(Neighbourhood::v4(),2,3,20)
               ),
               aLabelFront,
               aLNew
         );
         aLFront = aLNew;
    }
    ELISE_COPY(select(mImLabel.all_pts(),mImLabel.in()==aLabelFront),0,mImLabel.out());

    // Au cas ou on ferait un export premature
    ELISE_COPY(mImMasqFinal.all_pts(),mImLabel.in()!=0,mImMasqFinal.out());

    int aSomMaskF;
    ELISE_COPY(mImMasqFinal.all_pts(),mImLabel.in()==1,sigma(aSomMaskF));
    if (aSomMaskF < 100) return;
    // std::cout << "aSomMaskFaSomMaskF " << aSomMaskF << "\n";
   // 2- Dequantifiication, adaptee au image a trou

       Im2D_REAL4 aProfCont(mSzTiep.x,mSzTiep.y,0.0);
       {
           Im2D_INT2 aPPV = BouchePPV(mImProf,mImLabel.in()==1);

           ElImplemDequantifier aDeq(mSzTiep);
           aDeq.DoDequantif(mSzTiep,aPPV.in());
           ELISE_COPY(aProfCont.all_pts(),aDeq.ImDeqReelle(),aProfCont.out());

           ELISE_COPY(select(aProfCont.all_pts(),mImLabel.in()!=1),0,aProfCont.out());
       }

       
    //Im2D_REAL4 aImInterp(mSzTiep.x,mSzTiep.y);
    TIm2D<REAL4,REAL8> aTInterp(mContBT);

   // 3- Bouchage "fin" des trour par moinde L2
          // 3.1 Valeur initial

                 // Filtrage gaussien
    Fonc_Num aFMasq = (mImLabel.in(0)==1);
    Fonc_Num aFProf = (aProfCont.in(0) * aFMasq);
    for (int aK=0 ; aK<3 ; aK++)
    {
          aFMasq = rect_som(aFMasq,1) /9.0;
          aFProf = rect_som(aFProf,1) /9.0;
    }

    ELISE_COPY
    (
         mContBT.all_pts(),
         aFProf / Max(aFMasq,1e-9),
         mContBT.out()
    );
                 // On remet la valeur init au point ayant un valeur propre
    ELISE_COPY
    (
         select(mContBT.all_pts(),mImLabel.in()==1),
         aProfCont.in(),
         mContBT.out()
    );
             // Et rien en dehors de l'image
    ELISE_COPY
    (
         select(mContBT.all_pts(),mImLabel.in()==0),
         0,
         mContBT.out()
    );
  
  
  
  
       // 3.2 Iteration pour regulariser les points interpoles
    {
         std::vector<Pt2di> aVInterp;
         {
            Pt2di aP;
            for (aP.x=0 ; aP.x<mSzTiep.x ; aP.x++)
            {
                for (aP.y=0 ; aP.y<mSzTiep.y ; aP.y++)
                {
                   if (mTLab.get(aP)==aLabelClose)
                     aVInterp.push_back(aP);
                }
            }
         }

         for (int aKIter=0 ; aKIter<20 ; aKIter++)
         {
              std::vector<double> aVVals;
              for (int aKP=0 ; aKP<int(aVInterp.size()) ; aKP++)
              {
                   double aSom=0;
                   double aSomPds = 0;
                   Pt2di aPK = aVInterp[aKP];
                   for (int aKV=0 ; aKV<9 ; aKV++)
                   {
                         Pt2di aVois = aPK+TAB_9_NEIGH[aKV];
                         if (mTLab.get(aVois)!=0)
                         {
                             int aPds = PdsGaussl9NEIGH[aKV];
                             aSom +=  aTInterp.get(aVois) * aPds;
                             aSomPds += aPds;
                         }
                   }
                   ELISE_ASSERT(aSomPds!=0,"Assert P!=0");
                   aVVals.push_back(aSom/aSomPds);
              }
              for (int aKP=0 ; aKP<int(aVInterp.size()) ; aKP++)
              {
                 aTInterp.oset(aVInterp[aKP],aVVals[aKP]);
              }
         }
    }
    
/*
*/

#ifdef ELISE_X11
           if(0 && TheWTiePCor)
           {

              ELISE_COPY
              (
                   mImLabel.all_pts(),
                   mContBT.in()*7,
                   TheWTiePCor->ocirc()
              );
              TheWTiePCor->clik_in();
              
              ELISE_COPY
              (
                  mImLabel.all_pts(),
                  nflag_close_sym(flag_front4(mImLabel.in(0)==1)),
                  TheWTiePCor->out_graph(Line_St(TheWTiePCor->pdisc()(P8COL::black)))
              );
              TheWTiePCor->clik_in();

              ELISE_COPY
              (
                  mImLabel.all_pts(),
                  mImLabel.in(0),
                  TheWTiePCor->odisc()
              );
              TheWTiePCor->clik_in();
              ELISE_COPY
              (
                  mImLabel.all_pts(),
                  mImMasqFinal.in(0),
                  TheWTiePCor->odisc()
              );
              TheWTiePCor->clik_in();
           }
#endif
}
Esempio n. 10
0
Fonc_Num gauss_noise_4(INT nb)
{
    REAL nb_pts = ElSquare(2*nb+1);

    return rect_som(gauss_noise_3(nb),nb) /(nb_pts * 0.89);
}
Esempio n. 11
0
void bench_op_buf_cat
    (
           Pt2di szIm
    )
{

    Pt2di p0 = Pt2di(Pt2dr(szIm.x*(NRrandom3()/2.1 -0.1),szIm.y *(NRrandom3()/2.1-0.1)));
    Pt2di p1 = Pt2di(Pt2dr(szIm.x*(1.1 -NRrandom3()/2.1),szIm.y *(1.1-NRrandom3()/2.1)));
    INT fact = 50;

    Im2D_REAL8 Im1(szIm.x,szIm.y);
    Im2D_REAL8 Im2(szIm.x,szIm.y);
    ELISE_COPY
    (
         Im1.all_pts(),
         Virgule(unif_noise_4(3) * fact, unif_noise_4(3) * fact),
         Virgule(Im1.out(),Im2.out())
   );


   Box2di aBox(bench_op_buf_cat_PRand_centre(20),bench_op_buf_cat_PRand_centre(20));

    aBox._p0.SetInf(Pt2di(0,0));
    aBox._p1.SetSup(Pt2di(0,0));



    bench_op_buf_cat<INT> ((INT *)0, FX,FY,Virgule(FX,FY), p0,p1);

    Fonc_Num RFonc = Im1.in(0);
    Fonc_Num IFonc = Iconv(Im1.in(0));

    bench_op_buf_cat<INT> 
    ( 
         (INT *) 0,
         rect_som(IFonc,aBox),
         IFonc,
         rect_som(IFonc,aBox,true),
         p0,p1
    );

    bench_op_buf_cat<REAL> 
    ( 
         (REAL *) 0,
         rect_som(RFonc,aBox),
         RFonc,
         rect_som(RFonc,aBox,true),
         p0,p1
    );

    bench_op_buf_cat<REAL> 
    ( 
         (REAL *) 0,
         rect_min(RFonc,aBox),
         RFonc,
         rect_min(RFonc,aBox,true),
         p0,p1
    );

    {
       Fonc_Num f2 = Virgule(IFonc,1-IFonc,FX*1-IFonc);
       bench_op_buf_cat<INT> 
       ( 
            (INT *) 0,
            rect_max(f2,aBox),
            f2,
            rect_max(f2,aBox,true),
            p0,p1
       );
    }

    {
        Fonc_Num RhoTeta = Virgule(Im1.in(0),Im2.in(0));
        REAL Ouv  = NRrandom3();
        bool Oriented = (NRrandom3() > 0.5);
        REAL RhoCalc = 0.1 + 2.0*NRrandom3();
        bench_op_buf_cat<REAL>
        (
             (REAL *) 0,
             RMaxLocDir(RhoTeta,Ouv,Oriented,RhoCalc,false),
             RhoTeta,
             RMaxLocDir(RhoTeta,Ouv,Oriented,RhoCalc,true),
             p0,p1
        );                 
    }

    bench_op_buf_cat<INT> 
    ( 
         (INT *) 0,
         rect_median(IFonc,aBox,256),
         IFonc,
         rect_median(IFonc,aBox,256,true),
         p0,p1
    );

    {
        Fonc_Num  f2 = Virgule(IFonc,mod(IFonc*FX*FY,256));
        bench_op_buf_cat<INT> 
        ( 
             (INT *) 0,
             rect_median(f2,aBox,256),
             f2,
             rect_median(f2,aBox,256,true),
             p0,p1
        );
    }




}