总目录地址: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. Java 架构师

    “学习的最好途径就是看书“,这是我自己学习并且小有了一定的积累之后的第一体会.个人认为看书有两点好处: 1.能出版出来的书一定是经过反复的思考.雕琢和审核的,因此从专业性的角度来说,一本好书的价值远超 ...

  2. php Pthread 多线程 (四) 共享内存

    有些时候我们希望在多个线程中共享一些需要的数据,我们可以使用shmop扩展. <?php class Count extends Thread { private $name = ''; pub ...

  3. css布局---各种居中

    居中是我们使用css来布局时常遇到的情况.使用css来进行居中时,有时一个属性就能搞定,有时则需要一定的技巧才能兼容到所有浏览器,本文就居中的一些常用方法做个简单的介绍. 注:本文所讲方法除了特别说明 ...

  4. vue2.0 tab切换几种方式

    第一种 比较灵活简单的方式(切换改变部分的内容在组件中比较方便操作) <template> <div id="app"> <ul> <li ...

  5. Django开发问题及解决方法汇总

    1. manage.py@MxOnline > makemigrations users manage.py@MxOnline > migrate users 2. 操作django的ad ...

  6. 《Ubuntu标准教程》学习总结

    第6章 Shell Shell就是一个命令解释器,负责完成用户与内核之间的交互. 目前流行电Shell主要有:Bourne Shell( sh ).Bourne Again Shell( Bash ) ...

  7. Java NIO系列教程(四) Scatter 和 Gather

    Java NIO系列教程(四) Scatter 和 Gather Java NIO 开始支持 scatter/gather,scatter/gather 用于描述从 Channel(译者注:Chann ...

  8. Core Dump 程序故障分析

    1.编写一个应用程序,使用gdb+core dump进行故障分析, core dump的概念: core dump又叫核心转存:当程序在运行过程中发生异常,这时Linux系统可以把程序在运行时的内存内 ...

  9. 抓包之网络分析器- Wiresshark

    https://www.wireshark.org/ Wireshark(前称Ethereal)是一个网络封包分析软件.网络封包分析软件的功能是撷取网络封包,并尽可能显示出最为详细的网络封包资料.Wi ...

  10. servlet-cookie

    /**  * Cookie学习;  *         作用:解决了发送的不同请求的数据共享问题  *         使用:  *         1.Cookie的创建和存储  *         ...