zoukankan      html  css  js  c++  java
  • Motion Detection Algorithms视频中运动检测算法源代码及演示代码

    原文地址:http://www.codesoso.com/code/Motion_Detection.aspx

    本文实现了在连续视频数据流中几种不同的运动检测算法,他们都是基于当前帧图像和前一帧图像的比较,程序使用了AForge.NET framework库。其中的示例代码支持下面几种视频格式:AVI文件、网路相机的JPEG和MJPEG,本地的采集设备(USB相机等)。

    感兴趣区域的获得方法:

    // create processing filters sequence
    FiltersSequence processingFilter = new FiltersSequence( );
    processingFilter.Add( new Difference( backgroundFrame ) );
    processingFilter.Add( new Threshold( 15 ) );
    processingFilter.Add( new Opening( ) );
    processingFilter.Add( new Edges( ) );
    // apply the filter
    Bitmap tmp1 = processingFilter.Apply( currentFrame );
    
    // extract red channel from the original image
    IFilter extrachChannel = new ExtractChannel( RGB.R );
    Bitmap redChannel = extrachChannel.Apply( image );
    //  merge red channel with moving object borders
    Merge mergeFilter = new Merge( );
    mergeFilter.OverlayImage = tmp1;
    Bitmap tmp2 = mergeFilter.Apply( redChannel );
    // replace red channel in the original image
    ReplaceChannel replaceChannel = new ReplaceChannel( RGB.R );
    replaceChannel.ChannelImage = tmp2;
    Bitmap tmp3 = replaceChannel.Apply( image );
    

      

  • 相关阅读:
    前缀和
    不用加减乘除做加法
    数组中重复的数字
    滑动窗口的最大值
    矩阵中的路径
    Redis 和 Memcached 的区别 Tair
    机器人的运动范围
    汉诺塔问题
    洗牌算法
    斐波那契查找算法(黄金分割查找算法)
  • 原文地址:https://www.cnblogs.com/boonya/p/8337231.html
Copyright © 2011-2022 走看看