<< return to Vizycam.com

User Tools

Site Tools


wiki:motionscope_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
Next revision Both sides next revision
wiki:motionscope_app [2022/02/17 10:06]
vizycam [Motion parallel to the image plane]
wiki:motionscope_app [2022/02/18 23:04]
freed one more UI in bold, edit for redundancy
Line 1: Line 1:
 ======MotionScope====== ======MotionScope======
  
-We wrote MotionScope after asking our physics teacher friends what tools they would like to have available to teach and/or study the concepts of projectile motion -- concepts such as velocity, acceleration,​ momentum, and energy. ​ MotionScope uses Vizy’s camera to capture the motion of moving objects. ​ It can accurately determine the position of each object in each frame by using image processing. ​ It can then measure the velocity and acceleration of each object across each frame. ​ This information is presented to the user via interactive graphs within their web browser.+We wrote MotionScope after asking our physics teacher friends what tools they would like to have available to teach and/or study the concepts of projectile motion -- concepts such as velocity, acceleration,​ momentum, and energy.  ​ 
 + 
 +MotionScope uses Vizy’s camera to capture the motion of moving objects. ​ It can accurately determine the position of each object in each frame by using image processing. ​ It can then measure the velocity and acceleration of each object across each frame. ​ This information is presented to the user via interactive graphs within their web browser.
  
 {{wiki:​image_663.jpg}} {{wiki:​image_663.jpg}}
Line 7: Line 9:
 ======Quickstart====== ======Quickstart======
  
-To run MotionScope,​ click on ''​%%Apps/​Examples%%'' ​in the top-right menu and scroll over to MotionScope in ''​%%Apps%%''​, then click on ''​%%Run%%''​.  ​+To run MotionScope,​ click on **Apps/​Examples** in the top-right menu and scroll over to MotionScope in **Apps**, then click on **Run**.  ​
  
-Choose a well-lit setting for your Vizy and point your Vizy level such that it is looking straight ahead, neither up nor down.  Find an ordinary object like a ball, but anything you can easily toss is good.  ​+Choose a well-lit setting for your Vizy and place it levelsuch that it is looking straight ahead, neither up nor down.  Find an ordinary object ​-- like a ball, but anything you can easily toss is good.  ​
  
 =====Camera setup===== =====Camera setup=====
  
-In general, you want to set the camera at a high framerate and low shutter speed to minimize motion blur, which can make it difficult for Vizy to accurately determine the position of your object(s) in each frame.  ​But there is a problem with lowering the shutter speed: it can create dark, under-exposed images. ​ You can counter this by increasing the brightness slider and/or using an environment that’s well-lit. ​+In general, you want to set the camera at a high framerate and low shutter speed to minimize motion blur, which can make it difficult for Vizy to accurately determine the position of your object(s) in each frame.  ​However, ​lowering the shutter speed can create dark, under-exposed images. ​ You can counter this by increasing the brightness slider and/or using an environment that’s well-lit. ​
  
 {{wiki:​image_666.jpg?​700}} {{wiki:​image_666.jpg?​700}}
Line 19: Line 21:
 Here's our recommended camera setup that minimizes motion blur: Here's our recommended camera setup that minimizes motion blur:
  
-  * Choose ​''​%%768x432x10bpp%%'' ​mode.  This will provide the widest possible field-of-view.  +  * Choose ​**768x432x10bpp** mode.  This will provide the widest possible field-of-view.  
-  * Turn off auto shutter by clicking on ''​%%Auto-shutter%%''​.+  * Turn off auto shutter by clicking on **Auto-shutter**.
   * Choose a framerate of 50 fps.   * Choose a framerate of 50 fps.
-  * Adjust ​''​%%Shutter-speed%%'' ​to the lowest value possible while avoiding under-exposure (dark images). +  * Adjust ​**Shutter-speed** to the lowest value possible while avoiding under-exposure (dark images). 
-  * Increase ​''​%%Brightness%%'' ​to brighten the image if necessary. ​ Avoid setting the brightness to more than 95%, which may introduce too much image noise.+  * Increase ​**Brightness** to brighten the image if necessary. ​ Avoid setting the brightness to more than 95%, which may introduce too much image noise.
   ​   ​
 =====Capturing footage===== =====Capturing footage=====
  
-First, we need to capture footage of the motion we want to analyze. ​ Click on the ''​%%Capture%%'' ​tab. +First, we need to capture footage of the motion we want to analyze. ​ Click on the **Capture** tab. 
  
 {{wiki:​image_687.jpg?​700}} {{wiki:​image_687.jpg?​700}}
  
-Press ''​%%Record%%'' ​and toss the object in front of Vizy.  Press ''​%%Stop%%''​.  Now examine the footage that you just took by pressing ​''​%%Play%%''​.  You can pause the playback and look at individual frames by either grabbing the time slider or clicking on the prev/next frame buttons. ​ For example, a blurry frame will look similar to this:+Press **Record** and toss the object in front of Vizy.  Press **Stop**.  Now examine the footage that you just took by pressing ​**Play**.  You can pause the playback and look at individual frames by either grabbing the time slider or clicking on the prev/next frame buttons. ​ For example, a blurry frame will look similar to this:
  
 {{wiki:​image_690.jpg?​350}} {{wiki:​image_690.jpg?​350}}
Line 39: Line 41:
 {{wiki:​image_667.jpg?​350}} {{wiki:​image_667.jpg?​350}}
  
-If your frame is blurry, go to the ''​%%Camera%%'' ​tab and reduce the shutter-speed and increase the brightness if needed. ​ Given the amount of light in the environment,​ it may not be possible to reduce the motion blur to acceptable levels while also maintaining image brightness. ​ If this is the case you can either:+If your frame is blurry, go to the **Camera** tab and reduce the shutter-speed and increase the brightness if needed. ​ Given the amount of light in the environment,​ it may not be possible to reduce the motion blur to acceptable levels while also maintaining image brightness. ​ If this is the case you can either:
  
   * Move the object farther away from Vizy’s lens.  This will reduce the "image speed" (number of pixels traversed per second) of the object. ​ For example, doubling the distance from Vizy will halve the image speed. ​   * Move the object farther away from Vizy’s lens.  This will reduce the "image speed" (number of pixels traversed per second) of the object. ​ For example, doubling the distance from Vizy will halve the image speed. ​
Line 46: Line 48:
 =====Processing===== =====Processing=====
  
-Now that you have footage without excessive motion blur, click on the ''​%%Process%%'' ​tab.  Vizy should automatically start processing the frames in an effort to find your object in each frame.  ​+Now that you have footage without excessive motion blur, click on the **Process** tab.  Vizy should automatically start processing the frames in an effort to find your object in each frame.  ​
  
 {{wiki:​image_671.jpg?​700}} {{wiki:​image_671.jpg?​700}}
  
-After it’s done, Vizy will automatically switch to the Analyze tab so you can see the motion of your object rendered in all its glory.+After it’s done, Vizy will automatically switch to the **Analyze** tab so you can see the motion of your object rendered in all its glory.
  
 =====Analyzing===== =====Analyzing=====
  
-In the ''​%%Analyze%%'' ​tab, there are several adjustments,​ controls, and graphs.  ​+In the **Analyze** tab, there are several adjustments,​ controls, and graphs.  ​
  
 {{wiki:​image_675.jpg?​800}} {{wiki:​image_675.jpg?​800}}
Line 60: Line 62:
 ====Show==== ====Show====
  
-Let’s start by playing with the ''​%%Show%%'' ​control. ​ You can select whether you want to show just the objects or the objects with points, lines, and arrows. ​ The points, lines, and arrows are drawn on top of the video.+Let’s start by playing with the **Show** control. ​ You can select whether you want to show just the objects or the objects with points, lines, and arrows. ​ The points, lines, and arrows are drawn on top of the video.
  
 {{wiki:​image_674.jpg?​700}} {{wiki:​image_674.jpg?​700}}
Line 70: Line 72:
 {{wiki:​image_676.jpg?​700}} {{wiki:​image_676.jpg?​700}}
  
-By adjusting the ''​%%Time%%'' ​slider on the left we can remove these data points:+By adjusting the **Time** slider on the left we can remove these data points:
  
 {{wiki:​image_677.jpg?​700}} {{wiki:​image_677.jpg?​700}}
  
-Similarly, the end of our footage has the ball rolling back into frame. ​ We can remove these data points by adjusting the ''​%%Time%%'' ​slider on the right:+Similarly, the end of our footage has the ball rolling back into frame. ​ We can remove these data points by adjusting the **Time** slider on the right:
  
 {{wiki:​image_678.jpg?​700}} {{wiki:​image_678.jpg?​700}}
Line 80: Line 82:
 ====Spacing==== ====Spacing====
    
-You can choose the spacing of the samples by adjusting the ''​%%Spacing%%'' ​slider. ​ By increasing the spacing, the velocity and acceleration measurements are averaged over longer periods of time, and measurement noise can be reduced. ​  +You can choose the spacing of the samples by adjusting the **Spacing** slider. ​ By increasing the spacing, the velocity and acceleration measurements are averaged over longer periods of time, and measurement noise can be reduced. ​  
  
 {{wiki:​image_679.jpg?​700}} {{wiki:​image_679.jpg?​700}}
Line 86: Line 88:
 ====Graph selection==== ====Graph selection====
  
-You can also choose the graphs you wish to view by selecting ​the selector ​above each graph pair.   ​Position,​ velocity, and acceleration graphs for x and y are chosen by default. ​ Direction and magnitude graphs are available for velocity and acceleration.+You can also choose the graphs you wish to view from the dropdown menu above each graph pair.   ​Position,​ velocity, and acceleration graphs for x and y are chosen by default. ​ Direction and magnitude graphs are available for velocity and acceleration.
  
 {{wiki:​image_680.jpg}} ​ {{wiki:​image_680.jpg}} ​
Line 100: Line 102:
 Vizy will present its results in pixel units. ​ If you want the data that Vizy presents to be in different, more useful units such as meters, you will need to give Vizy a hint by telling it how many pixels there are in a meter.  ​ Vizy will present its results in pixel units. ​ If you want the data that Vizy presents to be in different, more useful units such as meters, you will need to give Vizy a hint by telling it how many pixels there are in a meter.  ​
  
-Choose ​''​%%Meters%%'' ​in the ''​%%Distance units%%'' ​selector. ​ Then click on the ''​%%Calibrate%%'' ​button that appears. ​+Choose ​**Meters** in the **Distance units** selector. ​ Then click on the **Calibrate** button that appears. ​
  
 {{wiki:​image_691.jpg}} {{wiki:​image_691.jpg}}
Line 108: Line 110:
 {{wiki:​image_685.jpg?​700}} {{wiki:​image_685.jpg?​700}}
  
-In our example, the tile on the floor provides markings that we can use to help draw a line that's 1 meter in length. ​ Note, we should draw a line that's in the same plane of motion as our object(s). ​ After drawing the calibration line, MotionScope will then present its data in meters, meters/​second,​ etc.  Alternatively,​ you can choose different calibration distances other than 1 meter. ​ You could choose 2 meters or 0.31 meters by changing the value in the text box.  Or you could choose different units (centimeters,​ feet) by selecting in ''​%%Distance units%%''​.+In our example, the tile on the floor provides markings that we can use to help draw a line that's 1 meter in length. ​ Note, we should draw a line that's in the same plane of motion as our object(s). ​ After drawing the calibration line, MotionScope will then present its data in meters, meters/​second,​ etc.  ​ 
 + 
 +Alternatively,​ you can choose different calibration distances other than 1 meter. ​ You could choose 2 meters or 0.31 meters by changing the value in the text box.  Or you could choose different units (centimeters,​ feet) by selecting ​them in **Distance units.**
  
 =====Saving/​loading====== =====Saving/​loading======
  
-You can save your project to SD card so you don’t lose your data.  Future versions of MotionScope will allow you to name the project and manage the project files. ​+You can save your project to the SD card so you don’t lose your data.  Future versions of MotionScope will allow you to name the project and manage the project files. ​
  
  
Line 121: Line 125:
 =====Adjusting the motion threshold=====  ​ =====Adjusting the motion threshold=====  ​
  
-In the Process tab, if you click on the ''​%%+%%'' ​button, the ''​%%Motion threshold%%'' ​slider is revealed. ​ You can seek to any part of the video with the time slider, and it will show you which parts of the image will be considered to be in motion. ​ You can adjust the ''​%%Motion threshold%%'' ​slider to find a good threshold that captures the motion you want to capture.+In the Process tab, if you click on the **+** button, the **Motion threshold** slider is revealed. ​ You can seek to any part of the video with the time slider, and it will show you which parts of the image will be considered to be in motion. ​ You can adjust the **Motion threshold** slider to find a good threshold that captures the motion you want.
  
 {{wiki:​image_686.jpg?​700}} {{wiki:​image_686.jpg?​700}}
Line 128: Line 132:
 =====Changing the motion extracting algorithm===== =====Changing the motion extracting algorithm=====
    
-For advanced users who don’t mind doing some Python programming,​ you can customize MotionScope’s motion extracting algorithm to fit your needs better. ​ For example, ​If you wanted to track the motion of a trebuchet you'd likely want to use visual clues other than motion (e.g. hue, structure) to extract the motion of the payload ​(only) ​as it's gaining speed and being flung. ​ Check out ''​%%simplemotion.py%%''​ in the source directory (''​%%/​home/​pi/​vizy/​apps/​motionscope%%''​).+For advanced users who don’t mind doing some Python programming,​ you can customize MotionScope’s motion extracting algorithm to fit your needs better. ​ For example, ​if you wanted to track the motion of a trebuchetyou'd likely want to use visual clues other than motion (e.g. hue, structure) to extract the motion of only the payload as it's gaining speed and being flung. ​ Check out ''​%%simplemotion.py%%''​ in the source directory (''​%%/​home/​pi/​vizy/​apps/​motionscope%%''​).
   ​   ​
  
 ======Motion parallel to the image plane====== ======Motion parallel to the image plane======
  
-MotionScope works best with any motion that’s parallel to the image plane. ​  ​Motion that’s coming toward or moving away from Vizy will not be fully captured.  ​That is, imagine Vizy looking at a wall straight-on. ​ +MotionScope works best with any motion that’s parallel to the image plane. ​  ​Motion that’s coming toward or moving away from Vizy will not be fully captured.  ​ 
-Any motion that’s moving parallel to the wall will be captured. ​ Refer to the figure below and the "plane of motion"​. ​  Notethe distance from Vizy doesn'​t matter, just the angle of the motion.  ​+ 
 +To visualize this, imagine Vizy looking at a wall straight-on. Any motion that’s moving parallel to the wall will be captured. ​ Refer to the figure below and the "plane of motion"​. ​  Notethe distance from Vizy doesn'​t matter, just the angle of the motion.  ​
  
 {{wiki:​image_662.jpg}} {{wiki:​image_662.jpg}}
wiki/motionscope_app.txt · Last modified: 2023/05/09 16:30 by vizycam