c# - 如何计算 3d 扫描的腹部周长?
问题描述
我使用 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);
}
}
我对图像处理真的没有经验,这是我学期作业的一部分。我病了,那天不能去上学,他们给我留下了最难的作业。至少对我来说最难。所以我需要一些关于它的想法。任何信息都会很棒。
解决方案
只需将其导入 Autodesk 3D Max,它就具有内置体积、表面积、尺寸测量功能。或者,如果您想编写自己的程序,您可以使用获取表面三角测量的坐标。从未使用过 kinect,因此无法告诉您更多信息,除非您可以告诉我们您可以从模型中获得什么样的数据。
推荐阅读
- apache-kafka - 将 debezium 任务提交到融合连接时,创建数据库历史主题失败
- amazon-web-services - aws fargate 为环境变量添加参数
- c# - 从 C# 应用程序关闭 IE 弹出窗口
- swift - timePicker 的动作监听器
- vba - VBA 应用程序定义或对象定义错误
- javascript - jQuery droppable:over 事件中不正确的放置元素
- vba - Excel VBA:循环输入框并将值添加到单元格范围
- c# - ASP.NET 4.5 或替代框架中的 OpenIdDict?
- matlab - 使用 GUIDE 将半透明热图叠加到图像上
- windows - 使用 PowerShell 中的 WinSCP .NET 程序集将 X 天之前的日志/文件从 Unix SFTP 服务器复制到 Windows