如何通过Meshlabserver使用脚本保存颜色数据

时间:2019-05-10 12:26:32

标签: meshlab

我有* .ply格式的点云。它们包含XYZRGB数据。如果我手动打开文件并应用一组过滤器,则结果很好。但是,如果我通过使用meshlabserver有关颜色数据丢失的信息使用没有GUI的相同滤镜。

我尝试通过菜单过滤器->显示当前过滤器脚本->保存脚本为meshlabserver创建脚本 并打电话 meshlabserver.exe -i input.ply -o output.ply -s myscript.mlx

实际上,我还尝试了其他格式,不仅是ply,而且结果是一样的-颜色数据丢失了。

ply文件看起来像

ply
format ascii 1.0
element vertex 32909
property float x
property float y
property float z
property uchar red
property uchar green
property uchar blue
end_header
-1620.92 -38.5282 1168.78 84 126 151
-1610.92 -18.5282 1158.78 85 124 150
-1610.92 -8.5282 1178.78 83 122 147
-1610.92 -28.5282 1198.78 84 124 148
-1590.92 1.4718 1188.78 77 120 144
-1600.92 -8.5282 1208.78 80 119 142
-1560.92 101.472 1138.78 70 106 132
-1580.92 31.4718 1168.78 79 116 141
-1570.92 51.4718 1198.78 75 111 134
-1530.92 131.472 1198.78 65 98 123
-1510.92 451.472 998.78 25 46 65
...

Meshlab版本为2016.12 最小脚本包含两个过滤器:

<!DOCTYPE FilterScript>
<FilterScript>
 <filter name="Compute normals for point sets">
  <Param name="K" value="10" tooltip="The number of neighbors used to estimate normals." description="Neighbour num" type="RichInt"/>
  <Param name="smoothIter" value="0" tooltip="The number of smoothing iteration done on the p used to estimate and propagate normals." description="Smooth Iteration" type="RichInt"/>
  <Param name="flipFlag" value="false" tooltip="If the 'viewpoint' (i.e. scanner position) is known, it can be used to disambiguate normals orientation, so that all the normals will be oriented in the same direction." description="Flip normals w.r.t. viewpoint" type="RichBool"/>
  <Param name="viewPos" z="0" tooltip="The viewpoint position can be set by hand (i.e. getting the current viewpoint) or it can be retrieved from mesh camera, if the viewpoint position is stored there." description="Viewpoint Pos." x="0" y="0" type="RichPoint3f"/>
 </filter>
 <filter name="Surface Reconstruction: Ball Pivoting">
  <Param name="BallRadius" value="0" tooltip="The radius of the ball pivoting (rolling) over the set of points. Gaps that are larger than the ball radius will not be filled; similarly the small pits that are smaller than the ball radius will be filled." description="Pivoting Ball radius (0 autoguess)" min="0" type="RichAbsPerc" max="3082.68"/>
  <Param name="Clustering" value="20" tooltip="To avoid the creation of too small triangles, if a vertex is found too close to a previous one, it is clustered/merged with it." description="Clustering radius (% of ball radius)" type="RichFloat"/>
  <Param name="CreaseThr" value="90" tooltip="If we encounter a crease angle that is too large we should stop the ball rolling" description="Angle Threshold (degrees)" type="RichFloat"/>
  <Param name="DeleteFaces" value="false" tooltip="if true all the initial faces of the mesh are deleted and the whole surface is rebuilt from scratch, other wise the current faces are used as a starting point. Useful if you run multiple times the algorithm with an incrasing ball radius." description="Delete intial set of faces" type="RichBool"/>
 </filter>
</FilterScript>

是否可以将这些滤镜与meshlabserver一起使用并保存颜色数据以获得与Meshlab-GUI相同的结果?

已更新。解决了!

使用适当的键可以保存颜色数据。呼叫meshlabserver -m [选项]

                        vc -> vertex colors,  vf -> vertex flags,
                        vq -> vertex quality, vn-> vertex normals,
                        vt -> vertex texture coords,
                        fc -> face colors,  ff -> face flags,
                        fq -> face quality, fn-> face normals,
                        wc -> wedge colors, wn-> wedge normals,
                        wt -> wedge texture coords

0 个答案:

没有答案