GithubHelp home page GithubHelp logo

linecode / facetracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kylemcdonald/facetracker

0.0 2.0 0.0 339 KB

Real time deformable face tracking in C++ with OpenCV 3.

License: Other

Makefile 1.02% C++ 98.98%

facetracker's Introduction

FaceTracker

FaceTracker is a library for deformable face tracking written in C++ using OpenCV 2, authored by Jason Saragih and maintained by Kyle McDonald.

It is available free for non-commercial use, and may be redistributed under these conditions. Please see license.md for complete details. For commercial use, request a quote.

FAQ

  1. "I successfully compiled the code, so why is my app is crashing?" Make sure that your model files are in the right location. If you see the error Assertion failed: s.is_open() when running your app, that means you forgot to put the model files in the right directory.
  2. "Is there an example of using FaceTracker on a mobile device?" There is no official example. But there is an example of using ofxFaceTracker on iOS here and a native Android example here.
  3. "Why is the tracking is slow, and why is there high CPU usage?" The face detection step (finding the general location of the face) can be slow. If this is causing an issue, you might want to put the tracking in a separate thread. If the detection is very slow you might try using a face detector that is native to your platform, and initializing FaceTracker with that rectangle.

Wrappers are available for:

Installation

These instructions are for compiling the code on OS X and Ubuntu, but it should be possible to compile on other platforms.

First, install OpenCV3 (if you're using OpenCV2, use the opencv2 branch of this repo). On OSX you can use homebrew:

$ brew tap homebrew/science
$ brew install homebrew

And on Ubuntu use:

$ sudo apt-get install libcv-dev libopencv-dev

Alternatively, you can download OpenCV from the GitHub and compile it manually.

After installing OpenCV, clone this repository with git clone git://github.com/kylemcdonald/FaceTracker.git. This repository contains a few subdirectories within the root directory:

  • src (contains all source code)
  • model (contains a pre-trained tracking model)
  • bin (will contain the executable after building)

Next, make sure that your copy of OpenCV is located in /usr/local (this should be the case if you used apt-get). If it isn't located there, modify the OPENCV_PATH in the Makefile. If you installed with Homebrew, it should be set to /usr/local/opt/opencv3.

Optionally, you can also add -fopenmp to the CFLAGS and -lgomp to the LIBRARIES variable to compile with OpenMP support.

From the root FaceTracker directory, build the library and example by running make.

To test the demo, cd bin and ./face_tracker. Because many webcams are 1280x720, try running ./face_tracker -s .25 to rescale the image before processing for a smoother framerate.

face_tracker Usage

Usage: face_tracker [options]
Options:
-m <string> : Tracker model (default: ../model/face2.tracker)
-c <string> : Connectivity (default: ../model/face.con)
-t <string> : Triangulation (default: ../model/face.tri)
-s <double> : Image scaling (default: 1)
-d <int>    : Frames/detections (default: -1)
--check     : Check for failure 
--help      : Print help
-?          : Print help

facetracker's People

Contributors

ieee8023 avatar kylemcdonald avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.