示例#1
0
CV_IMPL CvFaceTracker*
cvInitFaceTracker(CvFaceTracker* pFaceTracker, const IplImage* imgGray, CvRect* pRects, int nRects)
{
    assert(NULL != imgGray);
    assert(NULL != pRects);
    assert(nRects >= NUM_FACE_ELEMENTS);
    if ((NULL == imgGray) ||
        (NULL == pRects) ||
        (nRects < NUM_FACE_ELEMENTS))
        return NULL;

    //int new_face = 0;
    CvFaceTracker* pFace = pFaceTracker;
    if (NULL == pFace)
    {
        pFace = new CvFaceTracker;
        if (NULL == pFace)
            return NULL;
        //new_face = 1;
    }
    pFace->Init(pRects, (IplImage*)imgGray);
    return pFace;
}//CvFaceTracker* InitFaceTracker(IplImage* imgGray, CvRect* pRects, int nRects)
示例#2
0
CV_IMPL CvFaceTracker*
cvInitFaceTracker(CvFaceTracker* pFaceTracker, const IplImage* imgGray, CvRect* pRects, int nRects) {
    _ASSERT(NULL != imgGray);
    _ASSERT(NULL != pRects);
    _ASSERT(nRects >= NUM_FACE_ELEMENTS);
    if ((NULL == imgGray) ||
            (NULL == pRects) ||
            (nRects < NUM_FACE_ELEMENTS)) {
        return NULL;
    }

    int new_face = FALSE;
    CvFaceTracker* pFace = pFaceTracker;
    if (NULL == pFace) {
        pFace = new CvFaceTracker;
        if (NULL == pFace) {
            return NULL;
        }
        new_face = TRUE;
    }
    pFace->Init(pRects, (IplImage*)imgGray);
    return pFace;
}//CvFaceTracker* InitFaceTracker(IplImage* imgGray, CvRect* pRects, int nRects)