C# 3D人脸重建,人头姿势估计

编程入门 行业动态 更新时间:2024-10-10 04:28:02

C# 3D人脸重建,<a href=https://www.elefans.com/category/jswz/34/1723085.html style=人头姿势估计"/>

C# 3D人脸重建,人头姿势估计

效果

项目

代码

using OpenCvSharp;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;namespace Onnx_Demo
{public partial class frmMain : Form{public frmMain(){InitializeComponent();}string fileFilter = "*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";string image_path = "";DateTime dt1 = DateTime.Now;DateTime dt2 = DateTime.Now;Mat image;private void button1_Click(object sender, EventArgs e){OpenFileDialog ofd = new OpenFileDialog();ofd.Filter = fileFilter;if (ofd.ShowDialog() != DialogResult.OK) return;pictureBox1.Image = null;pictureBox2.Image = null;textBox1.Text = "";image_path = ofd.FileName;pictureBox1.Image = new Bitmap(image_path);image = new Mat(image_path);}private void Form1_Load(object sender, EventArgs e){}private void button2_Click(object sender, EventArgs e){if (image_path == ""){return;}textBox1.Text = "检测中,请稍等……";pictureBox2.Image = null;Application.DoEvents();image = new Mat(image_path);Detect_Face detect_net = new Detect_Face(0.7f);Face_Mesh mesh_net = new Face_Mesh("pose");//choices=["pose", "sparse"]dt1 = DateTime.Now;List<BoxInfo> bboxes = detect_net.detect(image);foreach (var item in bboxes){mesh_net.detect(image, item);}dt2 = DateTime.Now;pictureBox2.Image = new Bitmap(image.ToMemoryStream());textBox1.Text = "推理耗时:" + (dt2 - dt1).TotalMilliseconds + "ms";}private void pictureBox2_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox2.Image);}private void pictureBox1_DoubleClick(object sender, EventArgs e){Common.ShowNormalImg(pictureBox1.Image);}}
}

下载

源码下载

更多推荐

C# 3D人脸重建,人头姿势估计

本文发布于:2023-11-17 09:39:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641702.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:人头   姿势

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!