总目录地址:AI 系列 总目录

需要最新源码,或技术提问,请加QQ群:538327407

我的各种github 开源项目和代码:https://github.com/linbin524

需求

为了实现特定场景中人员监控、人脸识别的需求,针对相关技术做研究。近场的动态人脸识别已经实现;现在需要针对人距离的移动人物进行捕捉截取,确定当前场所行走的人员做收集。

实现效果:

技术方案

1、采用Emgu CV 开源框架,对人体进行动态捕捉

2、介绍摄像头采集 识别移动人体模式

技术实现

动态截取人物

代码:

    void ProcessFrame(object sender, EventArgs e)
{
Mat frame = _cameraCapture.QueryFrame();
Mat smoothedFrame = new Mat();
CvInvoke.GaussianBlur(frame, smoothedFrame, new Size(, ), ); //filter out noises
//frame._SmoothGaussian(3); #region use the BG/FG detector to find the forground mask Mat forgroundMask = new Mat();
_fgDetector.Apply(smoothedFrame, forgroundMask);
#endregion CvBlobs blobs = new CvBlobs();
_blobDetector.Detect(forgroundMask.ToImage<Gray, byte>(), blobs);
blobs.FilterByArea(, int.MaxValue); float scale = (frame.Width + frame.Width) / 2.0f;
_tracker.Update(blobs, 0.01 * scale, , ); long detectionTime; List<Rectangle> faces = new List<Rectangle>();
List<Rectangle> eyes = new List<Rectangle>(); IImage image = (IImage)frame;//这一步是重点
faceImage = frame.Bitmap; #region 人物识别
long processingTime;
Rectangle[] results; if (CudaInvoke.HasCuda)
{
using (GpuMat gpuMat = new GpuMat(frame))
results = FindPedestrian.Find(gpuMat, out processingTime);
}
else
{
using (UMat uImage = frame.GetUMat(AccessType.ReadWrite))
results = FindPedestrian.Find(uImage, out processingTime);
} foreach (Rectangle rect in results)
{
CvInvoke.Rectangle(frame, rect, new Bgr(Color.Red).MCvScalar);
} #endregion imageBox1.Image = frame;
imageBox2.Image = forgroundMask;
}

人物识别动态捕捉核心代码:

using System;
using System.Collections.Generic;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using System.Drawing;
using System.Diagnostics;
using Emgu.CV.Util;
#if !(__IOS__ || NETFX_CORE)
using Emgu.CV.Cuda;
#endif namespace PedestrianDetection
{
public static class FindPedestrian
{
/// <summary>
/// Find the pedestrian in the image
/// </summary>
/// <param name="image">The image</param>
/// <param name="processingTime">The processing time in milliseconds</param>
/// <returns>The region where pedestrians are detected</returns>
public static Rectangle[] Find(IInputArray image, out long processingTime)
{
Stopwatch watch;
Rectangle[] regions; using (InputArray iaImage = image.GetInputArray())
{
#if !(__IOS__ || NETFX_CORE)
//if the input array is a GpuMat
//check if there is a compatible Cuda device to run pedestrian detection
if (iaImage.Kind == InputArray.Type.CudaGpuMat)
{
//this is the Cuda version
using (CudaHOG des = new CudaHOG(new Size(, ), new Size(, ), new Size(, ), new Size(, )))
{
des.SetSVMDetector(des.GetDefaultPeopleDetector()); watch = Stopwatch.StartNew();
using (GpuMat cudaBgra = new GpuMat())
using (VectorOfRect vr = new VectorOfRect())
{
CudaInvoke.CvtColor(image, cudaBgra, ColorConversion.Bgr2Bgra);
des.DetectMultiScale(cudaBgra, vr);
regions = vr.ToArray();
}
}
}
else
#endif
{
//this is the CPU/OpenCL version
using (HOGDescriptor des = new HOGDescriptor())
{
des.SetSVMDetector(HOGDescriptor.GetDefaultPeopleDetector());
watch = Stopwatch.StartNew(); MCvObjectDetection[] results = des.DetectMultiScale(image);
regions = new Rectangle[results.Length];
for (int i = ; i < results.Length; i++)
regions[i] = results[i].Rect;
watch.Stop();
}
} processingTime = watch.ElapsedMilliseconds; return regions;
}
}
}
}

读后感觉不错,有收获可以微信请作者喝杯咖啡,读后有疑问请加微信,拉群研讨,注明来意

AI_ 视频监控-人体移动捕捉监测的更多相关文章

  1. VSAM:视频监控系统 A System for Video Surveillance and Monitoring

    VSAM(VideoSurveillance and Monitoring)视频监控系统 Robotics Institute CMU 1:引言 2:试验床介绍 3:基本的视频分析算法:运动目标检测, ...

  2. 【miscellaneous】华为智能视频监控系统设计解决方案

    [导读] 近年来,随着经济的快速增长.社会的迅速进步,校园.工厂园区.中小企业.楼宇等领域对安全防范和现场记录报警系统的需求与日俱增,视频监控在工作.生活各方面得到了非常广泛的应用. 1.中小型视频监 ...

  3. 海康威视,大华,宇视 的视频监控iOS Demo

    原谅我只提供一个链接,我在这里写了两遍,最后加个链接页面卡死了,下面的demo,最好真机调试.(写博客还是在别的地方写复制到这里比较好!) 一个画面可以做,4个,9个,16个画面原理是一样的,集合到自 ...

  4. 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码

    本文为 Dennis Gao 原创技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载. 开源倾情奉献系列链接 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾 ...

  5. [视频监控]用状态机图展示Layout切换关系

    监控系统通常会提供多种Layout给用户,用于满足不同需求,如:高清显示单路视频或者同时观察多路监控情况. 文中系统只提供了单路.2x2(2行2列共4路).8路(4行4列布局,从左上角算起,有个核心显 ...

  6. 【转】网络视频监控P2P解决方案

    一.摘要 本文分析了日益增长的民用级别家庭和个人网络视频监控市场的需求特点,并给出了一种经济可行易于大规模部署的P2P解决方案. 由于篇幅有限,本文只给出了方案的思路,未对更深入的技术细节做详细的论述 ...

  7. 基于.NET打造IP智能网络视频监控系统

    开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码   开源倾情奉献系列链接 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾情奉献:基于.NET打造 ...

  8. Python远程视频监控

    Python远程视频监控程序   老板由于事务繁忙无法经常亲临教研室,于是让我搞个监控系统,让他在办公室就能看到教研室来了多少人.o(>﹏<)o||| 最初我的想法是直接去网上下个软件,可 ...

  9. 开源视频监控系统:iSpy

    iSpy是一个开源的视频监控软件,目前已经支持中文.自己用了一下,感觉还是很好用的.翻译了一下它的介绍. iSpy将PC变成一个完整的安全和监控系统 iSpy使用您的摄像头和麦克风来检测和记录声音或运 ...

随机推荐

  1. hdoj1114 Piggy-Bank(DP 完全背包)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114 思路: 题目看着有些绕,其实就是完全背包的变形,需要注意的是这里求最小值,所以需要将dp数组初始 ...

  2. Unable to get the default Bean Validation factory

    前几天看了一下教程 ,自己试着配置了一下web下的hibernate,悲剧的时,出错了提示下面: 信息: Hibernate Validator bean-validator-3.0-JBoss-4. ...

  3. 排序矩阵中的从小到大第k个数 · Kth Smallest Number In Sorted Matrix

    [抄题]: 在一个排序矩阵中找从小到大的第 k 个整数. 排序矩阵的定义为:每一行递增,每一列也递增. [思维问题]: 不知道应该怎么加,因为不是一维单调的. [一句话思路]: 周围两个数给x或y挪一 ...

  4. .NET格式化字符串详细说明

    DataFormatString属性:{0:Bxx}B为取值类型 C 以货币格式显示数值. D 以十进制格式显示数值. E 以科学记数法(指数)格式显示数值. F 以固定格式显示数值. G 以常规格式 ...

  5. spring监听与IBM MQ JMS整合

    spring xml 的配置: 文件名:applicationContext-biz-mq.xml <?xml version="1.0" encoding="UT ...

  6. 【原创】VB超强游戏外挂帮助类,封装了很多方法

    ''' <summary> ''' a very nice file that can be used on other projects ''' </summary> ''' ...

  7. iOS开发总结

    最近在工作中使用Objective-C开发iOS客户端程序,它一方面和Server通讯,处理网络连接,收发报文,实现业务逻辑;另一方面为UI层提供各种业务API.   下面记录用到的相关知识点,困难, ...

  8. 在iframe框架中全屏不好使的原因

    遇到的问题:我是在iframe框架中添加了一个插件在360和火狐中不好使,将allowfullscreen="true" 属性配置好就没问题了: 可能出现的原因:将allowful ...

  9. OpenSSL 结构体

    X509_STORE 头文件:x509_vfy.h 定义 typedef struct x509_store_st X509_STORE; struct x509_store_st { /* The ...

  10. Response.Redirect原理图解