Today, as I delved into a paper on dense shape matching and downloaded the dataset, I found myself interested in how these datasets pertaining to shape matching store correspondences between pairs of shapes. Namely, I am curious about how they preserve the ground truth of these correspondences. Then I chose SMAL dataset to conduct my research on this issue. It’s a dataset containing information on animals.
structure of SMAL dataset
There are two folders in the dataset, one is called correspondences and another, shapes.
shapes
This part is easy to understand, it consists of several $*.obj $ files. For each file, the first line record the total number of the vertices in the file, for example:
1 | # nv = 5208 |
Then next $nv$ lines are information about the coordinates of these vertices, such as:
1 | v 0.406752 0.144386 0.513073 |
Then next $2 nv $ lines stores the information about $2 nv $,
The next $2 * nv $ lines contain information about the triangles, where the$ (1 + nv + i)th$ line stores the three points that form the $ith$ triangle.
For instance,
1 | f 4914 4563 4913 |
correspondences
In this folder, there are also several $.vts $ files, which names are same as the files in *shapes. Each file has n lines of an integer, just like
1 | 2425 |
a simple guess
If the $value-1$ of the $i-th$ -1 of each shape have a one-to-one correspondence. (A)
To illustrate it, think if we have 2 shapes: dog_01 and dog_02.
Then, the 1st line of dog_01.vts is 2425, the 1st line of dog_02.vts is 2363.
If (A) is correct, the the 0 th group of correspondences must be 2424 and 2362(because the index starts from 0, so minus 1)
a simple way to prove
Just draw these two shapes and connect these two points.
If (A) is correct, you can find that these two points should be on the same part of the animal.
code
Here I chose open3d as my visualization tool.
Don’t forget to color the lines or meshes of the shapes, or you can just get a transparent canvas.
Here, I chose 2 group of corresponded points.
1 | import open3d as o3d |
results
mesh1.vertices[2424], mesh2.vertices[2362]
[mesh1.vertices[2424], mesh2.vertices[2362] and mesh1.vertices[38], mesh2.vertices[39]
Thus, it can be find that the first group of points are all on the tails and the second group are all on the left front leg, so this hypothesis is correct.