//-------------------------------------------------------------- void ofApp::setup(){ //we can now get back a list of devices. vector<ofVideoDevice> devices = vidGrabber.listDevices(); for(int i = 0; i < devices.size(); i++){ cout << devices[i].id << ": " << devices[i].deviceName; if( devices[i].bAvailable ){ cout << endl; }else{ cout << " - unavailable " << endl; } } vidGrabber.setDeviceID(1); vidGrabber.setVerbose(true); vidGrabber.initGrabber(width, height); recorded = (unsigned char*)malloc(3 * height * width * record_size); tmp = (unsigned char*)malloc(3 * height * width); back = (unsigned char*)malloc(3 * height * width); merged = (unsigned char*)malloc(3 * height * width); show = vidGrabber.getPixels(); udpConnection.Create(); udpConnection.Bind(1511); udpConnection.SetNonBlocking(true); for (int i = 0; i < trackers_cnt; i++) { tracker t = tracker(i); trackers.push_back(t); } outfile.open("/users/yui/desktop/yellow_imgs/teacher/log.txt", std::ios_base::app); }
//-------------------------------------------------------------- void testApp::setup(){ vidGrabber.setVerbose(true); vidGrabber.initGrabber(640, 480); colorImg.allocate(vidGrabber.getWidth(), vidGrabber.getHeight()); greyImage.allocate(vidGrabber.getWidth(), vidGrabber.getHeight()); greyImageSmall.allocate(120, 90); haarFinder.setup("haarcascade_frontalface_alt2.xml"); img.loadImage("stevejobs.png"); img.setAnchorPercent(0.5, 0.5); ofEnableAlphaBlending(); }