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


C++ CvBlobSeq::GetBlobByID方法代码示例

本文整理汇总了C++中CvBlobSeq::GetBlobByID方法的典型用法代码示例。如果您正苦于以下问题:C++ CvBlobSeq::GetBlobByID方法的具体用法?C++ CvBlobSeq::GetBlobByID怎么用?C++ CvBlobSeq::GetBlobByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CvBlobSeq的用法示例。


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

示例1: DelBlobByID

 virtual void    DelBlobByID(int BlobID)
 {
     DefBlobTracker* pBT = (DefBlobTracker*)m_BlobList.GetBlobByID(BlobID);
     pBT->pPredictor->Release();
     delete pBT->pBlobHyp;
     m_BlobList.DelBlobByID(BlobID);
 };
开发者ID:09beezahmad,项目名称:opencv,代码行数:7,代码来源:blobtrackingcc.cpp

示例2: DelBlobByID

 virtual void    DelBlobByID(int BlobID)
 {
     DefBlobTrackerCR* pBT = (DefBlobTrackerCR*)m_BlobList.GetBlobByID(BlobID);
     if(pBT->pResolver)pBT->pResolver->Release();
     if(pBT->pPredictor)pBT->pPredictor->Release();
     delete pBT->pBlobHyp;
     m_BlobList.DelBlobByID(BlobID);
 };
开发者ID:Barco-VCT,项目名称:VirtualClinicalTrials,代码行数:8,代码来源:blobtrackingccwithcr.cpp

示例3: AddBlob

    virtual void    AddBlob(CvBlob* pBlob)
    {
        DefBlobFilter* pF = (DefBlobFilter*)m_BlobFilterList.GetBlobByID(CV_BLOB_ID(pBlob));
        if(pF == NULL)
        {   /* Create new filter: */
            DefBlobFilter F;
            F.blob = pBlob[0];
            F.m_LastFrame = m_Frame;
            F.pFilter = m_CreatePostProc();
            TransferParamsToChild(F.pFilter,NULL);
            m_BlobFilterList.AddBlob((CvBlob*)&F);
            pF = (DefBlobFilter*)m_BlobFilterList.GetBlobByID(CV_BLOB_ID(pBlob));
        }

        assert(pF);
        pF->blob = pBlob[0];
        pF->m_LastFrame = m_Frame;
    };
开发者ID:colombc,项目名称:Sankore-ThirdParty,代码行数:18,代码来源:blobtrackpostproclist.cpp

示例4: AddBlob

    virtual void    AddBlob(CvBlob* pBlob)
    {
        DefTrackAnalyser* pF = (DefTrackAnalyser*)m_TrackAnalyserList.GetBlobByID(CV_BLOB_ID(pBlob));
        if(pF == NULL)
        {   /* Create new filter: */
            DefTrackAnalyser F;
            F.state = 0;
            F.blob = pBlob[0];
            F.m_LastFrame = m_Frame;
            F.pFilter = m_CreateAnalysis();
            m_TrackAnalyserList.AddBlob((CvBlob*)&F);
            pF = (DefTrackAnalyser*)m_TrackAnalyserList.GetBlobByID(CV_BLOB_ID(pBlob));
        }

        assert(pF);
        pF->blob = pBlob[0];
        pF->m_LastFrame = m_Frame;
    };
开发者ID:09beezahmad,项目名称:opencv,代码行数:18,代码来源:blobtrackanalysis.cpp

示例5: AddBlob

    void    AddBlob(CvBlob* pBlob) {
        DefBlobTrack* pTrack = (DefBlobTrack*)m_TrackList.GetBlobByID(CV_BLOB_ID(pBlob));

        if (pTrack == NULL) {
            /* Add new track: */
            DefBlobTrack    Track;
            Track.blob = pBlob[0];
            Track.FrameBegin = m_Frame;
            Track.pSeq = new CvBlobSeq;
            Track.Saved = 0;
            m_TrackList.AddBlob((CvBlob*)&Track);
            pTrack = (DefBlobTrack*)m_TrackList.GetBlobByID(CV_BLOB_ID(pBlob));
        }   /* Add new track. */

        assert(pTrack);
        pTrack->FrameLast = m_Frame;
        assert(pTrack->pSeq);
        pTrack->pSeq->AddBlob(pBlob);
    };
开发者ID:353,项目名称:viewercv,代码行数:19,代码来源:blobtrackgenyml.cpp

示例6: AddBlob

    /*----------------- Interface: --------------------*/
    virtual void    AddBlob(CvBlob* pBlob) {
        DefTrackForDist* pF = (DefTrackForDist*)m_Tracks.GetBlobByID(CV_BLOB_ID(pBlob));

        if (pF == NULL) {
            /* Create new TRack record: */
            DefTrackForDist F;
            F.state = 0;
            F.blob = pBlob[0];
            F.LastFrame = m_Frame;
            F.pTrack = new DefTrackRec(CV_BLOB_ID(pBlob));
            m_Tracks.AddBlob((CvBlob*)&F);
            pF = (DefTrackForDist*)m_Tracks.GetBlobByID(CV_BLOB_ID(pBlob));
        }

        assert(pF);
        assert(pF->pTrack);
        pF->pTrack->AddPoint(pBlob->x, pBlob->y, pBlob->w * 0.5f);
        pF->blob = pBlob[0];
        pF->LastFrame = m_Frame;
    };
开发者ID:353,项目名称:viewercv,代码行数:21,代码来源:blobtrackanalysistrackdist.cpp

示例7: LoadState

    virtual void LoadState(CvFileStorage* fs, CvFileNode* node)
    {
        int         b,bN = cvReadIntByName(fs,node,"BlobNum",0);
        CvFileNode* pBlobListNode = cvGetFileNodeByName(fs,node,"BlobList");
        if(!CV_NODE_IS_SEQ(pBlobListNode->tag)) return;
        bN = pBlobListNode->data.seq->total;

        for(b=0; b<bN; ++b)
        {
            DefBlobTrackerCR*   pF = NULL;
            CvBlob              Blob;
            CvFileNode*         pSeqNode = NULL;
            CvFileNode*         pBlobNode = (CvFileNode*)cvGetSeqElem(pBlobListNode->data.seq,b);
            assert(pBlobNode);

            Blob.ID = cvReadIntByName(fs,pBlobNode,"ID",0);

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "Blob");
            if(CV_NODE_IS_SEQ(pSeqNode->tag))
                cvReadRawData( fs, pSeqNode, &Blob, "ffffi" );

            AddBlob(&Blob,NULL,NULL);
            pF = (DefBlobTrackerCR*)m_BlobList.GetBlobByID(Blob.ID);

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "BlobPredict");
            if(CV_NODE_IS_SEQ(pSeqNode->tag))
                cvReadRawData( fs, pSeqNode, &pF->BlobPredict, "ffffi" );

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "BlobPrev");
            if(CV_NODE_IS_SEQ(pSeqNode->tag))
                cvReadRawData( fs, pSeqNode, &pF->BlobPrev, "ffffi" );

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "BlobHyp");
            if(pSeqNode)
                pF->pBlobHyp->Load(fs,pSeqNode);
            pF->Collision = cvReadIntByName(fs, pBlobNode,"Collision",pF->Collision);

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "Predictor");
            if(pSeqNode)
                pF->pPredictor->LoadState(fs,pSeqNode);

            pSeqNode = cvGetFileNodeByName(fs, pBlobNode, "Resolver");
            if(pSeqNode)
                pF->pResolver->LoadState(fs,pSeqNode);
        }   /* Read next blob. */
    }   /*  CCwithCR LoadState */
开发者ID:Barco-VCT,项目名称:VirtualClinicalTrials,代码行数:46,代码来源:blobtrackingccwithcr.cpp

示例8: cvGetTickCount

void CvBlobTrackerAuto1::Process(IplImage* pImg, IplImage* pMask)
{
    int         CurBlobNum = 0;
    int         i;
    IplImage*   pFG = pMask;

    /* Bump frame counter: */
    m_FrameCount++;

    if(m_TimesFile)
    {
        static int64  TickCount = cvGetTickCount();
        static double TimeSum = 0;
        static int Count = 0;
        Count++;

        if(Count%100==0)
        {
#ifndef WINCE
            time_t ltime;
            time( &ltime );
			char* stime = ctime( &ltime );
#else
			/* WINCE does not have above POSIX functions (time,ctime) */
			const char* stime = " wince ";
#endif
            FILE* out = fopen(m_TimesFile,"at");
            double Time;
            TickCount = cvGetTickCount()-TickCount;
            Time = TickCount/FREQ;
            if(out){fprintf(out,"- %sFrame: %d ALL_TIME - %f\n",stime,Count,Time/1000);fclose(out);}

            TimeSum = 0;
            TickCount = cvGetTickCount();
        }
    }

    /* Update BG model: */
    TIME_BEGIN()

    if(m_pFG)
    {   /* If FG detector is needed: */
        m_pFG->Process(pImg);
        pFG = m_pFG->GetMask();
    }   /* If FG detector is needed. */

    TIME_END("FGDetector",-1)

    m_pFGMask = pFG; /* For external use. */

    /*if(m_pFG && m_pFG->GetParam("DebugWnd") == 1)
    {// debug foreground result
        IplImage *pFG = m_pFG->GetMask();
        if(pFG)
        {
            cvNamedWindow("FG",0);
            cvShowImage("FG", pFG);
        }
    }*/

    /* Track blobs: */
    TIME_BEGIN()
    if(m_pBT)
    {
        int i;
        m_pBT->Process(pImg, pFG);

        for(i=m_BlobList.GetBlobNum(); i>0; --i)
        {   /* Update data of tracked blob list: */
            CvBlob* pB = m_BlobList.GetBlob(i-1);
            int     BlobID = CV_BLOB_ID(pB);
            int     i = m_pBT->GetBlobIndexByID(BlobID);
            m_pBT->ProcessBlob(i, pB, pImg, pFG);
            pB->ID = BlobID;
        }
        CurBlobNum = m_pBT->GetBlobNum();
    }
    TIME_END("BlobTracker",CurBlobNum)

    /* This part should be removed: */
    if(m_BTReal && m_pBT)
    {   /* Update blob list (detect new blob for real blob tracker): */
        int i;

        for(i=m_pBT->GetBlobNum(); i>0; --i)
        {   /* Update data of tracked blob list: */
            CvBlob* pB = m_pBT->GetBlob(i-1);
            if(pB && m_BlobList.GetBlobByID(CV_BLOB_ID(pB)) == NULL )
            {
                CvBlobTrackAuto     NewB;
                NewB.blob = pB[0];
                NewB.BadFrames = 0;
                m_BlobList.AddBlob((CvBlob*)&NewB);
            }
        }   /* Next blob. */

        /* Delete blobs: */
        for(i=m_BlobList.GetBlobNum(); i>0; --i)
        {   /* Update tracked-blob list: */
            CvBlob* pB = m_BlobList.GetBlob(i-1);
//.........这里部分代码省略.........
开发者ID:AlexandreFreitas,项目名称:danfreve-blinkdetection,代码行数:101,代码来源:blobtrackingauto.cpp

示例9: GetBlobByID

 virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);};
开发者ID:09beezahmad,项目名称:opencv,代码行数:1,代码来源:blobtrackingcc.cpp

示例10: GetState

 float GetState(int BlobID) {
     DefTrackForDist* pF = (DefTrackForDist*)m_Tracks.GetBlobByID(BlobID);
     return pF ? pF->state : 0.0f;
 };
开发者ID:353,项目名称:viewercv,代码行数:4,代码来源:blobtrackanalysistrackdist.cpp

示例11: GetBlobByID

 /* Additional functionality: */
 CvBlob* GetBlobByID(int BlobID){return m_BlobFilterList.GetBlobByID(BlobID);}
开发者ID:colombc,项目名称:Sankore-ThirdParty,代码行数:2,代码来源:blobtrackpostproclist.cpp

示例12: GetState

 float GetState(int BlobID)
 {
     DefTrackAnalyser* pF = (DefTrackAnalyser*)m_TrackAnalyserList.GetBlobByID(BlobID);
     return pF?pF->state:0.f;
 };
开发者ID:09beezahmad,项目名称:opencv,代码行数:5,代码来源:blobtrackanalysis.cpp


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