人脸跟踪检测代码注释
来源:互联网 发布:软件项目管理实用教程 编辑:程序博客网 时间:2024/05/16 12:30
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.Util;
using Emgu.CV.Structure;
using Emgu.CV.CvEnum;
namespace FaceDecetion
{
public partial class Form1 : Form
{
private Capture cap;//操作视频流的对象
private HaarCascade haar;//用于目标检测
public Form1()
{
InitializeComponent();
}
//利用时钟控件的Tick事件代替while
private void timer1_Tick(object sender, EventArgs e)
{
//每次获取一帧图片
using (Image<Bgr, byte> nextFrame = cap.QueryFrame())
{
if (nextFrame != null)
{
// there's only one channel (greyscale), hence the zero index
//var faces = nextFrame.DetectHaarCascade(haar)[0];
//Convert the current image to the specific color and depth Bgr to gray
Image<Gray, byte> grayframe = nextFrame.Convert<Gray, byte>();//
var faces = haar.Detect(grayframe);//处理效果好,有点滞延??
/*
grayframe.DetectHaarCascade(
haar, 1.4, 4,
HAAR_DETECTION_TYPE.DO_CANNY_PRUNING,
new Size(nextFrame.Width / 8, nextFrame.Height / 8)
)[0];
*/
foreach (var face in faces)
{
nextFrame.Draw(face.rect, new Bgr(0, double.MaxValue, 0), 3);
}
pictureBox1.Image = nextFrame.ToBitmap();
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
// passing 0 gets zeroth webcam
cap = new Capture(0);
// adjust path to find your xml
haar = new HaarCascade(
"C:\\Emgu\\emgucv-windows-x86 2.3.0.1416\\opencv\\data\\haarcascades\\haarcascade_frontalface_alt.xml");
}
}
}
- 人脸跟踪检测代码注释
- OpenCV人脸跟踪canny边缘检测
- opencv人脸检测和跟踪
- haar 人脸检测跟踪源码整理
- SDK中的任务跟踪代码简单注释
- OpenCV中blob_tracking 跟踪代码中文注释
- KCF目标跟踪代码及注释
- 目标跟踪之:blob_tracking 跟踪代码中文注释
- 视频目标检测与跟踪实现代码
- 视频目标检测与跟踪实现代码
- 多目标检测跟踪文献代码汇总
- 人脸检测代码
- 人脸检测、跟踪与人脸识别
- MS 和 Intel 的人脸检测、跟踪开发包
- 基于TLD的人脸检测跟踪系统
- 三帧差法运动目标检测代码及注释
- SDK中的任务跟踪代码简单注释(续)
- Realsense(五)多人脸实时检测及跟踪代码
- 天书般的ICTCLAS分词系统代码(一)
- emgu 配置
- 【100题】左旋转字符串-----整体翻转+局部再次翻转
- java中的Volatile关键字(成员变量修饰符)
- 图的遍历BFS
- 人脸跟踪检测代码注释
- Spring声明式事务管理、Spring整合Hibernate
- Socket套接字做简易聊天室
- 嵌入式linux学习步骤 2/5
- FPGA和CPLD使用时的区别 2012_7_29
- poj 3667
- CUDA DLL 开发流程
- Spring核心技术之Ioc和AOP
- paip.为什么软件体积越来越大