@@ -22,7 +22,7 @@ At the moment, it mainly provides the following functionality:
* Edge-fitting, heavily inspired by: A. Bas et al., _Fitting a 3D Morphable Model to Edges: A Comparison Between Hard and Soft Correspondences_, ACCVW 2016
* Isomap texture extraction to obtain a pose-invariant representation of the face texture
* (_Experimental_): Non-linear fitting cost functions using Ceres for shape, camera, blendshapes and the colour model (needs Ceres to be installed separately)
* (_**New**, experimental_): Python bindings for parts of the library
* (_**New**, experimental_): Python bindings for parts of the library, and Matlab bindings for the fitting
## Usage
...
...
@@ -97,6 +97,12 @@ sample = np.array(s) # the conversion from 'Mat' to a numpy array is necessary a
help(eos)#checkthedocumentation
```
## Matlab bindings
_Experimental_: eos includes Matlab bindings for the `fit_shape_and_pose(...)` function, which means the fitting can be run from Matlab. Set `-DGENERATE_MATLAB_BINDINGS=on` when running `cmake` to build the required mex-file and run the `INSTALL` target to install everything. (Set `Matlab_ROOT_DIR` to point to your Matlab directory if it's not found automatically). More bindings (e.g. the MorphableModel itself) might be added in the future.
Go to the `install/eos/matlab` directory and run [`demo.m`](https://github.com/patrikhuber/eos/blob/master/matlab/demo.m) to see how to run the fitting. The result is a mesh and rendering parameters (pose).
set(GENERATE_MATLAB_BINDINGS OFF CACHE BOOL "Build Matlab bindings. Requires Matlab with the compiler installed or the Matlab Compiler Runtime." FORCE)
# The standard find_package for boost on Win finds the dynamic libs, so for dynamic linking to boost we need to #define:
add_definitions(-DBOOST_ALL_NO_LIB)# Don't use the automatic library linking by boost with VS (#pragma ...). Instead, we specify everything here in cmake.
add_definitions(-DBOOST_ALL_DYN_LINK)# Link against the dynamic boost lib - needs to match with the version that find_package finds.
endif()
find_package(Boost 1.50.0 COMPONENTS system filesystem REQUIRED)# Why do we need boost for MorphableModel.hpp?
#[EXECUTABLE | MODULE | SHARED] # SHARED is the default.
SRC +eos/+fitting/private/fitting.cpp
OUTPUT_NAME fitting #[OUTPUT_NAME output_name]
# DOCUMENTATION +eos/+fitting/fit_shape_and_pose.m # doesn't work - wrong path probably. But it renames the file to fitting.m, so not what we want anyway.
// Not sure that's alright - who owns the data? I think as it is now, everything points to the data in the mxArray owned by Matlab, but I'm not 100% sure.