<< return to Vizycam.com

User Tools

Site Tools


wiki:radar_app

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:radar_app [2023/05/07 15:08]
vizycam
wiki:radar_app [2023/05/09 07:40] (current)
vizycam
Line 3: Line 3:
 ===== Overview ===== ===== Overview =====
  
-This app will log vehicular traffic on a road or thoroughfare. ​ It will also measure the speed of each vehicle and determine if the speed limit that you set is being exceeded, and it can be configured to text you when someone exceeds the speed limit. ​ The pictures are chosen to achieve the best possible view of a vehicle'​s license plate. ​ Additionally,​ the pictures are uploaded to Google Photos if you wish.  ​+This app will log vehicular traffic on a road or thoroughfare. ​ It will also measure the speed of each vehicle and determine if the speed limit that you set is being exceeded, and it can be configured to text you when someone exceeds the speed limit. ​ The pictures are chosen to achieve the best possible view of a vehicle'​s license plate. ​ Additionally,​ the pictures ​of each vehicle ​are uploaded to Google Photos if you wish.  ​
  
 ===== Getting started ===== ===== Getting started =====
Line 14: Line 14:
   - An outdoor enclosure will be necessary if you want Vizy to stay outside, but it's probably a good idea to get the Radar application working without an outdoor enclosure first. ​   - An outdoor enclosure will be necessary if you want Vizy to stay outside, but it's probably a good idea to get the Radar application working without an outdoor enclosure first. ​
  
-Begin by turning on your Vizy and pointing your browser to it. (Please refer to the getting started guide if you need help with connecting to your Vizy, etc.) Run the Radar application by clicking on the ☰ icon in the upper right corner and selecting Apps/​examples. Then scroll over to Radar in Apps, then click on Run.+Begin by turning on your Vizy and pointing your browser to it.  (Please refer to the [[wiki:​vizy_getting_started|getting started guide]] if you need help with connecting to your Vizy, etc.)  Run the Radar application by clicking on the ☰ icon in the upper right corner and selecting ​**Apps/​examples**. Then scroll over to Radar in **Apps**, then click on **Run**.
  
-FIXME select app+{{wiki:​image_1597.jpg?​450}}
  
 You'll be presented with a screen similar to below. The image at the top of the screen is the live video feed of what Vizy sees (for example, the road). Various controls (buttons, sliders) are shown below the video feed, which we'll describe in more detail. ​   You'll be presented with a screen similar to below. The image at the top of the screen is the live video feed of what Vizy sees (for example, the road). Various controls (buttons, sliders) are shown below the video feed, which we'll describe in more detail. ​  
  
-FIXME app pic+{{wiki:​image_1601.jpg?​600}}
  
-One thing you'll probably notice is that the video window is dark.  This is to prevent ​pictures with motion blur.  ​(Normally, the Radar application is taking footage from daytime/​outside lighting conditions. To fix this, bring up the setting ​dialog by clicking on the **Settings** button, and enable **Low light**, which will allow you to better test indoors. ​+One thing you'll probably notice is that the video window is dark.  This is to prevent motion blur in the images.  ​That isnormally ​the Radar application is taking footage from daytime/​outside lighting conditions ​and the vehicles are typically moving quickly across the image.  To fix the dark image, bring up the settings ​dialog by clicking on the **Settings** button, and enable **Low light**, which will allow you to better test indoors. ​ 
 + 
 +{{wiki:​image_1600.jpg?​450}}
  
 To test, take your hand and swipe it across the image such that your hand appears on one side of the image and exits the opposite side of the image. ​ It should detect your hand and estimate its speed as shown below. To test, take your hand and swipe it across the image such that your hand appears on one side of the image and exits the opposite side of the image. ​ It should detect your hand and estimate its speed as shown below.
  
-FIXME hand+{{wiki:​image_1599.jpg?​600}}
  
 ==== Media Queue ==== ==== Media Queue ====
Line 32: Line 34:
 You'll notice that when detecting vehicles (or your hand), the recent detections are displayed below the live feed with the measured speed.  ​ You'll notice that when detecting vehicles (or your hand), the recent detections are displayed below the live feed with the measured speed.  ​
  
-FIXME picture of media queue+{{wiki:​image_1603.jpg?​700}}
    
 ==== Calibration ==== ==== Calibration ====
  
-The Radar application measures the distance a vehicle travels between each frame and then fits a straight line across all measurements. ​ This method is quite accurate, but it needs to be calibrated to accurately associate the pixels in the image with actual distances so it can estimate the speed of the vehicle ​(either kph or mph).  This can be done by either driving in front of Vizy at a known speed, or by estimating the speed of a given vehicle. ​  ​Because of camera geometry, lanes closer to Vizy's lens will have faster apparent motion than lanes further away from Vizy's lens.  For this reason, it's best to calibrate the speed of vehicles moving in both directions to achieve the most accurate speed measurements. ​ (Currently, the Radar application assumes there are only two lanes, one for each direction of travel.)+The Radar application measures the distance a vehicle travels between each frame and then fits a straight line across all measurements. ​ This method is quite accurate, but it needs to be calibrated to accurately associate the pixels in the image with actual distances so it can estimate the speed of the vehicle ​in either kph or mph.  This can be done by either driving ​your vehicle ​in front of Vizy at a known speed, or by estimating the speed of a given vehicle. ​  ​Because of camera geometry, lanes closer to Vizy's lens will have faster apparent motion than lanes further away.  For this reason, it's best to calibrate the speed of vehicles moving in both directions to achieve the most accurate speed measurements. ​ (Currently, the Radar application assumes there are only two lanes, one for each direction of travel.)
   ​   ​
 To calibrate, just click on the image that contains the vehicle that you know the speed of.  Then click anywhere within the image to bring up the calibration dialog. To calibrate, just click on the image that contains the vehicle that you know the speed of.  Then click anywhere within the image to bring up the calibration dialog.
  
-FIXME calibration dialog+{{wiki:​image_1604.jpg?​450}}
  
 Type in the speed and click on **Calibrate**. ​ This will set the calibration for this image. ​ Note, it won't change the speeds of other detection images, however, but new vehicle detections will be affected.  ​ Type in the speed and click on **Calibrate**. ​ This will set the calibration for this image. ​ Note, it won't change the speeds of other detection images, however, but new vehicle detections will be affected.  ​
Line 56: Line 58:
  
 Clicking on **Settings** will bring up the Settings dialog. ​ Clicking on **Settings** will bring up the Settings dialog. ​
 +
 +{{wiki:​image_1606.jpg?​450}}
  
   * **Speed limit**: This adjusts the speed limit. ​ Vehicles that exceed this speed are "​speeders"​. ​   * **Speed limit**: This adjusts the speed limit. ​ Vehicles that exceed this speed are "​speeders"​. ​
-  * **Sensitivity**:​ Lowering the sensitivity will reduce any false positive vehicle detections and increasing the sensitivity will reduce the false negative vehicle detections (not detecting vehicles that are there). +  * **Sensitivity**:​ Lowering the sensitivity will reduce any false positive vehicle detections and increasing the sensitivity will reduce the false negative vehicle detections (not detecting vehicles that are present). 
   * **Kilometers per hour**: Check this if you prefer kilometers per hour to miles per hour.   * **Kilometers per hour**: Check this if you prefer kilometers per hour to miles per hour.
   * **Camera pointing left**: Check this if Vizy is pointing to the left.  Leave it unchecked if Vizy is pointing to the right. ​ This helps Vizy determine when to take a picture such that it will get the best possible view of the license plate.  ​   * **Camera pointing left**: Check this if Vizy is pointing to the left.  Leave it unchecked if Vizy is pointing to the right. ​ This helps Vizy determine when to take a picture such that it will get the best possible view of the license plate.  ​
-  * **Upload to Google Photos**: ​ Check this if you want the media items in the media queue to be uploaded to Google Photos. ​ Google services need to be configured, however. ​ See the section on [[wiki:birdfeeder_app#​Configuring Google services|Configuring Google services]].+  * **Upload to Google Photos**: ​ Check this if you want the media items in the media queue to be uploaded to Google Photos. ​ Google services need to be configured, however. ​ See the section on [[wiki:radar_app#​Configuring Google services|Configuring Google services]].
   * **Text speeders**: Vizy will text you a picture when it detects a vehicle that is exceeding the speed limit. ​ See [[wiki:​texting|texting]].   * **Text speeders**: Vizy will text you a picture when it detects a vehicle that is exceeding the speed limit. ​ See [[wiki:​texting|texting]].
   * **Low light**: When using under low light conditions (e.g. indoors), check this.  ​   * **Low light**: When using under low light conditions (e.g. indoors), check this.  ​
Line 80: Line 84:
 Currently, the only text command that the Radar application supports is **mrv** (most recent vehicle). For example, to get information (description and picture) of the most recent vehicle that was detected: Currently, the only text command that the Radar application supports is **mrv** (most recent vehicle). For example, to get information (description and picture) of the most recent vehicle that was detected:
  
-FIXME picture of telegram app, mrv+{{wiki:​IMG_4768.jpg?​300}}
  
 Or you can get the N most recent vehicles by adding a number: Or you can get the N most recent vehicles by adding a number:
  
-FIXME picture of telegram app, mrv N+{{wiki:​IMG_4769.jpg?​300}}
  
 ===== Customizations,​ tweaks, etc. ===== ===== Customizations,​ tweaks, etc. =====
Line 96: Line 100:
 ==== Customized handlers ==== ==== Customized handlers ====
  
-For more advanced users who want to add their own custom features, the Radar application has handler code for various events and for text messages. ​ The handler code is in ''/​home/​pi/​vizy/​apps/​birdfeeder/​handlers.py''​. ​ Note, you can bring up the handler code easily from [[wiki:​vizy_editor#​Text editor|Vizy'​s built-in text editor]] by clicking on the ☰ button in the text editor and selecting ''​handlers.py''​. ​ Note also, once you change ''​handlers.py''​ you can simply click reload/​refresh on your browser and Vizy will automatically restart the application and your code changes will take effect.+For more advanced users who want to add their own custom features, the Radar application has handler code for various events and for text messages. ​ The handler code is in ''/​home/​pi/​vizy/​apps/​radar/​handlers.py''​. ​ Note, you can bring up the handler code easily from [[wiki:​vizy_editor#​Text editor|Vizy'​s built-in text editor]] by clicking on the ☰ button in the text editor and selecting ''​handlers.py''​. ​ Note also, once you change ''​handlers.py''​ you can simply click reload/​refresh on your browser and Vizy will automatically restart the application and your code changes will take effect.
  
-FIXME handlers.py+{{wiki:​image_1605.jpg}}
  
 === Event handler === === Event handler ===
wiki/radar_app.1683490096.txt.gz · Last modified: 2023/05/07 15:08 by vizycam