Hey everyone
I’m building out an app using ofxFaceTracker that will take an image every time a face is found. There are no errors in the code, but during the linking phase I get an error that I am unsure how to diagnose. I originally started building this in the ofxCvHaarFinder example (why I have no idea?), I figured moving all of the files to an empty example would work in fixing it. It did not though. Anything pointing me in the right direction would be great!
Here is the error:
Here is the code
Header:
#pragma once
#include "ofMain.h"
#include "ofxCv.h"
#include "ofxFaceTracker.h"
#include "ofxFaceTrackerThreaded.h"
#include "ofxOpenCv.h"
//#include "ofxCvHaarFinder.h"
#include "ofEvents.h"
#define _USE_LIVE_VIDEO
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed(int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);
void mousePressed(int x, int y, int button);
void mouseReleased(int x, int y, int button);
void windowResized(int w, int h);
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
ofImage image;
ofxFaceTrackerThreaded camTrack;
#ifdef _USE_LIVE_VIDEO
ofVideoGrabber vidGrabber;
#else
ofVideoPlayer vidPlayer;
#endif
ofxCvColorImage colorImg;
ofxCvGrayscaleImage grayImage;
ofxCvGrayscaleImage grayBg;
ofxCvGrayscaleImage grayDiff;
ofxCvContourFinder contourFinder;
int threshold;
bool bLearnBakground;
};
setup:
#ifdef _USE_LIVE_VIDEO
vidGrabber.setDeviceID(9);
vidGrabber.setVerbose(true);
vidGrabber.initGrabber(320,240);
#else
vidPlayer.loadMovie("fingers.mov");
vidPlayer.play();
#endif
colorImg.allocate(320,240);
grayImage.allocate(320,240);
grayBg.allocate(320,240);
grayDiff.allocate(320,240);
bLearnBakground = true;
threshold = 80;
camTrack.setup();
update:
bool bNewFrame = false;
#ifdef _USE_LIVE_VIDEO
vidGrabber.grabFrame();
bNewFrame = vidGrabber.isFrameNew();
#else
vidPlayer.idleMovie();
bNewFrame = vidPlayer.isFrameNew();
#endif
if (bNewFrame){
#ifdef _USE_LIVE_VIDEO
colorImg.setFromPixels(vidGrabber.getPixels(), 320,240);
image.setFromPixels(vidGrabber.getPixels(), 320, 240, OF_IMAGE_COLOR);
#else
colorImg.setFromPixels(vidPlayer.getPixels(), 320,240);
#endif
draw:
if(camTrack.getFound()){
vidGrabber.grabFrame();
image.setFromPixels(vidGrabber.getPixels(), 320, 240, OF_IMAGE_COLOR);
image.saveImage(ofToString(ofGetElapsedTimef(), 0)+".jpg");
}
thanks guys!