Closed niyunsheng closed 2 years ago
Would you be able to provide:
The texture coordinates of the two triangles are as follows, while 3
followed by the coordinate id and 6
followd by the each texture coordinates
[27731]: 3 31133 47205 31134 6 0.188872 0.931736 0.190389 0.931257 0.189103 0.933672
[27732]: 3 31134 47205 14397 6 0.189103 0.933672 0.190389 0.931257 0.190075 0.933559
The 3D coordinates of the verices are as follows:
[14397]: 57.0999 15.2552 60.5664
[31133]: 59.0817 13.5186 57.0087
[31134]: 60.0602 13.5186 60.5664
[47205]: 53.4949 17.0764 53.4509
Thanks for your reply.
I visualized the texture coordinates on the mask map. It seems that they do not coincide. The length and width of the image are 4096, and the coordinates I visualize are:
verice id | 3D coordinates | texture coordinates | texture coordinates (int) |
---|---|---|---|
14397 | 57.0999 15.2552 60.5664 | 0.190075, 0.933559 | 778, 3823 |
31133 | 59.0817 13.5186 57.0087 | 0.188872, 0.931736 | 773, 3816 |
31134 | 60.0602 13.5186 60.5664 | 0.189103, 0.933672 | 774, 3824 |
47205 | 53.4949 17.0764 53.4509 | 0.190389, 0.931257 | 779, 3814 |
Thanks. Out of curiosity, what do you mean by "texture coordinates (int)"? When I multiply the texture coordinates by 4096, I don't get an integer.
If I had to guess, the problem might be due to the fact that, in texture space, the line segment through vertices 31134 and 47205 goes exactly through an integer coordinate, making the code confused about which triangle "owns" that texel.
So you still get the error if you jitter the texture coordinates a tiny bit?
Sorry, "texture coordinates (int)" meaning "texture coordinates" multipy by 4096 and converted to int type. I made several wrong figures and have corrected them now in upper comments.
Thanks for your reply, I using --jitter
in the command line and get the same error message.
I also print out intermediate results in the function InitializeHierarchy
and structure TexturedMesh< GeometryReal > mesh
/ AtlasMesh< GeometryReal > atlasMesh
/ std::vector< AtlasChart< GeometryReal > > atlasCharts
.
mesh
/atlasMesh
are right, but in atlasCharts
is wrong.triangles_id | 27731 | 27732 |
---|---|---|
mesh.triangles[triangles_id] |
31133 47205 31134 | 31134 47205 14397 |
atlasMesh.triangles[triangles_id] |
31811 31812 31813 | 31813 31812 14600 |
atlasMesh.vertexMap[atlasMesh.triangles[triangles_id][0..2]] |
31133 47205 31134 | 31134 47205 14397 |
atlasMesh.triangleChartIndex[triangles_id] |
38 | 38 |
atlasCharts[38].meshVertexIndices[atlasCharts[38].triangles[t][0..2]] |
31133 47205 31134 | 31134 47205 252 |
t=17
when triangles_id
is 27731 and t=18
when triangles_id
is 27732. As you can see, the vertices convert to 252 from 14397.In addition, I I found the vertex and texture coordinates of 252:
verice id | 3D coordinates | texture coordinates | texture coordinates (int) |
---|---|---|---|
252 | 53.5422 0.43647 49.8931 | 0.186364 0.921429 | 763, 3774 |
As a supplement, I found that two triangles with the same vertex belong to different charts. The details are as follows:
triangles_id | 10162 | 27732 |
---|---|---|
atlasCharts chartID | 932 | 38 |
verice ids | 14395 14396 14397 | 31134 47205 14397 |
The two triangles in the mesh is
And the Related 3D and texture coordinates is
verice id | 3D coordinates | texture coordinates | texture coordinates (int) |
---|---|---|---|
14395 | 53.5422 15.4348 64.1242 | 0.190907 0.936615 | 781, 3836 |
14396 | 57.0999 14.5667 64.1242 | 0.190087 0.936159 | 778, 3834 |
14397 | 57.0999 15.2552 60.5664 | 0.190075 0.933559 | 778, 3823 |
31134 | 60.0602 13.5186 60.5664 | 0.189103 0.933672 | 774, 3824 |
47205 | 53.4949 17.0764 53.4509 | 0.190389 0.931257 | 779, 3814 |
And the texture coordinates I visualized in the mask image is:
I have made some new discoveries and found the reason why two triangles do not belong to a same chart.
The vertex with 3d coordinates 57.0999 15.2552 60.5664
are divided into three vertices after uv expansion: 14397/36323/46730
.
14397
vertex is associated with two triangles: 10162/27732
.36323
vertex is associated with one triangle: 35734
.46730
vertex is associated with two triangles: 10163/27769
.The five triangles are visualized in the following figure.
The two triangles 10162/27732
are not neighbours, so they are divided into different charts.
Do you know what the problem is? Is it the uv unfolding problem? Can your program TextureStitching
handle this situation?
This problem is "manifold vertices" and I can using MeshLab to repaire it. Is this the best solution ?
The fact of a non-manifold vertex, belonging to 10162 and 27732, but separated by 35734, 10163, and 27768, could definitely be causing a problem.
I think the fix would be assigning a separate texture coordinate to the corner associated to vertex 14397 so you get four charts meeting at that corner instead of three. Not sure if MeshLab can help with that.
Thanks, I finally repair the mesh using MeshLab, now it works. Thanks for your great job!
There are some questions remaining: The warning [[WARNING] InitializeMassAndStiffness: Zero row at index 33498. Try running with jittering.]
occurs sometimes even using --jitter
.
What is puzzling is that this warning sometimes appears and sometimes does not appear.
Do you know why ?
My guess is it's a numerical precision issue that can be affected by the parallelism. If you ran the code with just one thread, I would guess the results would be consistent.
The warning appears sometimes even using --threads 1
.
Do you have any other suggestions?
Thank you.
When I using the
TextureStitching
application, I got the [EXCEPTION]:I noticed the similar issus: https://github.com/mkazhdan/TextureSignalProcessing/issues/11. But my question doesn't seem like the watertight problem.
The coordinate points and visualization diagram of the two triangles are as follows:
Thanks for any help.