This is an old revision of the document!
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.
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.
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.
Here's our recommended camera setup that minimizes motion blur:
Auto-shutter
.Shutter-speed
to the lowest value possible while avoiding under-exposure (dark images).Brightness
to brighten the image if necessary. Avoid setting the brightness to more than 95%, which may introduce too much image noise.
Click on the Capture
tab.
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:
Here’s a decent frame. It has some motion blur, but not too much:
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:
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.
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.
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.
Oftentimes the beginning and end of the footage contain data that are inaccurate or unwanted. In our example, as the ball comes into the frame on the left, the data points are somewhat inaccurate because the ball is cropped by the edge of the frame.
By adjusting the Time
slider on the left we can remove these data points:
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:
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 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.
With your mouse pointer, hover over the data points either on the video or the graphs. You will see markers that will show you the same data points in the video and graphs. This is useful if you, for example, wanted to get the velocity and acceleration of a particular point.
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.
Using the mouse pointer, click and drag a line that equals 1 meter.
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
.
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.
MotionScope is able to extract motion by using the simple technique of frame differencing. That is, MotionScope creates a background image and then subtracts this image from all frames in the sequence. It then performs thresholding on the frame differences. If the difference exceeds a threshold, it’s assumed that there was motion in that part of the frame.
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.
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
).
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. Any motion that’s moving parallel to the wall will be captured.
For example, motion directed 45 degrees with respect to that wall won't be fully captured. About 70% of the motion will be captured, 30% will be lost. (Cosine of 45 degrees is 0.7071 or ~70%.)