コード例 #1
0
void cAppliOptimTriplet::ShowPoint(cImOfTriplet * aIm,Pt2df aP,int aCoul,int aRay)
{
     Video_Win * aW = aIm->W();
     if (aW)
     {
        Pt2dr aPr(aP.x,aP.y);
        aPr = aIm->Im()->CS()->R3toF2(PZ1(aPr));
        aW->draw_circle_abs(aPr,aRay,Line_St(aW->pdisc()(aCoul)));
     }
}
コード例 #2
0
ファイル: VisuFtm.cpp プロジェクト: archeos/micmac-archeos
void cEtalonnage::TestVisuFTM()
{
   
    INT aSzPh = 4100;
    INT aSz = 800;
    REAL aZ =  aSz / REAL(aSzPh);
    Video_Win  aW = Video_Win::WStd(Pt2di(aSzPh,aSzPh),aZ);


    std::vector<std::string> mVNames = mParam.AllImagesCibles();
    for
    (
           std::vector<string>::const_iterator iTN = mVNames.begin();
           iTN != mVNames.end();
           iTN++
    )
    {
        std::string aName = NamePointeResult(*iTN,false,true);
        cout <<  aName << "\n";
        ELISE_fp aFile(aName.c_str(),ELISE_fp::READ);
        string buf;
        bool GotEOF = false;

        while (! GotEOF)
        {
            //aFile.fgets(buf,NbBuf,GotEOF,false);
		aFile.fgets(buf,GotEOF);
            if (GotEOF)
            {
            }
            if ((!GotEOF) && (buf[0] != '#'))
            {
               INT anId;
               REAL anX,anY,aL;
               sscanf(buf.c_str(),"%d %lf %lf %lf",&anId,&anX,&anY,&aL);
               if (anId>=0)
               {
                   INT aCoul = P8COL::red;
                   if (aL > 1.0)  aCoul = P8COL::blue;
                   if (aL > 1.5)  aCoul = P8COL::green;
                   aW.draw_circle_abs
                   (
                       Pt2dr(anX,anY),
                       aL*10.0,
                       aW.pdisc()(aCoul)
                   );
               }
            }
        }

    }
    getchar();
}
コード例 #3
0
void cX11_Interface::DrawZoom(const Pt2dr & aPGlob)
{
     double aZoom = 10.0;

     Pt2dr aPIm = aPGlob- Pt2dr(mAppli->DecRech());
     Pt2dr aPMil = Pt2dr(mWZ->sz())/(2.0*aZoom);

     Video_Win aWC = mWZ->chc(aPIm-aPMil,Pt2dr(aZoom,aZoom));
     ELISE_COPY
     (
                aWC.all_pts(),
                mAppli->ImRechVisu().in(0),
                aWC.ogray()
     );

     aWC.draw_circle_abs(aPIm,4.0,Line_St(aWC.pdisc()(P8COL::blue),3.0));
}
コード例 #4
0
void cASAMG::ComputeSubset(int aNbPts,cResumNuage & aRN)
{
   Video_Win * aW = mAppli->Param().VisuLowPts().Val() ?   TheWinIm() : 0;

   double aSzCel = sqrt(double(mSz.x*mSz.y)/aNbPts);
   Pt2di aNb2C = round_up(Pt2dr(mSz)/aSzCel);
   Pt2di aPK;

   Im2D_U_INT1 anImDist(mSz.x,mSz.y);
   TIm2D<U_INT1,INT> aTDist(anImDist);
   ELISE_COPY(mMasqN.all_pts(),mMasqN.in(),anImDist.out());

   Chamfer::d32.im_dist(anImDist);


   if (aW)
   {
      ELISE_COPY(anImDist.all_pts(),mStdN->ImDef().in()!=0,aW->odisc());
      ELISE_COPY(select(anImDist.all_pts(),anImDist.in()>0),P8COL::blue,aW->odisc());
      ELISE_COPY(select(anImDist.all_pts(),anImDist.in()>10),P8COL::yellow,aW->odisc());
   }

   int aNbSomTot  = 0;
   std::vector<Pt2di> aVPts;
   std::vector<int>   aVNb;
   for (aPK.x=0 ; aPK.x<aNb2C.x ; aPK.x++)
   {
       Pt2di aP0,aP1;
       aP0.x = (aPK.x*mSz.x)     / aNb2C.x;
       aP1.x = ((aPK.x+1)*mSz.x) / aNb2C.x;
       for (aPK.y=0 ; aPK.y<aNb2C.y ; aPK.y++)
       {
           aP0.y = (aPK.y*mSz.y)     / aNb2C.y;
           aP1.y = ((aPK.y+1)*mSz.y) / aNb2C.y;

           Pt2di aP;

           Pt2dr aPMoy(0,0);
           int aNbSom=0;
           if (aW)
           {
               aW->draw_rect(Pt2dr(aP0),Pt2dr(aP1),Line_St(aW->pdisc()(P8COL::green)));
           }
           for (aP.x=aP0.x; aP.x<aP1.x ; aP.x++)
           {
               for (aP.y=aP0.y; aP.y<aP1.y ; aP.y++)
               {
                  if (mTMasqN.get(aP))
                  {
                     aPMoy = aPMoy + Pt2dr(aP);
                     aNbSom++;
                  }
               }
           }
           if (aNbSom>0)
           {
              aPMoy = aPMoy/double(aNbSom);
              double aDBest = 1e10;
              Pt2di aPBest(0,0);
              for (aP.x=aP0.x; aP.x<aP1.x ; aP.x++)
              {
                  for (aP.y=aP0.y; aP.y<aP1.y ; aP.y++)
                  {
                     if (mTMasqN.get(aP))
                     {
                        double aDist = euclid(Pt2dr(aP),aPMoy) - std::min(6,aTDist.get(aP))/1.8;

                        if (aDist<aDBest)
                        {
                           aDBest = aDist;
                           aPBest = aP;
                        }
                     }
                  }
              }
              aVPts.push_back(aPBest);
              aVNb.push_back(aNbSom);
/*
              cLinkPtFuNu aPF(aPBest.x,aPBest.y,aNbSom);
              aVPTR.push_back(aPF);
*/
              aNbSomTot += aNbSom;
              if (aW)
              {
                  aW->draw_circle_abs(Pt2dr(aPBest),3.0,aW->pdisc()(P8COL::red));
              }
           }
       }
   }

   aRN.Reset(aVPts.size());
   aRN.mNbSom = aNbSomTot;
   for (int aK=0 ; aK<int(aVPts.size()); aK++)
   {
      aRN.mVX.push_back(aVPts[aK].x);
      aRN.mVY.push_back(aVPts[aK].y);
      aRN.mVNb.push_back(aVNb[aK]);
   }

   if (aW)   
   {
       //  aW->clik_in();
   }
}