Как сохранить данные о цвете, используя скрипты с meshlabserver - PullRequest
0 голосов
/ 10 мая 2019

У меня есть точечные облака в формате * .ply.Они состоят из данных XYZRGB.Если я вручную открываю файл и применяю набор фильтров, результат в порядке.Но если я использую те же фильтры без графического интерфейса, используя meshlabserver, информация о потерях данных о цвете.

Я попытался создать сценарии для meshlabserver через меню Filters -> Показать текущий сценарий фильтра -> Save script и вызвать 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?

Upd.Решено!

Использование соответствующих клавиш позволяет сохранить данные о цвете.Вызвать 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
...