EmViD
EmViD: Embedded Video Detection
Download
The whole EmViD package is provided as a tarball. For your convenience, GreenBus and DUST is included as well.Overview
EmViD is a set of SystemC components with which to build video processing systems. A typical EmViD model is shown in fig. 1.EmViD/attachments/emvid_model.png)
Fig. 1: A simple face detection system
The system comprises of six EmViD components, namely Video-Input, Erosion, Dilation, Labeling, and Video-Output. The yellow components build a video pipeline. A bus is uses to connect Video-Output and Video-Input.
The system computes a list of image regions where it assumes human faces. The computation is based on four stages:
- Skin color detection
- Remove of noise (erosion)
- Merge neighbour regions (dilation)
- Detect face regions (labeling and region detection)
You can use a firewire camera, a network camera, or an MPEG-2 file as a video source. The output of the system can be visualized using the Simple Direct Media Library (SDL). For MPEG-2 input, libmpeg3 is required. Firewire support requires the linux1394 libraries.
Configuration
EmViD models can be easily assembled with the GreenBus configuration framework. This is the configuration file for the model in fig. 1 (note that the SystemC module names used in the config file are shown in brackets in fig. 1):- # set master target address for port cam_to_yuv.yuvframe_out
- cam_to_yuv.yuvframe_out.target_addr 0x2000
- # set slave address range for port display.yuvframe_in
- display.yuvframe_in.base_addr 0x2000
- display.yuvframe_in.high_addr 0x2fff
- # set PVT/BA mode and 50MHz clock for the bus connection
- cam_to_yuv.yuvframe_out.mode 2 # 2=BA
- cam_to_yuv.yuvframe_out.clk_period 20 # 20ns clock period
- display.yuvframe_in.clk_period 20 # 20ns clock period
- # create a PLB with dynamic priority scheduling, running at 50MHz
- BUS(bus, PLB, 20, SC_NS)
- # connect cam_to_yuv and display to the bus
- CONNECT(cam_to_yuv.yuvframe_out, bus.tport, bus.iport, display.yuvframe_in)
- # connect the other ports point-to-point to build a video pipeline
- CONNECT(cam_to_yuv.binframe_out, morph_erode.in)
- CONNECT(morph_erode.out, morph_dilate.in)
- CONNECT(morph_dilate.out, morph_segm.in)
- CONNECT(morph_segm.out, display.binframe_in)
- CONNECT(morph_segm.regions_out, display.regions_in)
Download and Run
To run the simulation of this model, download the sources and follow the installation instructions provided in the README file.
Then enjoy some scenes from your favorite mpg movie (should be 320x240 pixels) and watch the video pipeline detecting the faces of the actors.
EmViD/attachments/emvid_startrek.gif)
Fig. 2: EmViD simulation in startrek action
Communication Architecture Exploration
Set up communication architecture
You can easily change the communication architecture of your EmViD model by playing around with the configuration. There is no need to recompile the model, just run the simulation again with the modified configuration file. The rsc directory provides several config files for testdrives.Communication analysis
GreenBus provides two techniques for communication analysis:- VCD bus signal tracing
- DUST/SCV transaction recording
To get an VCD trace, enable the PHASE_TRACE switch in the file globals.h:
- #define PHASE_TRACE
The VCD trace will contain a cycle-count accurate plot of all bus signals in your model. However, it will not include point-to-point communication (as used in the pipeline).
To get a recording of all transactions in the system, use the DUST framework (included in the tarball). Enable DUST by adding the following line to at the top of globals.h:
- #include "utils/dust_model_and_transactions.h"
As a result, you will get two files, static_model.xml and tr_model.xml, that provide an XML representation of all transactions in your system.
Documentation
There is some doxygen compliant documentation in the source code of the EmViD components.Posted January 8th, 2008 by MarkBurton