Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mkutny opened this issue Jul 29, 2016 · 8 comments
Open

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

mkutny opened this issue Jul 29, 2016 · 8 comments

Comments

@mkutny
Copy link

mkutny commented Jul 29, 2016

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
Copy link
Owner

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
Copy link

euzun commented Nov 17, 2016

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
Copy link
Owner

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
Copy link
Owner

patrikhuber commented Nov 18, 2016

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.

@patrikhuber patrikhuber changed the title building on mac (using macports) Build instructions for Mac OS X (using macports) Nov 18, 2016
@euzun
Copy link

euzun commented Nov 18, 2016

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
Copy link
Owner

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
Copy link

wellcomez commented Sep 21, 2017

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
Copy link

gsssrao commented May 15, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants