patrikhuber / 4dface

Real-time 3D face tracking and reconstruction from 2D video
https://www.4dface.io
Apache License 2.0
793 stars 248 forks source link

Build instructions for Mac OS X (using macports) #6

Open mkutny opened 8 years ago

mkutny commented 8 years ago

Just have built it on Mac using macports.

If you'd like to update the doc here are the instructions.

Step 2. sudo port install gcc5 boost eigen3 cmake

(E.g. mind different names and no need for g++, opencv-data)

Step 3.

cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DOpenCV_haarcascades_DIR=/opt/local/share/OpenCV/haarcascades/ ../4dface/

(Mind proper reference to compiler and library).

I would also mention that w/o command line parameters it uses webcam.

patrikhuber commented 8 years ago

Hey, that's really cool! Great to hear you got it to run on Mac!

Thank you very much for reporting your success back! I'll update the readme soon :-)

Thanks!

euzun commented 7 years ago

Hi,

I've tried above mac compilation many times, but it gives following errors when I try make. So, it creates makefile and others successfully, gives error on building the project.

RenderingParameters.hpp:124:12: error: no match for 'operator=' (operand types are 'glm::quat {aka glm::tquat<float, (glm::precision)0u>}' and 'glm::tmat4x4<float, (glm::precision)0u>') rotation = zxy_rotation_matrix; ^

RenderingParameters.hpp:130:12: error: no match for 'operator=' (operand types are 'glm::quat {aka glm::tquat<float, (glm::precision)0u>}' and 'glm::mat3x3 {aka glm::tmat3x3<float, (glm::precision)0u>}') rotation = ortho_params.R; // convert the rotation matrix to a quaternion

4dface.cpp:239:91: error: 'to_matrix' is not a member of 'eos::morphablemodel' auto merged_shape = morphable_model.get_shape_model().draw_sample(shape_coefficients) + morphablemodel::to_matrix(blendshapes) * Mat(blendshape_coefficients); ^

4dface.cpp:247:215: error: could not convert 'modelview_no_translation' from 'glm::tmat4x4<float, (glm::precision)0u>' to 'cv::Mat' std::tie(rendering, std::ignore) = render::render(merged_mesh, modelview_no_translation, glm::ortho(-130.0f, 130.0f, -130.0f, 130.0f), 256, 256, render::create_mipmapped_texture(merged_isomap), true, false, false); ^

Can you helm me to figure this out?

Thanks,

patrikhuber commented 7 years ago

For the last two problems, it looks like you're not using the most recent version of 4dface and eos. Update everything, including all submodules.

For the first two problems, you're probably using an old compiler? You can probably add explicit casts, i.e.: rotation = glm::quat(zxy_rotation_matrix); to fix it.

patrikhuber commented 7 years ago

I've added explicit conversions to the quaternion in 6d33d6b, so the first two errors you're getting on your compiler should be gone. I think the intent is clearer this way actually.

euzun commented 7 years ago

Thanks Patrik. I've tried on latest versions and it worked. And, works very well. Is it possible to save the 3D face as an obj file like .ply or in matlab compatible form to open and modify it later? I've tried keyboard shortcuts, but, it did not work.

Best,

patrikhuber commented 7 years ago

Cool! Yes, I think the readme mentions this, pressing "s" or so saves an OBJ. You can also use write_obj(...) manually wherever you want.

wellcomez commented 7 years ago

I can run it on mac and opencv 3.3 works well. But 4dface is so slow while fitting 3dmm model.@patrikhuber do you have any suggestion?

gsssrao commented 6 years ago

Just to add, I have tested it on my Mac and it evens works when everything is installed via homebrew.