AI_ 视频监控-人体移动捕捉监测
总目录地址: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_ 视频监控-人体移动捕捉监测的更多相关文章
- VSAM:视频监控系统 A System for Video Surveillance and Monitoring
VSAM(VideoSurveillance and Monitoring)视频监控系统 Robotics Institute CMU 1:引言 2:试验床介绍 3:基本的视频分析算法:运动目标检测, ...
- 【miscellaneous】华为智能视频监控系统设计解决方案
[导读] 近年来,随着经济的快速增长.社会的迅速进步,校园.工厂园区.中小企业.楼宇等领域对安全防范和现场记录报警系统的需求与日俱增,视频监控在工作.生活各方面得到了非常广泛的应用. 1.中小型视频监 ...
- 海康威视,大华,宇视 的视频监控iOS Demo
原谅我只提供一个链接,我在这里写了两遍,最后加个链接页面卡死了,下面的demo,最好真机调试.(写博客还是在别的地方写复制到这里比较好!) 一个画面可以做,4个,9个,16个画面原理是一样的,集合到自 ...
- 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码
本文为 Dennis Gao 原创技术文章,发表于博客园博客,未经作者本人允许禁止任何形式的转载. 开源倾情奉献系列链接 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾 ...
- [视频监控]用状态机图展示Layout切换关系
监控系统通常会提供多种Layout给用户,用于满足不同需求,如:高清显示单路视频或者同时观察多路监控情况. 文中系统只提供了单路.2x2(2行2列共4路).8路(4行4列布局,从左上角算起,有个核心显 ...
- 【转】网络视频监控P2P解决方案
一.摘要 本文分析了日益增长的民用级别家庭和个人网络视频监控市场的需求特点,并给出了一种经济可行易于大规模部署的P2P解决方案. 由于篇幅有限,本文只给出了方案的思路,未对更深入的技术细节做详细的论述 ...
- 基于.NET打造IP智能网络视频监控系统
开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾情奉献系列链接 开源倾情奉献:基于.NET打造IP智能网络视频监控系统(一)开放源代码 开源倾情奉献:基于.NET打造 ...
- Python远程视频监控
Python远程视频监控程序 老板由于事务繁忙无法经常亲临教研室,于是让我搞个监控系统,让他在办公室就能看到教研室来了多少人.o(>﹏<)o||| 最初我的想法是直接去网上下个软件,可 ...
- 开源视频监控系统:iSpy
iSpy是一个开源的视频监控软件,目前已经支持中文.自己用了一下,感觉还是很好用的.翻译了一下它的介绍. iSpy将PC变成一个完整的安全和监控系统 iSpy使用您的摄像头和麦克风来检测和记录声音或运 ...
随机推荐
- 探讨 .NET 4 新增的 SortedSet 类
http://www.cnblogs.com/WizardWu/archive/2010/06/17/1759297.html
- Java的线程同步
synchronized获取的锁是对象,而不是函数或语句块. 项目结构 资源类 import java.util.concurrent.TimeUnit; public class myResourc ...
- Spring配置连接池
---------------------siwuxie095 Spring 配置连接池 1.Spring 配置内置连接 ...
- php的无刷新实现方法
方法一: 我们通过http的204状态码,页面不跳转. 1.html代码如下: <!DOCTYPE HTML> <html lang="zh-CN"> &l ...
- 表单提交的两种请求方式:post与get。post与get两者的对比分析
post与get两者的对比分析:
- python 调试方法
一.使用pdb http://blog.csdn.net/wyb_009/article/details/8896744 二.使用gdb 需首先配置gdb pythin支持,步骤如下: 1.修改Pyt ...
- mysql rc模式时binlog_format=row的解释【转】
总体来说:在 tx_isolation= READ-COMMITTED .binlog_format =statement 的情况下,mysql 没有gap 锁,这样binlog 记录的数据修改的顺序 ...
- Stripies
/* Our chemical biologists have invented a new very useful form of life called stripies (in fact, th ...
- 201621123008 《Java程序设计》 第三周学习总结
1. 本周学习总结 1.1 写出你认为本周学习中比较重要的知识点关键词,如类.对象.封装等 关键词:类,构造函数,方法重载,方法覆盖,封装,继承,多态,类被加载的过程,static,abstract, ...
- Fully Update And Upgrade Offline Debian-based Systems
Let us say, you have a system (Windows or Linux) with high-speed Internet connection at work and a D ...