ofxFaceTracker2 with ofxPS3EyeGrabber


#1

Hi community!
I’m trying to use the awesome ofxFaceTracker2 by @bakercp together with the ofxPS3EyeGrabber in order to do the face tracking on the ps3 eye feed.
This should be a quite trivial task, and this is how I’m currently trying to do it:

ofApp.h

std::shared_ptr<ofVideoGrabber> grabber;
ofxFaceTracker2 tracker;
ofImage img_for_tracker;

ofApp.cpp

//--------------------------------------------------------------
void ofApp::update(){
    // Update the grabber.
    grabber->update();
    
    if (grabber->isFrameNew()){
        
        // get pixels from grabber and send them to the face tracker
        ofPixels & grabber_pixels = grabber->getGrabber<ofxPS3EyeGrabber>()->getPixels();
        
        // img_for_tracker is an ofImage
        img_for_tracker.setFromPixels(grabber_pixels);
        
        cv::Mat test = ofxCv::toCv(img_for_tracker);
        tracker.update(test);
    }
}

//--------------------------------------------------------------
void ofApp::draw(){
    ofBackground(0);
    ofSetColor(255);
    
    img_for_tracker.draw(0, 0);
    
    // Draw tracker landmarks
    tracker.drawDebug();
    
    // Draw estimated 3d pose
    tracker.drawDebugPose();
    
    // Draw text UI
    ofDrawBitmapStringHighlight("Framerate : "+ofToString(ofGetFrameRate()), 10, 20);
    ofDrawBitmapStringHighlight("Tracker thread framerate : "+ofToString(tracker.getThreadFps()), 10, 40);
}

But nothing is drawn except for the camera feed (img_for_tracker)… any hints?

Thanks