build details

# Part 4: Estimating Velocity by Summing Optical Flow Vectors

Modified 2020-10-22 by sageshoyu

We want to estimate our and velocity using the PiDrone’s camera. Thankfully, optical flow from the PiCamera is calculated on board the Raspberry Pi. All we have to do is process the optical flow vectors that have already been calculated for us!

To calculate the velocity, we have sum the components of all of the optical flow vectors and multiply the sum by some normalization constant. We calculate the velocity in the same way. Let be the normalization constant that allows us to convert the sum of components of optical flow vectors into a velocity.

How do we calculate ? Well, it must have something to do with the current height of the drone. Things that are far away move more slowly across your field of view. If a drone is at a height of .6 and a feature passes through its camera’s field of view in 1 second, then that drone is moving faster than another drone at a height of .1 whose camera also passes over the same feature in 1 second. If we let be the altitude of the drone, then the drone’s normalization constant must be , where is some number that accounts for the conversion of optical flow vectors multiplied by an altitude to a velocity. You do not have to worry about calculating (the flow coefficient), as it is taken care of for you.

In summary, to calculate the velocity, we have to sum the components of the optical flow vectors and then multiply the sum by . The velocity is calculated in the exact same way.

## Questions

Modified 2020-10-18 by sageshoyu

1. The Pi calculates that the optical flow vectors are [5 4], [1, 2], and [3, 2]. The flow vectors are in the form [-component, -component]. What are your and velocities and ? You solution will be in terms of , the altitude, and , the flow coefficient.

## Handin

Modified 2020-10-18 by sageshoyu

Use this link to access the assignment on Github classroom. Commit the files to hand in, as you did in the Introduction assignment.

Your handin should contain the following files:

• solutions.tex
• solutions.pdf