patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

Potential issue on iOS project on xcode10.2 [no error message included] #283

Closed puleya777 closed 4 years ago

puleya777 commented 4 years ago

following three steps done: 1.add the directories listed in readme into the project 2.add the path to Header Search Paths in Building Settings 3.add opencv2 into the project but the project build fail

patrikhuber commented 4 years ago

Without an error message it's not possible to help. Please read this. (e.g. 1, 2)

puleya777 commented 4 years ago

@patrikhuber Thanks for your great work and I'm sorry to submit a bad issue for my first time using github.

I finally solved the build problems and import the library. There are two operations i did which may help someone else importing eos on Xcode for iOS: 1.rename the Block.h (and places where it's included) in the eigen library because it seems that the basic library of ios12 includes a file named Block.h too. 2.remove the msinttypes directories in the cereal library.

After getting the mesh and rendering parameters, I multiply the vertices in mesh with the modelview matrix and the project matrix. But the vertices I get can not be aligned to the input image. I found that there is another viewport matrix should be multiply according to the matlab demo. But I can not find a viewport matrix in my renderingparameters. So could you tell me what should I do to align the vertices of the mesh to the input image?

patrikhuber commented 4 years ago

@puleya777 Thanks for reporting back.

For anyone else reading this in the future, I would strongly recommend not to do above "1." and "2." - those are unnecessary changes to those projects, if include directory paths are set up properly. Eigen's headers are namespaced in the Eigen/ directory (and is #included as such in eos) and thus a file Eigen/Block.h would never produce a conflict with a iOS/system Block.h header.

With regards to your last question @puleya777, I recommend reading up on computer graphics literature (and/or OpenGL) about camera / projection models. What you're probably missing is the window transform, you can easily construct that. The projection in eos should follow the OpenGL model pretty exactly. (Also this question has been asked before, if you search the issues here, also the closed ones, you'll find some more help.)