总目录地址: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. js join 与 split

    var a = [] var b = [1,2,3] b.push('4')   // b = [1,2,3,4] a = b.join('-')  // a = '1-2-3-4' b = a.sp ...

  2. MyBatis一对一查询

    ---------------------siwuxie095                                 MyBatis 一对一查询         以订单和用户为例,即 相对订 ...

  3. Python threading 单线程 timer重复调用函数

    项目中需要使用定时器,每次都使用构造器函数调用: timer = threading.Timer(timerFlag, upload_position) timer.start() 打印线程后发现,每 ...

  4. 获取APP的启动图 -Launch Image

    http://adad184.com/2015/10/15/tips-access-current-launch-image/

  5. Parallel.Foreach的基础知识

    微软的并行运算平台(Microsoft’s Parallel Computing Platform (PCP))提供了这样一个工具,让软件开发人员可以有效的使用多核提供的性能. Visual Stud ...

  6. uploadify在chrome下初始化失败,在Firefox下却可以原因探析

    如果没有报错,在其他浏览器下没问题,那就只有一种可能:浏览器flash加载失败,解决办法是,更改浏览器对站点flash的设置.参考下图:

  7. Scrum 项目3.0--软件工程

    1. 确保product backlog井然有序.(参考示例图1) (例图1) 2.把故事进一步拆分成任务.(参考示例图2) (例图2) 3. 形成Sprint backlog. Scrum mast ...

  8. [BAT]通过schtasks.exe远程调用windows 2008 server上的计划任务,提示ERROR : Access is denied

    在windows 2008 server 上建了一个计划任务,想通过命令 schtasks /run /tn "IPADForAdvisor_QA_APITest" /s SZPC ...

  9. WCF数据契约代理和已知类型的使用

    using Bll; using System; using System.CodeDom; using System.Collections.Generic; using System.Collec ...

  10. sqlserver将数据库的数据导成excel文档方法

    sqlserver将数据库的数据导成excel文档方法 最近公司需要下载uniport的数据跟之前的数据进行对比,所以避免不了需要将数据库的数据导出来,把SQLServer表中的数据导出为Excel文 ...