【问题标题】:Running Hausdorff distance and colorize by vertex quality doesnt export the color and quality运行 Hausdorff 距离并按顶点质量着色不会导出颜色和质量
【发布时间】:2019-12-11 13:44:39
【问题描述】:

我正在从 meshlabserver 运行 Hausdorff 距离过滤器,我想保存带有顶点着色的采样网格。 计算距离,我在 shell 输出和日志文件中得到它。 将输出导出到 *.ply 时,我没有得到顶点质量和颜色。

我正在运行以下命令: meshlabserver -i first.stl -i second.stl -o out.ply -m vc vq -s script.mlx

其中 script.mlx 包含以下内容:

<FilterScript>
 <filter name="Remove Duplicate Vertices"/>
 <filter name="Hausdorff Distance">
  <Param value="1" tooltip="The mesh whose surface is sampled. For each sample we search the closest point on the Target Mesh." name="SampledMesh" type="RichMesh" description="Sampled Mesh"/>
  <Param value="0" tooltip="The mesh that is sampled for the comparison." name="TargetMesh" type="RichMesh" description="Target Mesh"/>
  <Param value="false" tooltip="Save the position and distance of all the used samples on both the two surfaces, creating two new layers with two point clouds representing the used samples." name="SaveSample" type="RichBool" description="Save Samples"/>
  <Param value="true" tooltip="For the search of maxima it is useful to sample vertices and edges of the mesh with a greater care. It is quite probably the the farthest points falls along edges or on mesh vertexes, and with uniform montecarlo sampling approachesthe probability of taking a sample over a vertex or an edge is theoretically null.&lt;br>On the other hand this kind of sampling could make the overall sampling distribution slightly biased and slightly affects the cumulative results." name="SampleVert" type="RichBool" description="Sample Vertexes"/>
  <Param value="true" tooltip="See the above comment." name="SampleEdge" type="RichBool" description="Sample Edges"/>
  <Param value="false" tooltip="See the above comment." name="SampleFauxEdge" type="RichBool" description="Sample FauxEdge"/>
  <Param value="true" tooltip="See the above comment." name="SampleFace" type="RichBool" description="Sample Faces"/>
  <Param value="30514" tooltip="The desired number of samples. It can be smaller or larger than the mesh size, and according to the choosed sampling strategy it will try to adapt." name="SampleNum" type="RichInt" description="Number of samples"/>
  <Param min="0" value="233.888" tooltip="Sample points for which we do not find anything whithin this distance are rejected and not considered neither for averaging nor for max." name="MaxDist" type="RichAbsPerc" description="Max Distance" max="468.287"/>
 </filter>
 <filter name="Colorize by vertex Quality">
  <Param value="0" tooltip="The value that will be mapped with the lower end of the scale (blue)" name="minVal" type="RichFloat" description="Min"/>
  <Param value="0.8" tooltip="The value that will be mapped with the upper end of the scale (red)" name="maxVal" type="RichFloat" description="Max"/>
  <Param min="0" value="0" tooltip="If not zero this value will be used for a percentile cropping of the quality values.&lt;br> If this parameter is set a value P to &lt;i>P&lt;/i> then the two values &lt;i>V_min,V_max&lt;/i> for which &lt;i>P&lt;/i>% of the vertices have a quality &lt;b>lower or greater than &lt;i>V_min,V_max&lt;/i> are used as min/max values for clamping.&lt;br>&lt;br> The automated percentile cropping is very useful for automatically discarding outliers." name="perc" type="RichDynamicFloat" description="Percentile Crop [0..100]" max="100"/>
  <Param value="false" tooltip="If true the min max range will be enlarged to be symmertic (so that green is always Zero)" name="zeroSym" type="RichBool" description="Zero Simmetric"/>
 </filter>
</FilterScript>

当从 GUI MeshLab 运行 Hausdorff 距离和按顶点质量着色并导出到层时,我得到了具有质量和颜色的网格。

是否可以从 meshlabserver 获得相同的行为? (即使只获得顶点质量也会很好) 我错过了什么吗?

谢谢:)

【问题讨论】:

    标签: meshlab


    【解决方案1】:

    我使用我自己的两个网格完成了与您相同的步骤。第二个网格由一个Quadric Decimation 过滤器和几个应用于机翼区域的Taubin Smooth 过滤器生成。

    当我使用相同的命令在 meshlabserver(预发布版本)中运行您的 script.mlx 时,我得到了以下日志:

    Opening a file with extention ply
    Mesh gargoyle.50k.ply loaded has 24511 vn 48939 fn
    Opening a file with extention ply
    Mesh gargoyle.2k.ply loaded has 1264 vn 2500 fn
    output mesh  ./out.ply
    vertex color, vertex quality, Apply FilterScript: './script.mlx'
    FilterScript
    Reading filter with name Remove Duplicate Vertices
    Reading filter with name Hausdorff Distance
        Reading Param with name SampledMesh : RichMesh
        Reading Param with name TargetMesh : RichMesh
        Reading Param with name SaveSample : RichBool
        Reading Param with name SampleVert : RichBool
        Reading Param with name SampleEdge : RichBool
        Reading Param with name SampleFauxEdge : RichBool
        Reading Param with name SampleFace : RichBool
        Reading Param with name SampleNum : RichInt
        Reading Param with name MaxDist : RichAbsPerc
    Reading filter with name Colorize by vertex Quality
        Reading Param with name minVal : RichFloat
        Reading Param with name maxVal : RichFloat
        Reading Param with name perc : RichDynamicFloat
        Reading Param with name zeroSym : RichBool
    Starting Script of 3 actionsfilter: Remove Duplicate Vertices
    LOG: 2 Removed 0 duplicated vertices
    Removed 0 duplicated vertices
    filter: Hausdorff Distance
    Sampled  mesh has    1264 vert    2500 face
    Searched mesh has   24511 vert   48939 face
    Max sampling distance 233.888000 on a bbox diag of 198.622528
    LOG: 2 Hausdorff Distance computed
    LOG: 2      Sampled 62292 pts (rng: 0) on gargoyle.2k.ply searched closest on gargoyle.50k.ply
    LOG: 2      min : 0.000016   max 7.446799   mean : 0.756087   RMS : 1.266457
    LOG: 2 Values w.r.t. BBox Diag (201.385788)
    LOG: 2      min : 0.000000   max 0.036978   mean : 0.003754   RMS : 0.006289
    
    Removed 0 duplicated vertices
    Hausdorff Distance computed
         Sampled 62292 pts (rng: 0) on gargoyle.2k.ply searched closest on gargoyle.50k.ply
         min : 0.000016   max 7.446799   mean : 0.756087   RMS : 1.266457
    Values w.r.t. BBox Diag (201.385788)
         min : 0.000000   max 0.036978   mean : 0.003754   RMS : 0.006289
    
    filter: Colorize by vertex Quality
    LOG: 2 Quality Range: 0.000250 7.398357; Used (0.000000 0.800000)
    Removed 0 duplicated vertices
    Hausdorff Distance computed
         Sampled 62292 pts (rng: 0) on gargoyle.2k.ply searched closest on gargoyle.50k.ply
         min : 0.000016   max 7.446799   mean : 0.756087   RMS : 1.266457
    Values w.r.t. BBox Diag (201.385788)
         min : 0.000000   max 0.036978   mean : 0.003754   RMS : 0.006289
    
    Quality Range: 0.000250 7.398357; Used (0.000000 0.800000)
    Mesh ./gargoyle.2k.ply saved as ./out.ply (1264 vn 2500 fn)
    

    我的输出文件具有预期的颜色和质量。由于我的额外平滑,翅膀中的距离大于身体中的距离(蓝色表示更大的距离,如质量直方图所示)。

    我的电脑一切正常,你的电脑有什么问题?...我下载了官方 2016-12 版本的 meshlab 并使用 2016 的 meshlabserver 运行相同的脚本。结果是这样的:

    作为您的输出:没有颜色,每个质量值都设置为零。但是,等等... 这看起来像最初的 50k 模型,而不是预期的抽取模型。 Meshlabserver-2016 正在保存第一个网格,而不是第二个网格。

    所以我重新安排了您的 script.mlx 文件,以便在网格 0 而非网格 1 上进行采样

    ...
     <filter name="Hausdorff Distance">
      <Param value="0" tooltip="The mesh whose surface is sampled. For each sample we search the closest point on the Target Mesh." name="SampledMesh" type="RichMesh" description="Sampled Mesh"/>
      <Param value="1" tooltip="The mesh that is sampled for the comparison." name="TargetMesh" type="RichMesh" description="Target Mesh"/>
    ...
    

    然后运行新脚本交换输入网格的顺序:

    meshlab-2016.12/src/distrib/meshlabserver -i gargoyle.2k.ply -i gargoyle.50k.ply -o out2.ply  -m vq vc -s script2.mlx
    

    输出文件 out2.ply 没有颜色,但具有正确的距离质量值,因此我可以将其加载到 meshlab 中并在那里应用 Colorize by vertex Quality。向全能的豪斯多夫石像鬼致敬!

    结论:您必须选择将 meshlab 更新到当前的预发布版本,还是继续使用 meshlab-2016 并更改输入网格的顺序。

    【讨论】:

      猜你喜欢
      • 2011-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-16
      • 1970-01-01
      • 2021-06-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多