【问题标题】:How to calculate circumference of a belly that 3d scanned?如何计算 3d 扫描的腹部周长?
【发布时间】:2019-06-17 08:32:20
【问题描述】:

我使用 kinect v2 扫描一个人并将他/她的身体保存为 .ply、.obj、.stl 格式。我想从这个 3d 扫描身体计算腹部、二头肌等的周长。

我对所有想法持开放态度。

这是我在保存 .obj 文件时使用的代码。

public static void SaveAsciiObjMesh(Mesh mesh, TextWriter writer, bool flipAxes)
    {
        if (null == mesh || null == writer)
        {
            return;
        }

        var vertices = mesh.GetVertices();
        var normals = mesh.GetNormals();
        var indices = mesh.GetTriangleIndexes();

        // Check mesh arguments
        if (0 == vertices.Count || 0 != vertices.Count % 3 || vertices.Count != indices.Count)
        {
            throw new ArgumentException(Properties.Resources.InvalidMeshArgument);
        }

        // Write the header lines
        writer.WriteLine("#");
        writer.WriteLine("# OBJ file created by Microsoft Kinect Fusion");
        writer.WriteLine("#");

        // Sequentially write the 3 vertices of the triangle, for each triangle
        for (int i = 0; i < vertices.Count; i++)
        {
            var vertex = vertices[i];

            string vertexString = "v " + vertex.X.ToString(CultureInfo.InvariantCulture) + " ";

            if (flipAxes)
            {
                vertexString += (-vertex.Y).ToString(CultureInfo.InvariantCulture) + " " + (-vertex.Z).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                vertexString += vertex.Y.ToString(CultureInfo.InvariantCulture) + " " + vertex.Z.ToString(CultureInfo.InvariantCulture);
            }

            writer.WriteLine(vertexString);
        }

        // Sequentially write the 3 normals of the triangle, for each triangle
        for (int i = 0; i < normals.Count; i++)
        {
            var normal = normals[i];

            string normalString = "vn " + normal.X.ToString(CultureInfo.InvariantCulture) + " ";

            if (flipAxes)
            {
                normalString += (-normal.Y).ToString(CultureInfo.InvariantCulture) + " " + (-normal.Z).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                normalString += normal.Y.ToString(CultureInfo.InvariantCulture) + " " + normal.Z.ToString(CultureInfo.InvariantCulture);
            }

            writer.WriteLine(normalString);
        }

        // Sequentially write the 3 vertex indices of the triangle face, for each triangle
        // Note this is typically 1-indexed in an OBJ file when using absolute referencing!
        for (int i = 0; i < vertices.Count / 3; i++)
        {
            string baseIndex0 = ((i * 3) + 1).ToString(CultureInfo.InvariantCulture);
            string baseIndex1 = ((i * 3) + 2).ToString(CultureInfo.InvariantCulture);
            string baseIndex2 = ((i * 3) + 3).ToString(CultureInfo.InvariantCulture);

            string faceString = "f " + baseIndex0 + "//" + baseIndex0 + " " + baseIndex1 + "//" + baseIndex1 + " " + baseIndex2 + "//" + baseIndex2;
            writer.WriteLine(faceString);
        }
    }

我对图像处理非常缺乏经验,这是我学期作业的一部分。我病了,那天不能去上学,他们给我留下了最难的作业。至少对我来说最难。所以我需要一些关于它的想法。任何信息都会很棒。

【问题讨论】:

    标签: c# image-processing 3d kinect


    【解决方案1】:

    只需将其导入 Autodesk 3D Max,它就具有内置体积、表面积、尺寸测量功能。或者,如果您想编写自己的程序,您可以使用获取表面三角测量的坐标。从未使用过 kinect,因此无法告诉您更多信息,除非您可以告诉我们您可以从模型中获得什么样的数据。

    【讨论】:

    • 感谢您的回答。我找到了一个类似的视频。 youtu.be/jOvaZGloNRo?t=67 这似乎是我正在寻找的。所以请给我一个关于如何实现这样的东西的想法。
    猜你喜欢
    • 2022-06-12
    • 2019-10-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多