<< Chapter < Page Chapter >> Page >

Connecting the blocks:

  1. Connect the blocks as shown in the following figure:
    Video Surveillance model
  2. Save the model as "surveillance_sim.mdl".

Running the model

  1. Run the model. You should observe the following images:
    Current Frame Recorded Frame
  2. Double click the scope and you will see:
    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 identified five frames with motion above the threshold that were captured and recorded.

Real time implementation

Video surveillance using tcp/ip

  1. Open the “ video_sim.mdl ” Simulink model (generated in the " A Framework for Video Processing with the DM6437 DVDP " 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.
  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:
  11. Connect the blocks as shown:
  12. Configure the "Gain" block :
  13. Configure the "Switch" block :
  14. Double-click the “Surveillance Algorithm” subsystem.
  15. Configure the "Byte Unpack" block :
  16. Configure the "Byte Pack" block :
  17. Configure the " TCP/IP Receive " block :
  18. Configure the " TCP/IP Send " block :
  19. Connect the “Video Frame Capture Motion Threshold ” block as shown:
  20. Open the “RW_pcl_tcpip.mdl” model, created in the "Video R_W" file
  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. Configure the " Constant " blocks:
  24. Configure the "Byte Unpack" block :
  25. Connect the block as shown:
  26. Configure the " TCP/IP Receive " block :
  27. Double-click the “Display” subsystem.
  28. Double-click the “Data Unpack” subsystem.
  29. Configure the "Byte Unpack" block :
  30. Connect the block as shown:
  31. Add to the "Display" subsystem the "Insert Text" from the " Text&figure__" group of the " Video and Image Processing " blockset, " Floating Scope" from the "Sinks" group of the "Simulink" blockset.
  32. Configure the " Insert Text " block :
  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 first section.
  36. Add a "Matrix Concatenate" from the "Math Operations" group of the "Simulink" blockset.
  37. Connect the block as shown:
  38. Configure the " Matrix Concatenate" block :
  39. Connect the "Display" subsystem as shown:
  40. Open a new m-file, 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 namemodelName = gcs;% Connect to CCS CCS_Obj = connectToCCS(modelName);saved_visibility = CCS_Obj.isvisible; CCS_Obj.visible(1);% Load applicationloadApp(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 nameboardType = 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-file, 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 file ("my_tcpip_surveil_script.m")

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:
    If you want to display the Absolute Differences Image, change the state of the switch from 0 to 1. You will then see:

Questions & Answers

it is the relatively stable flow of income
Chidubem Reply
what is circular flow of income
Divine Reply
branches of macroeconomics
SHEDRACK Reply
what is Flexible exchang rate?
poudel Reply
is gdp a reliable measurement of wealth
Atega Reply
introduction to econometrics
Husseini Reply
Hi
mostafa
hi
LEMLEM
hello
Sammol
hi
Mahesh
bi
Ruqayat
hi
Ruqayat
Hi fellas
Nyawa
hey
Sammol
hi
God
hello
Jahara
Good morning
Jorge
hi
abubakar
hi
Nmesoma
hi
Mahesh
Hi
Tom
Why is unemployment rate never zero at full employment?
Priyanka Reply
bcoz of existence of frictional unemployment in our economy.
Umashankar
what is flexible exchang rate?
poudel
due to existence of the pple with disabilities
Abdulraufu
the demand of a good rises, causing the demand for another good to fall
Rushawn Reply
is it possible to leave every good at the same level
Joseph
I don't think so. because check it, if the demand for chicken increases, people will no longer consume fish like they used to causing a fall in the demand for fish
Anuolu
is not really possible to let the value of a goods to be same at the same time.....
Salome
Suppose the inflation rate is 6%, does it mean that all the goods you purchase will cost 6% more than previous year? Provide with reasoning.
Geetha Reply
Not necessarily. To measure the inflation rate economists normally use an averaged price index of a basket of certain goods. So if you purchase goods included in the basket, you will notice that you pay 6% more, otherwise not necessarily.
Waeth
discus major problems of macroeconomics
Alii Reply
what is the problem of macroeconomics
Yoal
Economic growth Stable prices and low unemployment
Ephraim
explain inflationcause and itis degre
Miresa Reply
what is inflation
Getu
increase in general price levels
WEETO
Good day How do I calculate this question: C= 100+5yd G= 2000 T= 2000 I(planned)=200. Suppose the actual output is 3000. What is the level of planned expenditures at this level of output?
Chisomo Reply
how to calculate actual output?
Chisomo
how to calculate the equilibrium income
Beshir
Criteria for determining money supply
Thapase Reply
who we can define macroeconomics in one line
Muhammad
Aggregate demand
Mohammed
C=k100 +9y and i=k50.calculate the equilibrium level of output
Mercy Reply
Hi
Isiaka
Hi
Geli
hy
Man
👋
Bahunda
hy how are you?
Man
ys
Amisha
how are you guys
Sekou
f9 guys
Amisha
how are you guys
Sekou
ys am also fine
Amisha
fine and you guys
Geli
from Nepal
Amisha
nawalparasi district from belatari
Amisha
nd u
Amisha
I am Camara from Guinea west Africa... happy to meet you guys here
Sekou
ma management ho
Amisha
ahile becheclor ho
Amisha
hjr ktm bta ho ani k kaam grnu hunxa tw
Amisha
belatari
Amisha
1st year ho
Amisha
nd u
Amisha
ahh
Amisha
kaha biratnagar
Amisha
ys
Amisha
kina k vo
Amisha
money as unit of account means what?
Kalombe
A unit of account is something that can be used to value goods and services and make calculations
Jim
all of you please speak in English I can't understand you're language
Muhammad
I want to know how can we define macroeconomics in one line
Muhammad
it must be .9 or 0.9 no Mpc is greater than 1 Y=100+.9Y+50 Y-.9Y=150 0.1Y/0.1=150/0.1 Y=1500
Kalombe
Mercy is it clear?😋
Kalombe
hi can someone help me on this question If a negative shocks shifts the IS curve to the left, what type of policy do you suggest so as to stabilize the level of output? discuss your answer using appropriate graph.
Galge Reply
if interest rate is increased this will will reduce the level of income shifting the curve to the left ◀️
Kalombe
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  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.

Notification Switch

Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?

Ask