ManiAm / VENTOS_Public

VEhicular NeTwork Open Simulator (VENTOS)
http://maniam.github.io/VENTOS/
GNU General Public License v3.0
57 stars 25 forks source link

Regarding SUMO Usage #19

Closed patilsk closed 6 years ago

patilsk commented 6 years ago

Is it possible to give a captured traffic video itself as an input to the SUMO Simulator to generate a similar scenario in the simulation window? If not SUMO simulator, is there any other way to feed a recorded video input? I am very much concerned of using a traffic video rather than using OSM map or open web view. Thank you in advance.

Naeemullah1 commented 6 years ago

Hi, I am a very young researcher in Pakistan, but I have been working in VANETs and SUMO for around a year now. I can tell you with certainty that right now, this is impossible. In order to give a traffic video to SUMo and then generate the concerned files (NET, EDG, ROU, Traffic Demand etc), there has to be some preprocessing done on the video using Computer Vision libraries. An anlysis of the video in a computer vision algorithm to first find out the edges of the network, then possible lanes, then the number of vehicles, their estimated speed, then frequency and many other paramters, would require a tremendous amount of work. The easier alternative is to design the traffic scenario and network in the default manner. Regards

patilsk commented 6 years ago

Hello Sir,

Thank you for your advice and I do agree with your thoughts that it does require a lot of work to be done. For now its the basic routine for generating the traffic is what I need to follow.

On Wed, Mar 21, 2018, 8:35 PM Naeemullah notifications@github.com wrote:

Hi, I am a very young researcher in Pakistan, but I have been working in VANETs and SUMO for around a year now. I can tell you with certainty that right now, this is impossible. In order to give a traffic video to SUMo and then generate the concerned files (NET, EDG, ROU, Traffic Demand etc), there has to be some preprocessing done on the video using Computer Vision libraries. An anlysis of the video in a computer vision algorithm to first find out the edges of the network, then possible lanes, then the number of vehicles, their estimated speed, then frequency and many other paramters, would require a tremendous amount of work. The easier alternative is to design the traffic scenario and network in the default manner. Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19#issuecomment-374970290, or mute the thread https://github.com/notifications/unsubscribe-auth/AjKqZyI2_QW_kRQnGOTH_XckmiYw9x9Yks5tgmxKgaJpZM4SWCSy .

patilsk commented 6 years ago

Hello Sir,

Now that you have been working in this field for a long time.I have a few questions to ask.I would like to know if you could answer a few of them as it would prove helpful in my case. I have a few questions noted below:

  1. For entering the count values in the OSM Web Wizard(osmWebWizard.py) is it possible in any case to read these values through a python script?As I am generating a count value from tracking in a traffic video.
  2. Is it in any way possible to give these generated values of speed and count of vehicles from one python file into other to generate the required scenario in SUMO? Thank you in advance.

On Wed, Mar 21, 2018 at 8:35 PM, Naeemullah notifications@github.com wrote:

Hi, I am a very young researcher in Pakistan, but I have been working in VANETs and SUMO for around a year now. I can tell you with certainty that right now, this is impossible. In order to give a traffic video to SUMo and then generate the concerned files (NET, EDG, ROU, Traffic Demand etc), there has to be some preprocessing done on the video using Computer Vision libraries. An anlysis of the video in a computer vision algorithm to first find out the edges of the network, then possible lanes, then the number of vehicles, their estimated speed, then frequency and many other paramters, would require a tremendous amount of work. The easier alternative is to design the traffic scenario and network in the default manner. Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19#issuecomment-374970290, or mute the thread https://github.com/notifications/unsubscribe-auth/AjKqZyI2_QW_kRQnGOTH_XckmiYw9x9Yks5tgmxKgaJpZM4SWCSy .

Naeemullah1 commented 6 years ago

Hello! I am assuming the following: a) You are running a python script for counting vehicles in a traffic video. b) The script is running forever (Infinite Loop or non-terminating repeating procedure) You want to do: I) Run the OSM Web Wizard and when providing the count of vehicles, you want it to be provided by the script that is already running.

You need: 1) Another Python Script, that calls the OSM Webwizard and imports to it the variable from the Python Script which is counting the vehicles.

Make an output argument in the vehicle Counter Script. Then Import the required value in the osmWebwizard on the fly. But remember, the value is imported once for every call of the script. Add the following sections appropriately in the osmwebwizard file as per your needs. The "out" variable contains the count of vehicles when run because you have specified an output argument in your vehicle counter script that you are using for video based analysis. In the last line, instead of printing the value, you can use the value in the osmwebwizard file instead of 'count' when required. I hope that helps. For more information, see documentation of p.communicate() procedure in python. Good luck.

import subprocess cmd = 'python vehicleCounterScript.py'

p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) out, err = p.communicate() result = out.split('\n')for lin in result: if not lin.startswith('#'): print(lin)

On Thu, Mar 22, 2018 at 2:46 PM, patilsk notifications@github.com wrote:

Hello Sir,

Now that you have been working in this field for a long time.I have a few questions to ask.I would like to know if you could answer a few of them as it would prove helpful in my case. I have a few questions noted below:

  1. For entering the count values in the OSM Web Wizard(osmWebWizard.py) is it possible in any case to read these values through a python script?As I am generating a count value from tracking in a traffic video.
  2. Is it in any way possible to give these generated values of speed and count of vehicles from one python file into other to generate the required scenario in SUMO? Thank you in advance.

On Wed, Mar 21, 2018 at 8:35 PM, Naeemullah notifications@github.com

wrote:

Hi, I am a very young researcher in Pakistan, but I have been working in VANETs and SUMO for around a year now. I can tell you with certainty that right now, this is impossible. In order to give a traffic video to SUMo and then generate the concerned files (NET, EDG, ROU, Traffic Demand etc), there has to be some preprocessing done on the video using Computer Vision libraries. An anlysis of the video in a computer vision algorithm to first find out the edges of the network, then possible lanes, then the number of vehicles, their estimated speed, then frequency and many other paramters, would require a tremendous amount of work. The easier alternative is to design the traffic scenario and network in the default manner. Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19# issuecomment-374970290, or mute the thread https://github.com/notifications/unsubscribe-auth/AjKqZyI2_QW_kRQnGOTH_ XckmiYw9x9Yks5tgmxKgaJpZM4SWCSy .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19#issuecomment-375236980, or mute the thread https://github.com/notifications/unsubscribe-auth/AGo1yzld-pSVS0YG7OkG5k2McHgUBqMlks5tg3LhgaJpZM4SWCSy .

-- Naeem Ullah Student Researcher p: 03429188636 a: Peshawar e: Engr.Naeemullah1@gmail.com Please support greenery, plant trees, and avoid printing.

patilsk commented 6 years ago

Hello Sir,

Thank you once again for your kind gesture. You have rightly understood my problem and hopefully you solution may work out in my situation. Thank you once again.

On Fri, Mar 23, 2018 at 9:29 AM, Naeemullah notifications@github.com wrote:

Hello! I am assuming the following: a) You are running a python script for counting vehicles in a traffic video. b) The script is running forever (Infinite Loop or non-terminating repeating procedure) You want to do: I) Run the OSM Web Wizard and when providing the count of vehicles, you want it to be provided by the script that is already running.

You need: 1) Another Python Script, that calls the OSM Webwizard and imports to it the variable from the Python Script which is counting the vehicles.

Make an output argument in the vehicle Counter Script. Then Import the required value in the osmWebwizard on the fly. But remember, the value is imported once for every call of the script. Add the following sections appropriately in the osmwebwizard file as per your needs. The "out" variable contains the count of vehicles when run because you have specified an output argument in your vehicle counter script that you are using for video based analysis. In the last line, instead of printing the value, you can use the value in the osmwebwizard file instead of 'count' when required. I hope that helps. For more information, see documentation of p.communicate() procedure in python. Good luck.

import subprocess cmd = 'python vehicleCounterScript.py'

p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) out, err = p.communicate() result = out.split('\n')for lin in result: if not lin.startswith('#'): print(lin)

On Thu, Mar 22, 2018 at 2:46 PM, patilsk notifications@github.com wrote:

Hello Sir,

Now that you have been working in this field for a long time.I have a few questions to ask.I would like to know if you could answer a few of them as it would prove helpful in my case. I have a few questions noted below:

  1. For entering the count values in the OSM Web Wizard(osmWebWizard.py) is it possible in any case to read these values through a python script?As I am generating a count value from tracking in a traffic video.
  2. Is it in any way possible to give these generated values of speed and count of vehicles from one python file into other to generate the required scenario in SUMO? Thank you in advance.

On Wed, Mar 21, 2018 at 8:35 PM, Naeemullah notifications@github.com

wrote:

Hi, I am a very young researcher in Pakistan, but I have been working in VANETs and SUMO for around a year now. I can tell you with certainty that right now, this is impossible. In order to give a traffic video to SUMo and then generate the concerned files (NET, EDG, ROU, Traffic Demand etc), there has to be some preprocessing done on the video using Computer Vision libraries. An anlysis of the video in a computer vision algorithm to first find out the edges of the network, then possible lanes, then the number of vehicles, their estimated speed, then frequency and many other paramters, would require a tremendous amount of work. The easier alternative is to design the traffic scenario and network in the default manner. Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19# issuecomment-374970290, or mute the thread https://github.com/notifications/unsubscribe- auth/AjKqZyI2_QW_kRQnGOTH_ XckmiYw9x9Yks5tgmxKgaJpZM4SWCSy .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19# issuecomment-375236980, or mute the thread https://github.com/notifications/unsubscribe-auth/AGo1yzld- pSVS0YG7OkG5k2McHgUBqMlks5tg3LhgaJpZM4SWCSy .

-- Naeem Ullah Student Researcher p: 03429188636 a: Peshawar e: Engr.Naeemullah1@gmail.com Please support greenery, plant trees, and avoid printing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19#issuecomment-375537679, or mute the thread https://github.com/notifications/unsubscribe-auth/AjKqZ6sY0irR_pBfFgFgmgNccpIlakGiks5thHMvgaJpZM4SWCSy .

Naeemullah1 commented 6 years ago

Hi, Continuing from the previous answer, if you need to import static value which does not change w.r.t. time, then you do not need the communication procedure. Simply, add from vehicleCounterScript import count; in the osmwebwizrd file. Hope that eases your solution. Regards

patilsk commented 6 years ago

Yes in case of static value it is a right thing to do so. Thank you once again.

On Sat, Mar 24, 2018, 12:13 AM Naeemullah notifications@github.com wrote:

Hi, Continuing from the previous answer, if you need to import static value which does not change w.r.t. time, then you do not need the communication procedure. Simply, add from vehicleCounterScript import count; in the osmwebwizrd file. Hope that eases your solution. Regards

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/19#issuecomment-375763415, or mute the thread https://github.com/notifications/unsubscribe-auth/AjKqZ7A414V4hXJsz0WZtVG9bEaQFQEJks5thUJBgaJpZM4SWCSy .