本文整理汇总了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);
};
示例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);
};
示例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;
};
示例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;
};
示例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);
};
示例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;
};
示例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 */
示例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( <ime );
char* stime = ctime( <ime );
#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);
//.........这里部分代码省略.........
示例9: GetBlobByID
virtual CvBlob* GetBlobByID(int BlobID){return m_BlobList.GetBlobByID(BlobID);};
示例10: GetState
float GetState(int BlobID) {
DefTrackForDist* pF = (DefTrackForDist*)m_Tracks.GetBlobByID(BlobID);
return pF ? pF->state : 0.0f;
};
示例11: GetBlobByID
/* Additional functionality: */
CvBlob* GetBlobByID(int BlobID){return m_BlobFilterList.GetBlobByID(BlobID);}
示例12: GetState
float GetState(int BlobID)
{
DefTrackAnalyser* pF = (DefTrackAnalyser*)m_TrackAnalyserList.GetBlobByID(BlobID);
return pF?pF->state:0.f;
};