This page is optimized for mobile devices, if you would prefer the desktop version just
click here
Simulation
- Open a new Simulink model
- Add the blocks shown in the following table (Please refer also to Figure 3):
Functionality | Block | Blockset | Quant. |
SAD | Subsystem | Simulink / Ports&Subsystems | 1 |
Delay | Signal Processing Blockset / Signal Operations | 1 | |
Abs | Simulink / Math Operations | 1 | |
Matrix Sum | Signal Processing Blockset / Math Functions / Matrices and Linear Algebra / Matrix Operations | 2 | |
Data Type Conversion | Simulink / Signal Attributes | 1 | |
Add Sum, | Simulink / Math Operations | 1 | |
Recording | Enabled Subsystem | Simulink / Ports&Subsystems | 1 |
Add Sum, | Simulink / Math Operations | 1 | |
Delay | Signal Processing Blockset / Signal Operations | 1 | |
counter | Subsystem | Simulink / Ports&Subsystems | 1 |
Add Sum, | Simulink / Math Operations | 1 | |
Delay | Signal Processing Blockset / Signal Operations | 1 | |
Generate data for motion energy and threshold display | Matrix Concatenate | Simulink / Math Operations | 2 |
Compare Motion Energy against Threshold | Relational Operator | Simulink / Logic and Bit Operations | 1 |
Input Video | From Multimedia File | Signal Processing Blockset / Signal Processing Sources | 1 |
Display Control | Constant | Signal Processing Blockset / Signal Processing Sources | 1 |
Display Motion Energy and Threshold | Floating Scope | Simulink/Sinks | 1 |
Draws formatted text on an image or video stream | Insert Text | Video and Image Processing Blockset / Text&figure__ | 1 |
Connected to the trigger (not used for simulation) | Terminator | Simulink/Sinks | 1 |
Images’ Display | To Video Display | Video and Image Processing Blockset / Sinks | 2 |
Configuring the sad blocks
- Configure one of the “Add” block for subtraction, you may also change its icon shape to a circular form as follows
The symbol “|” is used to place the “+” and “-“ perpendicular to each other :
- Configure its fixed point mode of operation Configure one of the “Matrix Sum” blocks for adding rows:
- Configure its fixed point mode of operation
- Configure the fixed point mode of operation for the second Matrix “Column Add” block:
Configuring the input blocks
- Configure on of the “Video Source” "From Multimedia File" block for reading frames from the "vipmen.avi" file.
- Set the initial value of the "Constant" to 1e5.
- Configure "Data Type Conversion" block :
- Configure " Relational Operator " block :
- Configure one of the " Matrix Concatenate " block :
- The “Floating Scope” will be used to display the motion energy and the threshold
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. 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:
- Configure the " Insert Text " block :
- Double-click on the "Enabled Subsystem" block, and build it as shown below:
- Double-click on one of the "Subsystem" block and build it as shown below:
- Double-click on one the remaining "Subsystem" block,build it as shown below and name it "Frame Counter":
OpenStax, From matlab and simulink to real-time with ti dsp's. OpenStax CNX. Jun 08, 2009 Download for free at http://cnx.org/content/col10713/1.1
Google Play and the Google Play logo are trademarks of Google Inc.