<< Chapter < Page Chapter >> Page >
Details on what kinds of data are used to test our system, and how they were selected.

The main purpose of our device is to detect velocity of motions in a movie file, and it is helpful to understand the mechanism in idealized cases. It is too complicated to come up with appropriate algorithms for all possible input data at once, and we want to look at the simpliest cases first. Our choice of data is a simulated movie. Reducing to bare bones, a blank, constant background(noise-free) with a single object moving across the screen is a good start.

Making frames

Manual coding of movies was done in MATLAB, using matrices of zeros and ones. zeros represents background, and ones represent an object. For simplicity, movies are in grayscale (black for zeros and white for ones).

Matrix to frame

Command 'imagesc(matrix)' on MATLAB will give us a simple picture

Looking at above matrix, different shapes can easily be made by arranging the ones in different layouts. We have created square, vertical rectangle, horizontal rectangle, triangle, and circle shapes. Once a desired image with an object is created, the 'getframe' command in MATLAB converts images to frames.

Making movies

To make a movie of a "moving" object (represented as a group of ones), our program can simply create multiple frames with the group of ones in different locations. One can move most any object in any direction in a reasonable frame size. However, creating a movie with non-axial motion can be very tedious in MATLAB, so we chose motions along the horizontal and vertical axis.

For our purpose, we set the screen size to be 256x256. Each pixel corresponds to one entry in the matrix.

Moving square

Square moving into the screen

Square in the screen

Different velocities can be achieved by varying number of pixels moved over per frame. In other words, within the same number of frames, a movie with a faster object will have its object moved over further across the screen than one with a slower object.

Moving triangle with different speeds

Triangle moving at 10 pixels per frame
Triangle moving at 50 pixels per frame

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2005. OpenStax CNX. Sep 25, 2007 Download for free at http://cnx.org/content/col10380/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2005' conversation and receive update notifications?

Ask