Giter VIP home page Giter VIP logo

meshmonk's Introduction

Note

This project is now maintained at KU Leuven GitLab: https://gitlab.kuleuven.be/mirc/meshmonk

Installing meshmonk

MeshMonk can be built and installed on:

Using meshmonk

From Matlab

The following toolboxes are required from Matlab:

  • Statistics and Machine Learning Toolbox
  • Image Processing Toolbox

Setting Environment Variables

Ubuntu

Setting the library paths inside Matlab has some unresolved problems. It seems overwriting the library paths to use inside matlab doesn't work. So instead, we'll preload the necessary libs when starting Matlab:

So start matlab from the terminal with the command LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/local/lib/libmeshmonk.so:/usr/local/lib/libOpenMeshCore.so:/usr/local/lib/libOpenMeshTools.so matlab to make sure all the libraries are loaded.

Mac OSX

Add two lines to your startup.m file:

p = ['usr/local/lib/'];
setenv('LD_LIBRARY_PATH', p);

Mexing meshmonk functions

On ubuntu/mac: In matlab, go into the projects/meshmonk/matlab folder (or wherever you put the meshmonk repository) and run the mex_all.m script to mex all the meshmonk functions you need.

On Windows: In matlab, go into the Documents/GitHub/meshmonk folder (or wherever you put the meshmonk repository) and run the mex_windows_all.m script to mex all the meshmonk functions you need.

From other software

If you're creating your own c++ project and want to use meshmonk, simply add '-lmeshmonk -lOpenMeshCore -lOpenMeshTools' as an option to your linker when compiling your software that uses the meshmonk library.

-include the meshmonk.hpp header

Demo

An example of a facial registration can be found in the demo folder

meshmonk's People

Contributors

alorcas avatar harrymatthews50 avatar hhoskens avatar jsnyde0 avatar lukin0110 avatar perrykipkerrie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

meshmonk's Issues

How to use meshmonk apart from using the DemoFaceMapping.m file

Hi, I am very interested in using meshmonk to crop, trim, and prune 3D facial images of my own participants. I noted that the DemoFaceMapping.m file could be directly modified to run on my own facial imaging data. However, I this is just a demo file. I think there should be some more formal way for me to use meshmonk rather than using DemoFaceMapping.m file for each of my sample image.

Following the README.md file of meshmonk, I run mex_windows_all.m script to mex meshmonk functions. However, this is the end of the file regarding how to use meshmonk from Matlab on Win. My question is what should I do after mexing? Will there be an .exe file created from the mexing? I just do not want to use DemoFaceMapping.m file for my mapping, and I wish to know the orthodox way of using meshmonk, after mexing.

Thank you for sharing the great work.

Get error when calling compute_correspondences using Matlab

When I call compute_correspondences function using Matlab. I have got this error;

Unexpected Standard exception from MEX file.
What() is:Error: 'dimensionality' must match column count in data matrix

This occurs both demo and tutorial code, run on Mac OS.
Thank you in advance,

Unable to export the mapped mesh

I run meshmonk on 64 bit Win 10 system.

When I run the demo file, I came across the Eigenvecdtor decomposre on Q failed issue, such issue has been reported by marvin521.

When I run the DemoFaceMapping.m file on two of my self-collected 3dMD facial surface mesh, I was able to view the mapping result as shown in the image below:
snipaste_2018-10-01_08-53-11

However, when I clicked the 'Save 3D' icon, I was returned error message:

Undefined function 'export' for input arguments of type 'shape3D'.

Error in viewer3D/constructToolbar>save_Callback (line 139)
                 export(obj.ShapeChildren{i});
 
Error while evaluating PushTool ClickedCallback.

Such issue happen when I tried the .m file on both of my sample.

Kind regards

error around the 'compute_correspondences' function

Hello sir,
We have successfully complied meshmonk in windows with visual studio and put the compiled meshmonk.lib into the root folder of matlab ,but when we run the “UnderstandingNonRigidMappingWithMeshMonk.m” we came across the problem that the function of compute_correspondences could not be recognized.From my prospect,whether because of the misdiaplacement of the lib file(meshmonk.lib)induced such problem or any other posibilities which I don‘t know. Could you help me find out the reason or give
me more suggestions on solving such problem,thanks a lot!

Problems with meshmonk when installing on ARM64 architecture (M1 chip°

Hi there,

I recently needed to reinstall Meshmonk again on my new M1 macbook.
I now get an issue in matlab when I want to run meshmonk, concerning the libmeshmonk.dylib architecture:

MException with properties:

identifier: 'MATLAB:mex:ErrInvalidMEXFile'
   message: 'Invalid MEX-file '/Users/pieter-janverhelst/Documents/MATLAB/ImgGENESoftware/myCompiledToolboxes/compute_correspondences.mexmaci64': dlopen(/Users/pieter-janverhelst/Documents/MATLAB/ImgGENESoftware/myCompiledToolboxes/compute_correspondences.mexmaci64, 0x0006): Library not loaded: libmeshmonk.dylib↵  Referenced from: /Users/pieter-janverhelst/Documents/MATLAB/ImgGENESoftware/myCompiledToolboxes/compute_correspondences.mexmaci64↵  Reason: tried: '/Applications/MATLAB_R2021b.app/bin/maci64/libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/bin/maci64/./libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/bin/maci64/../../sys/os/maci64/libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/Contents/MacOS/libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/Contents/MacOS/./libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/Contents/MacOS/../../standalone/bin/maci64/libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/Contents/MacOS/../../sys/os/maci64/libmeshmonk.dylib' (no such file), '/Applications/MATLAB_R2021b.app/Contents/MacOS/../../bin/maci64/libmeshmonk.dylib' (no such file), 'libmeshmonk.dylib' (no such file), '/usr/local/lib/libmeshmonk.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libmeshmonk.dylib' (no such file), '/Users/pieter-janverhelst/Desktop/VECTRA/IMAGES/libmeshmonk.dylib' (no such file), '/usr/local/lib/libmeshmonk.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libmeshmonk.dylib' (no such file)'
     cause: {}
     stack: [2×1 struct]
Correction: []

Seems to be a compatibility issue between the X86_64 design and the new arm64 architecture. Is this a known issue and are there any solutions? Thanks in advance!

please include 'parseMTL'.

Matlab 2019b

when running the BatchProcessingWithMeshmonk.m with own obj face I get this error.
K>> [usemtl,mtl,maps] = parseMTL(filename,usePrefix);
Unrecognized function or variable 'parseMTL'.

The obj file is called 007.obj and mtl file is called 007.mtl

Incorrect location of nanoflann.hpp after copying header files

Hello,

I was following the installation instructions for OSX and got to the last part of copying the relevant header files into /usr/local/include/src.

I observed while mexing that 2 of the files in /usr/local/include/src couldn't find this particular file - nanoflann.hpp. This is because nanoflann.hpp is in a subfolder of it's own called vendor. Copying it into src did the trick.

If you are able to reproduce the problem and confirm the issue, I'll be happy to send in a pull request. Thanks!

unable to compile c++ example

Hi, I have difficulty in compiling example file. when I try to compile the example using make example compilation fails.

meshmonk/example.cpp:62: undefined reference to 'read_obj_files'
meshmonk/example.cpp:213: undefined reference to 'pyramid_registration'

but when I check the meshmonk.cpp file and meshmonk.hpp file, these functions were already defined.

I'm using cpp_project branch

Pin Nanoflan version in docs

cd /Users/user/Downloads/
wget https://raw.githubusercontent.com/jlblancoc/nanoflann/v1.2.3/include/nanoflann.hpp
cp nanoflann.hpp /usr/local/include

eigenvector decomposer on Q failed!

Hello. When I try to use shape mappers on my on obj files I get the following error.
Could you please help me to recognzie the issue?

eigenvector decomposer on Q failed!
Q : -nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
-nan(ind) -nan(ind) -nan(ind) -nan(ind)
...
Thank You!

Invalid MEX-file '/home/knutjb/meshmonks/meshmonk/matlab/compute_correspondences.mexa64': /usr/local/lib64/libmeshmonk.so: undefined symbol: _ZTIN8OpenMesh12BasePropertyE

I have compiled the mex files and libmeshmonk.so.
When I run a demo I get this error.
Invalid MEX-file '/home/knutjb/meshmonks/meshmonk/matlab/compute_correspondences.mexa64': /usr/local/lib64/libmeshmonk.so: undefined symbol:
_ZTIN8OpenMesh12BasePropertyE

Error in test_compute_correspondences (line 38)
compute_correspondences(floatingFeatures, targetFeatures,..

How to get texture information using meshmonk

Hi, thanks for great work.

When I use meshmonk, I can get aligned pointcloud and mesh information in obj.FloatingShape, but I don't know how to find texture information.

Could you teach me how to find texture, or do I have to mannually match texture?

Thanks

Include 3th party libs

To avoid version mismatches with Eigen, Nanaflann & OpenMesh we need to include the correct versions of these libs in a vendors directory.

This will allow to always build the software without any dependency.

Got error when compile Meshmonk on Mac OS

Error log

src/NeighbourFinder.hpp:102:19: error: no matching constructor for
initialization of 'nanoflann::KDTreeEigenMatrixAdaptor<Matrix<float, -1,
6, 0, -1, 6> >'
...= new nanoflann::KDTreeEigenMatrixAdaptor(_inSourcePoints,
^ ~~~~~~~~~~~~~~~~~
src/CorrespondenceFilter.cpp:34:22: note: in instantiation of member function
'registration::NeighbourFinder<Eigen::Matrix<float, -1, 6, 0, -1, 6>
>::set_source_points' requested here
_neighbourFinder.set_source_points(_inTargetFeatures);
^
/usr/local/include/nanoflann.hpp:1318:3: note: candidate constructor not viable:
no known conversion from 'const Eigen::Matrix<float, -1, 6, 0, -1, 6>' to
'const int' for 1st argument
KDTreeEigenMatrixAdaptor(const int dimensionality, cons...
^
/usr/local/include/nanoflann.hpp:1329:3: note: candidate constructor not viable:
requires 1 argument, but 2 were provided
KDTreeEigenMatrixAdaptor(const self_t&);
^
After short investigating, here is the found line in NeighbourFinder.hpp
_kdTree = new nanoflann::KDTreeEigenMatrixAdaptor<VecMatType(
_inSourcePoints, _leafSize);

Undefined function 'compute_correspondences' for input arguments of type 'single'.

I keep getting the following error when running the tutorial "UnderstandingNonRigidMappingWithMeshMonk.m" on windows. Compiled everything as instructed.

The first few operations using the Shape3D and Viewer class work. However, the error occurs when running the cell "Step 1 - compute correspondences".

"
Undefined function 'compute_correspondences' for input arguments of type 'single'.

Error in UnderstandingNonRigidMappingWithMeshMonk (line 139)
compute_correspondences(floatingFeatures, targetFeatures,...
"

A similar error occurs later on:
"
Undefined function 'compute_nonrigid_transformation' for input arguments of type 'uint32'.

Error in UnderstandingNonRigidMappingWithMeshMonk (line 219)
compute_nonrigid_transformation(floatingFeatures, correspondingFeatures,...
"

Eigenvecdtor decomposre on Q failed!

Hi, thanks for the great work.

When I ran the script 'DemoFaceMapping.m', matlab gives me the errors:

Are you ready? Y/N [Y]: Y
Started...
eigenvector decomposer on Q failed!
Q : nan nan nan nan
nan nan nan nan
nan nan nan nan
nan nan nan nan

xxx
shape3D/get.TriHandle (line 76)
out = triangulation(obj.Faces,obj.Vertices);% triangulation is a matlab construct that helps in a lot of computations

BTW, I am using OSX, and I have installed all the packages following the instructions except that my eigen version is 3.3.4

Accuracy of the registration of facial 3D scans

Hi
I was successfully able to follow the tutorial and use the demo data to run "UnderstandingNonRigidMappingWithMeshMonk.m". Thanks for providing that.

I would like to know how to determine the accuracy of the registration process? Is there an evaluation metric, of how well the target is registered onto the template as well as how accurate are the face vertices?

I have the data with 3D facial scans and I ran through the above matlab script. Visually, the registration did not look as accurate as it was with your demo data. But I would like to compare to accuracy (quantify with an evaluation metric) of registration of my data compared to the demo data. Also, I do not have any manual landmark indications, just the 3D facial scan data - obj, mtl files.

Thanks

color of shape3dD

Hi,
I ran the demo successfully, but the colors randomly generated of floating and target are often close during visualization, so is there a way to specify the color for single object.
Thanks.

The relevant code is as follows:

%% Visualize
s = shape3D;
s.Vertices = correspondingFeatures(:,1:3);
st = shape3D;
st.Vertices = targetFeatures(:,1:3);
v = viewer(s);
viewer(st,v);

Eigenvector decomposer on Q failed!

Hello,

I am trying to perform rigid and non-rigid transformations on the FLAME template using my own target 3D scanned faces. Both the target and the template have been landmarked with 32 points. The template and the target look as follows -

Template object

Target 3D object

As far as I know there are no NAN values in either the template or the object file. But when I run the BatchProcessingWithMeshMonk.m file, I get the following error -

eigenvector decomposer on Q failed!
Q : nan nan nan nan
nan nan nan nan
nan nan nan nan
nan nan nan nan

I isolated the line which is causing this error. It starts with the map() function in the above file and I traced it back to the rigid transformation switch case..

Further I observed that the program failed on update() in compute_rigid_registration function in meshmonk.cpp which in turn pointed me to the actually print statement of the error message I'm receiving in RigidTransformer.cpp - https://github.com/TheWebMonks/meshmonk/blob/master/src/RigidTransformer.cpp#L82

I'm kinda stumped as to how I can debug my particular scenario and check why the EigenVector decomposer is not working. Could you please give me some pointers?

Thank you,
Niraj Pandkar

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.