Video Surveillance *

Similar documents
DSP Laboratory: Analog to Digital and Digital to Analog Conversion *

ECE3296 Digital Image and Video Processing Lab experiment 2 Digital Video Processing using MATLAB

Session 1 Introduction to Data Acquisition and Real-Time Control

Seeing Using Sound. By: Clayton Shepard Richard Hall Jared Flatow

R5 RIC Quickstart R5 RIC. R5 RIC Quickstart. Saab TransponderTech AB. Appendices. Project designation. Document title. Page 1 (25)

User Manual K.M.E. Dante Module

Rack-Mount Receiver Analyzer 101

Rapid prototyping of of DSP algorithms. real-time. Mattias Arlbrant. Grupphandledare, ANC


Boonton 4540 Remote Operation Modes

RedRat Control User Guide

Watchman. Introduction: Door Lock Mobile MAX

Common Spatial Patterns 3 class BCI V Copyright 2012 g.tec medical engineering GmbH

DETEXI Basic Configuration

The Circle of Fifths *

Common Spatial Patterns 2 class BCI V Copyright 2012 g.tec medical engineering GmbH

TECHNICAL MANUAL. Cheetah VIDEO MATRIX ROUTERS 3G VIDEO INPUT CARD WITH AUDIO DE-EMBEDDING AND 3G VIDEO OUTPUT CARD WITH AUDIO EMBEDDING

DBS Installation Guide

Liquid Mix Plug-in. User Guide FA

Image Acquisition Technology

Journal Article Reference: Single Author *

Quick Reference Manual

D-901 PC SOFTWARE Version 3

Processes for the Intersection


EECS 578 SVA mini-project Assigned: 10/08/15 Due: 10/27/15

NOTICE: This document is for use only at UNSW. No copies can be made of this document without the permission of the authors.

MonitorKey Operation Manual: content/uploads/ MonitorKey Operation Manual.pdf

Journal of Theoretical and Applied Information Technology 20 th July Vol. 65 No JATIT & LLS. All rights reserved.

LAX_x Logic Analyzer

2G Video Wall Guide Just Add Power HD over IP Page1 2G VIDEO WALL GUIDE. Revised

C8000. switch over & ducking

VIDEO 2D SCALER. User Guide. 10/2014 Capital Microelectronics, Inc. China

APPLICATION NOTE 4312 Getting Started with DeepCover Secure Microcontroller (MAXQ1850) EV KIT and the CrossWorks Compiler for the MAXQ30

Part No. ENC-LAB01 Users Manual Introduction EncoderLAB

Altera s Max+plus II Tutorial

User s Manual. Log Scale (/LG) GX10/GX20/GP10/GP20/GM10 IM 04L51B01-06EN. 2nd Edition

Documentation for Event Capture Beta. Brandon Rumberg Patrick Brandt

CARLETON UNIVERSITY. Facts without theory is trivia. Theory without facts is bull 2607-LRB

UNIVERSITY OF TORONTO JOÃO MARCUS RAMOS BACALHAU GUSTAVO MAIA FERREIRA HEYANG WANG ECE532 FINAL DESIGN REPORT HOLE IN THE WALL

GTT LTE RRU ADD- ON USER GUIDE

OPERATORS & INSTALLATION MANUAL JOTRON AIS VIEWER WINDOWS PC SOFTWARE

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

AMIQ-K2 Program for Transferring Various-Format I/Q Data to AMIQ. Products: AMIQ, SMIQ

Marshall Electronics. Operating Instructions. Warranty. Model No. QVW Quad-Viewer Monitor with 4K Format Support

TV Character Generator

TransitHound Cellphone Detector User Manual Version 1.3

STB Front Panel User s Guide

SERDES Eye/Backplane Demo for the LatticeECP3 Serial Protocol Board User s Guide

B. The specified product shall be manufactured by a firm whose quality system is in compliance with the I.S./ISO 9001/EN 29001, QUALITY SYSTEM.

Document History Version Comment Date

Hardware Software Co-Simulation and Real-Time Video Processing For Edge Detection Using Matlab Simulink Model Blockset

Dimming actuators of the FIX series DM 4-2 T, DM 8-2 T

Smart Traffic Control System Using Image Processing

PulseCounter Neutron & Gamma Spectrometry Software Manual

NI-DAQmx Device Considerations

Digital Systems Laboratory 1 IE5 / WS 2001

Lab 1 Introduction to the Software Development Environment and Signal Sampling

Operating Instructions

(Skip to step 11 if you are already familiar with connecting to the Tribot)

HCS-4100/20 Series Application Software

Brain-Computer Interface (BCI)

HCImage Live Getting Started Guide

Calibration Using i1 probe with CalMan and Resolve

Network. Decoder. Display

Dimming actuators GDA-4K KNX GDA-8K KNX

Solutions for a Real Time World. Unigen Corp. Wireless Module Products. PAN Radio Modules Demonstration & Evaluation Kit UGWxxxxxxxxx (Part Number)

V pro8 QUICK START GUIDE

Journal Article Reference: More than Seven Authors *

User Instruction Manual IQSDA30/IQSDA32. Intelligent Reclocking High Performance HD-SDI/SD-SDI Distribution Amplifiers. snellgroup.

Implementation of a turbo codes test bed in the Simulink environment

HYBRID CONCATENATED CONVOLUTIONAL CODES FOR DEEP SPACE MISSION

Frame Synchronization in Digital Communication Systems

Camera Controller Project Report - EDA385. Einar Vading, ael09eva Alexander Nässlander, ada09ana Carl Cristian Arlock, ada07car November 1, 2013

EEG A1452 SCTE-104 Inserter Frame Card

Multiband Noise Reduction Component for PurePath Studio Portable Audio Devices

Experiment: FPGA Design with Verilog (Part 4)

SigPlay User s Guide

Channel calculation with a Calculation Project

D-Lab & D-Lab Control Plan. Measure. Analyse. User Manual

USING MATLAB CODE FOR RADAR SIGNAL PROCESSING. EEC 134B Winter 2016 Amanda Williams Team Hertz

C Module Description

3M Littmann TeleSteth Online Auscultation System User Manual Version 2.6.X

HCS-4100/50 Series Fully Digital Congress System

Transport Stream. 1 packet delay No delay. PCR-unaware scheme. AAL5 SDUs PCR PCR. PCR-aware scheme PCR PCR. Time

Next Generation Software Solution for Sound Engineering

De-embedding Gigaprobes Using Time Domain Gating with the LeCroy SPARQ

Understanding Compression Technologies for HD and Megapixel Surveillance

Just a T.A.D. (Traffic Analysis Drone)

Distributed Virtual Music Orchestra

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Product Evaluation Guide for MPL. Version 1.0

User Guide & Reference Manual

T1 Deframer. LogiCORE Facts. Features. Applications. General Description. Core Specifics

VISSIM Tutorial. Starting VISSIM and Opening a File CE 474 8/31/06

NENS 230 Assignment #2 Data Import, Manipulation, and Basic Plotting

9 Analyzing Digital Sources and Cables

Laboratory stand description. Investigation of DVB-T/C/IPTV technologies

Lab 6: Edge Detection in Image and Video

A Design Approach of Automatic Visitor Counting System Using Video Camera

Transcription:

OpenStax-CNX module: m24470 1 Video Surveillance * Jacob Fainguelernt This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 2.0 Abstract This module describes the design ow of a motion detection system based video surveillance system based on the DM6437 Digital Video Development Platform (DVDP). The system will be able to identify and record only interesting video frames containing motion. 1 Introduction Continuous-scene monitoring applications, such as ATM booths, parking lots or trac monitoring systems, generate large volumes of data. Recording and archiving such volumes of data is a real problem, and one way to solve this is to reduce the size of the data stream right at the source. In addition to traditional methods for compressing individual video images, we could identify and record only interesting video images, such as those images with signicant amounts of motion in the eld of view. That could signicantly help reduce the data rates for surveillance-specic applications. In this section, we'll illustrate the design ow of a motion detection system based video surveillance system. The system will be able to identify and record only interesting video frames containing motion. The development process will follow the following three steps: 1. Functional Requirements 2. System modeling and simulation 3. Code generation and implementation 1.1 Hardware and Software Requirements This laboratory was originally developed using the following hardware and software: MATLAB R2008a Code Composer Studio (CCS) v3.3 Texas Instruments DM6437 hardware. * Version 1.1: Jun 4, 2009 6:10 am -0500 http://creativecommons.org/licenses/by/2.0/

OpenStax-CNX module: m24470 2 1.2 Related Files Powerpoint Presentation - Surveillance.ppt 1 Simulink Model for Simulation - surveillance.mdl 2 Video-clip viplane.avi 3 MATLAB script my_tcpip_surveil_script.m 4 Simulink Model for Real-Time (DM6437) - my_dm6437evmsurveil_tcpip.mdl 5 Simulink Model for Real-Time Lane Detection (PC) - my_pc_surveil_tcpip.mdl 6 2 Video Surveillance In this session we will show how to create the line detection model, and how it can be integrated in Simulation and Real-Time Implementations. Figure 1 Figure 1: The Motion Detection Process 2.1 The Motion Energy Estimation The Motion Energy estimation is based on the calculation of the Sum of Absolute Dierences (SAD) according to the following equation: 1 See the le at <http://cnx.org/content/m24470/latest/surveillance.ppt> 2 See the le at <http://cnx.org/content/m24470/latest/surveillance.mdl> 3 See the le at <http://cnx.org/content/m24470/latest/viplane.avi> 4 See the le at <http://cnx.org/content/m24470/latest/my_tcpip_surveil_script.m> 5 See the le at <http://cnx.org/content/m24470/latest/my_dm6437evmsurveil_tcpip.mdl> 6 See the le at <http://cnx.org/content/m24470/latest/my_pc_surveil_tcpip.mdl>

OpenStax-CNX module: m24470 3 SAD = i j I k (i, j) I k 1 (i, j) where: I k (i, j) I k 1 (i, j) - Current Frame - Previous Frame Table 1 2.2 Functional Description The Video Surveillance system block diagram is shown in Figure 2. The source video is displayed and played back through the system. This incoming video stream is processed by a subsystem that estimates the motion within the scene and captures the interesting video frames. The system can display either the recorded video frame or the Absolute Dierences (AD) image. The user can congure the motion energy threshold value and select which image will be displayed (Display Control). The system outputs include, besides the displayed image, the following features: A graph of the motion energy as a function of time. This graph displays the threshold value as well. The Frame count of the recorded image An output signal triggered by motion detection (Trigger) While the generated code is running on the target, a host side Simulink model simultaneously sends video frames to the target via TCP/IP protocol using TCP/IP Blocks from Instrument Control Toolbox. The target receives video frames sent by the host side Simulink model, computes the sum of the absolute value of dierences (SAD) between successive video frames, and returns an estimate of motion. When the motion estimate value exceeds a threshold, the target increments a counter and sends the corresponding frame back to the host.

OpenStax-CNX module: m24470 4 Figure 2: Video Surveillance Block Diagram 3 Simulation 1. Open a new Simulink model 2. Add the blocks shown in the following table (Please refer also to Figure 3): Video Surveillance Simulink Blocks Functionality Block Blockset Quant. SAD Subsystem Simulink / Ports & Subsystems continued on next page 1

OpenStax-CNX module: m24470 5 Delay Abs Matrix Sum Signal Processing Blockset / Signal Operations Simulink / Math Operations Signal Processing Blockset / Math Functions / Matrices and Linear Algebra / Matrix Operations Data Type Conversion Simulink / Signal Attributes Add Sum, Simulink / Math Operations Recording Enabled Subsystem Simulink / Ports & Subsystems Add Sum, Delay Simulink / Math Operations Signal Processing Blockset / Signal Operations counter Subsystem Simulink / Ports & Subsystems Generate data for motion energy and threshold display Compare Motion Energy against Threshold Add Sum, Delay Matrix Concatenate Relational Operator Simulink / Math Operations Signal Processing Blockset / Signal Operations Simulink / Math Operations Simulink / Logic and Bit Operations Input Video From Multimedia File Signal Processing Blockset / Signal Processing Sources Display Control Constant Signal Processing Blockset / Signal Processing Sources 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 continued on next page

OpenStax-CNX module: m24470 6 Display Motion Energy and Threshold Draws formatted text on an image or video stream Connected to the trigger (not used for simulation) Floating Scope Simulink/Sinks 1 Insert Text Video and Image Processing Blockset / Text & gure Terminator Simulink/Sinks 1 Images' Display To Video Display Video and Image Processing Blockset / Sinks Table 2 1 2 Figure 3: Simulink Blocks for Video Surveillance 3.1 Conguring the SAD blocks 1. Congure one of the Add block for subtraction, you may also change its icon shape to a circular form as follows 7 : 7 The symbol is used to place the + and - perpendicular to each other

OpenStax-CNX module: m24470 7 Figure 4 2. Congure its xed point mode of operation Congure one of the Matrix Sum blocks for adding rows:

OpenStax-CNX module: m24470 8 Figure 5 3. Congure its xed point mode of operation

OpenStax-CNX module: m24470 9 Figure 6 4. Congure the xed point mode of operation for the second Matrix Column Add block:

OpenStax-CNX module: m24470 10 Figure 7 3.2 Conguring the Input blocks 1. Congure on of the Video Source "From Multimedia File" block for reading frames from the "vipmen.avi" le.

OpenStax-CNX module: m24470 11 2. Set the initial value of the "Constant" to 1e5. Table 3 Figure 8

OpenStax-CNX module: m24470 12 Figure 9 3. Congure "Data Type Conversion" block : Figure 10

OpenStax-CNX module: m24470 13 4. Congure " Relational Operator " block : Figure 11 5. Congure one of the " Matrix Concatenate " block : Figure 12

OpenStax-CNX module: m24470 14 6. The Floating Scope will be used to display the motion energy and the threshold 8 as a function of time. Double-Click the block. A cope screen will appear, you should then click the icon as shown in the following picture: Figure 13 You may keep the default conguration for "Data history". 7. Congure the " Insert Text " block : 8 The threshold is changed upon a user command. The simultaneous display of the threshold and motion energy will enable the user to follow-up the process of recording frames.

OpenStax-CNX module: m24470 15 Figure 14 8. Double-click on the "Enabled Subsystem" block, and build it as shown below:

OpenStax-CNX module: m24470 16 Figure 15 9. Double-click on one of the "Subsystem" block and build it as shown below: Figure 16 Save the subsystem as: "Motion Energy" 10. Double-click on one the remaining "Subsystem" block,build it as shown below and name it "Frame Counter":

OpenStax-CNX module: m24470 17 Figure 17 3.3 Connecting the blocks: 1. Connect the blocks as shown in the following gure: Figure 18: Video Surveillance model 2. Save the model as "surveillance_sim.mdl".

OpenStax-CNX module: m24470 18 3.4 Running the model 1. Run the model. You should observe the following images: Current Frame Recorded Frame Table 4 2. Double click the scope and you will see:

OpenStax-CNX module: m24470 19 Figure 19 In this scope display, yellow represents the motion estimate from each video frame, and magenta is the threshold level. In the Motion Threshold scope here, we see that we identied ve frames with motion above the threshold that were captured and recorded. 4 Real Time Implementation 4.1 Video Surveillance using TCP/IP 1. Open the video_sim.mdl 9 Simulink model (generated in the "A Framework for Video Processing with the DM6437 DVDP 10 " module). 2. Rename the model "my_dm6437evmsurveil_tcpip.mdl". 3. Rename the R_W Algorithm subsystem to Surveillance Algorithm. 4. Double-click the Surveillance Algorithm block. 9 http://cnx.org/members/jfaing/m23999/video_sim.mdl 10 http://cnx.org/content/m23999/latest/

OpenStax-CNX module: m24470 20 5. In this block, add a Add the Function- Call Subsystem from the Ports & Subsystems" group of the "Simulink" Blockset. 6. Rename Function- Call Subsystem to Video Frame Capture Motion Threshold and Double-click it. 7. Open the model "surveillance_sim.mdl", created in section and copy it into Video Frame Capture Motion Threshold. 8. Add three input ports "In1" from the "Sources" group of the "Simulink" blockset and three output ports "Out1" from the "Sinks" group of the "Simulink" blockset. 9. Add a "Switch" from the "Signal Routing" group of the "Simulink" blockset and a "Gain" from the "Math Operation" group of the "Simulink" blockset. 10. Double-click the Motion Energy block and add him another output port as shown: Figure 20 11. Connect the blocks as shown:

OpenStax-CNX module: m24470 21 Figure 21 12. Congure the "Gain" block : Figure 22

OpenStax-CNX module: m24470 22 13. Congure the "Switch" block : Figure 23 14. Double-click the Surveillance Algorithm subsystem. 15. Congure the "Byte Unpack" block : Figure 24 16. Congure the "Byte Pack" block :

OpenStax-CNX module: m24470 23 Figure 25 17. Congure the " TCP/IP Receive " block : Figure 26

OpenStax-CNX module: m24470 24 Figure 27 18. Congure the " TCP/IP Send " block : Figure 28 19. Connect the Video Frame Capture Motion Threshold block as shown:

OpenStax-CNX module: m24470 25 Figure 29 20. Open the RW_pcl_tcpip.mdl model, created in the "Video R_W" le 21. Rename the model "my_pc_surveil_tcpip.mdl". 22. Add the "Manual Switch" from the "Signal Routing" group of the "Simulink" blockset and three "Constant" blocks from the "Signal Processing" group of the "Signal Processing" blockset. 23. Congure the " Constant " blocks: continued on next page

OpenStax-CNX module: m24470 26 24. Congure the "Byte Unpack" block : Table 5 Figure 30 25. Connect the block as shown:

OpenStax-CNX module: m24470 27 Figure 31 26. Congure the " TCP/IP Receive " block :

OpenStax-CNX module: m24470 28 Figure 32 27. Double-click the Display subsystem. 28. Double-click the Data Unpack subsystem. 29. Congure the "Byte Unpack" block : Figure 33 30. Connect the block as shown:

OpenStax-CNX module: m24470 29 Figure 34 31. Add to the "Display" subsystem the "Insert Text" from the " Text & gure " group of the " Video and Image Processing " blockset, " Floating Scope" from the "Sinks" group of the "Simulink" blockset. 32. Congure the " Insert Text " block :

OpenStax-CNX module: m24470 30 Figure 35 33. Add the Subsystem from the Ports & Subsystems" group of the "Simulink" Blockset 34. Rename it "Combine Count" 35. Add a "Frame Counter" subsystem as we did in paragraph 14 at the rst section.

OpenStax-CNX module: m24470 31 Figure 36 36. Add a "Matrix Concatenate" from the "Math Operations" group of the "Simulink" blockset. 37. Connect the block as shown: Figure 37 38. Congure the " Matrix Concatenate" block :

OpenStax-CNX module: m24470 32 Figure 38 39. Connect the "Display" subsystem as shown:

OpenStax-CNX module: m24470 33 Figure 39 40. Open a new m-le, copy the following code and save it as "my_tcpip_surveil_script.m" at the same directory as the model. function my_tcpip_surveil_script(hostmodelname) %my_tcpip_surveil_script controls host-side TCP/IP processing for % Video Surveillance demo: % 1) Builds and runs the target application %********** Initialization ******************** % Get model name modelname = gcs; % Connect to CCS CCS_Obj = connecttoccs(modelname); saved_visibility = CCS_Obj.isvisible; CCS_Obj.visible(1); % Load application loadapp(modelname, CCS_Obj); % Run application fprintf('running application: %s\n', modelname); CCS_Obj.run; % Allow some time for DHCP address acquisition pause(3); % Retrieve target's host name

OpenStax-CNX module: m24470 34 boardtype = get_param([modelname '/IP Config'], 'boardtype'); userprompt = sprintf('enter the IP address or the host name of the %s board: ', boardtype); hostname = inputdlg(userprompt, 'Target IP address'); if isempty(hostname) errordlg('you have to provide a valid IP address or host name to run the demo.',... 'TCP/IP Surveillance Recording', 'modal'); return; end hostname = strtrim(hostname{1}); % Launch host side UDP receive / Video display model fprintf('launching host side application: %s\n', hostmodelname); open_system(hostmodelname); % Update host side TCP/IP blocks with target's IP address set_param([hostmodelname '/TCP//IP Send'], 'Host', hostname); set_param([hostmodelname '/TCP//IP Receive'], 'Host', hostname); fprintf('click on play button to start running the host side application!\n\n') %[EOF] tcpip_surveil_script.m 41. Open a new m-le, copy the following code and save it as "my_tcpip_surveil_script.m" at the same directory as the model. 42. now we have two models ("my_pc_surveil_tcpip.mdl" and "my_dm6437evmsurveil_tcpip.mdl") and one MATLAB le ("my_tcpip_surveil_script.m") 4.2 Running the Real-time Model 1. Build load and run the project from the "my_dm6437evmsurveil_tcpip.mdl" model. Double-click the " Build / Reload & Run" block. 2. Running the script, you will see: Figure 40

OpenStax-CNX module: m24470 35 Figure 41 If you want to display the Absolute Dierences Image, change the state of the switch from 0 to 1. You will then see: Figure 42