/MotionDecoder

This project is used to analyze videos from security cameras and show clips with movements within (Motion detector).

Primary LanguageC#GNU General Public License v3.0GPL-3.0

MotionDecoder

GitHub release (latest by date) GitHub issues License: GPL v3 GitHub repo size Platforms

Twitter Follow GitHub followers

Overview

This project is used to analyze videos from security cameras and shows short clips from the videos which contain detected motions. It uses C# programming language, .NET Framework 4.6 and Accord.NET libraries

Algorithm overview

  1. The algorithm reads first frames of every half-second (e.g. if a video has framerate of 30 the algorithm retrieves 1st frame, 15th, 30th, 45th and so on)
  2. Images are converted to Grayscale
  3. Images' pixels are compared to each other
  4. Highlights regions with an area of changed pixels 35x35 or more
  5. Creates video segments metadata based on "moving" frames
  6. Segments with the distance between is less than 5 seconds are combined
  7. Segments with the duration less than 3 seconds are deleted
  8. Segments data is recorded to ".data" file with JSON structure

Screenshots

Dependencies

  • K-Lite Codec Pack - used for video playback. The program will crash without this codec. Other codecs might do well but I've not checked.
  • DirectX Playback library - used for playback as well as codec

Getting Started

  1. Install K-Lite Codec Pack (Any edition will do)
  2. Launch Visual Studio 2017 or later
  3. Go to "View -> Team explorer"
  4. In the Team explorer click "Manage connections button" and click "Clone" button
  5. Insert Git URL from repository GitHub page and clone repository to your PC
  6. Open MotionDecoder solution
  7. Go to "Solution Explorer -> MotionDecoder -> References" and check if all dependencies are loaded
  8. If DirectX libraries are missing add them through "References -> (double-click) -> Add Reference -> Browse" (Libraries are situated in "{Repository root}/Dependencies")
  9. Build and debug solution

Copyrights

©2020 Michael "XFox" Gordeev