Giter Club home page Giter Club logo

4dpadcurvanalysis's Introduction

4D Curvature Analysis of Radial Stripes for Facial Behavior Research

This repository contains the official source code used to produce the results reported in the following papers:

[Facial Behavior Analysis using 4D Curvature Statistics for Presentation Attack Detection][1]
Martin Thümmel, Sven Sickert and Joachim Denzler. IEEE International Workshop on Biometrics and Forensics, 2021.

If you use this code, please cite this paper.

Table of Contents
  1. Installation
  2. 3D-Sensor Prequesites
  3. Results

1. Installation

The following commands install all requirements for Ubuntu. This code was tested with Ubuntu v18.04., dlib v19.13, PCL v1.9.1, libigl v2.1.0, Eigen v3.3.0, lz4 v1.8.2, librealsense v2.30.0 and OpenCV v4.0.0. To use the RealSense camera, you need to install

apt install libusb-1.0-0-dev

For visualizing the point cloud, you need to install

apt install libgl1-mesa-glx libgtk-3-dev libglfw3-dev libglu1-mesa-dev

and FLANN and OpenGL for PCL

apt install freeglut3-dev mesa-common-dev libflann-dev

For visualizing the temporal cross-correlation using matplotlib in C++, you need to install

apt install python-2.7 matplotlib-dev

and download matplotlibcpp.h from here to the source folder. For face and landmark localization you need to download OpenCV from here, Eigen from here, Librealsense from here, PCL from here, and Dlib from here. All of these libraries need to be installed locally e.g. in $HOME/libs. For installing PCL, you have to set WITH_VTK=FALSE.

For installing libigl, first clone the following repository to your library folder

git clone --single-branch --branch martinsChanges [email protected]:3DFaces/libigl_Martin.git

Then create a build folder inside and call cmake from this build folder as follows

cmake -D LIBIGL_USE_STATIC_LIBRARY=OFF -D LIBIGL_BUILD_TESTS=OFF -D LIBIGL_BUILD_TUTORIAL=OFF ..

To let cmake automatically find the libraries above, respective paths (PCL_DIR, OpenCV_DIR, Eigen3_DIR, dlib_DIR, LIBIGL, realsense2_DIR) need to be set properly.

As a pretrained model you need to download the dlib landmark model shape_predictor_68_face_landmarks.dat from here and set the path to this model in the source code accordingly.

Finally, python (tested: 3.7.3) with matplotlib (tested: 3.1.1) have to be installed for visualization purposes. The path to this python library and include directory must be set in the CMakeLists.txt file accordingly. For some reason, matplotlib is not working in C++ using python 3.6.

2. 3D-Sensor Prerequisites

To run an offline analysis by passing a BAG-file as an argument you need to call the program as follows:

    ./radialStripe4DCurvature [inputBagFilePath]

where inputBagFilePath is the path to the BAG-file.

Instead of the more expensive RealSense D435 you can also run the D415 version. It has a smaller field of view and a higher relative resolution for face scans at the same distance. The minimum object distance could be lower than 45 cm in case of the D435, but that is unsuited in case of face scans. The more expensive global shutter of the D435 is not required since the movement of the face and facial expressions are slow. The faceConfig.json file in the repository adjusts all recommended parameters for near-range face capturing. The object distance to the nose tip should not be much larger than the minimum distance of 45 cm to obtain the highes accuracy. The environment must be bright and nothing should occlude the face for optimal results (like glasses, large beards, scarfs or hats).

3. PAD Results

Curvature correlation time series (low for masks, high for genuine faces) Visualization of extracted radial stripes

[1]: Pre-print available at https://arxiv.org/abs/1910.06056

4dpadcurvanalysis's People

Contributors

svensickert 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.