How to convert 3D skeltal data to Euler representation like Kinect? - kinect

The CMU motion capture data stored the skeleton of each frame as Euler angles. It is easy to convert the Euler angles to 3D points by using Mocap Toolbox. But I wondered how to do the inverse operation? It seems like the Kinect has the same operation: firstly obtained the 3D coordinates of human from the depth camera; secondly, stored these coordinates as Euler angles.

I have found that Motion Builder can convert the C3D dataset into BVH formats. It is exactly what I want. I am going to exploit the programming methods to achieve that.

Related

2D shape detection in 3D pointcloud

I'm working on a project to detect the position and orientation of a paper plane.
To collect the data, I'm using an Intel Realsense D435, which gives me accurate, clean depth data to work with.
Now I arrived at the problem of detecting the 2D paper plane silhouette from the 3D point cloud data.
Here is an example of the data (I put the plane on a stick for testing, this will not be in the final implementation):
https://i.stack.imgur.com/EHaEr.gif
Basically, I have:
A 3D point cloud with points on the plane
A 2D shape of the plane
I would like to calculate what rotations/translations are needed to align the 2D shape to the 3D point cloud as accurate as possible.
I've searched online, but couldn't find a good way to do it. One way would be to use Iterative Closest Point (ICP) to first take a calibration pointcloud of the plane in a known orientation, and align it with the current orientation. But from what I've heard, ICP doesn't perform well if the pointclouds aren't kind of already closely aligned at the start.
Any help is appreciated! Coding language doesn't matter.
Does your 3d point cloud have outliers? How many in what way?
How did you use ICP exactly?
One way would be using ICP, with a hand-crafted initial guess using
pcl::transformPointCloud (*cloud_in, *cloud_icp, transformation_matrix);
(to mitigate the problem that ICP needs to be close to work.)
What you actually want is the plane-model that describes the position and orientation of your point-cloud right?
A good estimator of your underlying function can be found with: pcl::ransac
pcl::ransace model consensus
You can then get the computedModel coefficents.
Now finding the correct transformation is just: How to calculate transformation matrix from one plane to another?

Creat mesh from point cloud on a 2D grid

I am using the new Kinect v2 and I am getting the depth map of the Kinect.
After I get the depth map I convert the depth data from Depth Space to Camera Space.
As far as I understand this is done, by converting all the X,Y coordinate of each pixel to Camera Space + adding the depth value as Z coordinate (also Kinect gives the depth value in millimetres so it is also converted to hold meters).
Because of this, the point cloud is actually on 2D grid extended with the depth value. The visualization also confirms this, since it is easy to notice that the points are ordered in a grid due to the above conversation.
For visualization I am using OpenGL the old fashion way (glBegin(...) and glEnd()).
I want to create a mesh out of the points. I kind of managed to do it with GL_TRIANGLES, but then I have lot of duplicated vertices and edges. So I thought I should create a better triangulation with GL_TRIANGLE_STRIP, but I am stuck here because I can't come up with a good algorithm which can go through my 2D grid in a way that I can feed it to the GL_TRIANGLE_STRIP so it creates a nice surface.
The problems:
For each triangle's vertices I am checking the Z coordinate. If it exceeds a certain threshold I disregard the triangle => this might create holes in my 2D grid.
Some depth values are NaN, because the Kinect can't "see" there nothing (for example an object is too far or too close) => this also creates holes in the 2D grid.
Anybody has any suggestion what would be the best method to solve this issue?
If you're able to use the point cloud library, you could use the
class pcl::OrganizedFastMesh< PointInT >.
http://docs.pointclouds.org/trunk/classpcl_1_1_organized_fast_mesh.html
I use it to triangulate complete depth frames.
You can try also a delanauy triangulation in 3d and look for the tetrahedons on the exterior. An easy algorithm is the bowyer-watson with tetrahedons and circumspheres. Cgal is a good example.

How to get one non-manifod mesh with adaptive point distribution

all
I try to obtain one triangle mesh from one point cloud. The mesh is expected to be manifold, the triangles are well shaped or equilateral and the distribution of the points are adaptive in terms of the curvature.
There are valuable information provided on this website.
robust algorithm for surface reconstruction from 3D point cloud?
Mesh generation from points with x, y and z coordinates
I try Poisson reconstruction algorithm, but the triangles are not well shaped.
So I need to improve the quality of the triangles. I learn that centroidal voronoi tessellation(CVT) can achieve that, but I don't know whether the operation will introduce non-manifold vertices and self-intersection. I hope to get some information about it from you.
The mesh from the following post looks pretty good.
How to fill polygon with points regularly?
Delaunay refinement algorithm is used. Can delaunay refinement algorithm apply to triangle mesh directly? Do I first need to delaunay triangulation of the point cloud of the mesh, and then use the information from delaunay triangulation to perform delaunay refinement?
Thanks.
Regards
Jogging
I created the image in the mentioned post: You can insert all points into a Delaunay triangulation and then create a Zone object (area) consisting of these triangles. Then you call refine(pZone,...) to get a quality mesh. Other options are to create the Zone from constraint edges or as the result of a boolean operation. However, this library is made for 2D and 2.5D. The 3D version will not be released before 2014.
Do you know the BallPivoting approach?

Triangulate a surface with vtk from points AND normals

I have a set of points in 3D that lie on a surface and I also have the normals at every point.
I would like to generate a surface triangulation with this information. In addition I could tell the algorithm to use what points lie on the boundary if that is needed.
So, I have quite a bit of information:
* points
* normals
* boundary
How do I triangulate a surface with this information using vtk?
A surface reconstruction algorithm is like using a bomb for this problem since I have all this information that I would like to use. This information comes from a simulation so I know the surface exists and that is quite smooth.
I would like the answer to be cast in terms of either what vtk function to use and if available (and that would be great) examples using this function.
Thank you so much in advance.
You can use the vtkSurfaceReconstruction filter to create a surface from a set of 3D points.
You could try the point cloud library
Point Cloud Library
Just the 3D points would be good enough. Since you know that your surface is smooth, you can perform a Delaunay triangulation of the points (vtkDelaunay3D) and apply a subdivision filter for smoothening (vtkButterflySubdivisionFilter).
Delaunay3D triangulation

Creating a 3D mesh in VTK

I am trying to create a 3D mesh using VTK. VTK appears to provide a number of ways to create a mesh representing the surface of a 3D object. Filling in the object appears to be more difficult. The reason I want to do this is to pass the output to a FEM tool as a solid, not a balloon.
At the moment, I am playing with spheres and there seems to be a number of ways to create a mesh for the surface of a 3D object. What I can't seem to do is create a sphere with points inside the volume. The vtkUnstructuredGrid class allows me to represent such an object, but I can't seem to mesh this in the same way I can a vtkPolyData.
Is this a fundamental limitation of VTK or am I just not seeing the right tool?
As you said:
I want to do this is to pass the output to an FEM tool as a solid not a balloon
I asume you have your FEM mesh in your own format and you want to visualize it. To do so, you can turn your FEM mesh into a vtkUnstructuredGrid modifiying the code described here:
How to convert a mesh to VTK format?