MovementDetection
Palm Movement Detection using Optical Flow
This lab is part of AI for Beginners Curriculum.
Consider this video, in which a person's palm moves left/right/up/down on the stable background.
Your goal would be to use Optical Flow to determine, which parts of video contain up/down/left/right movements.
Start by getting video frames as described in the lecture:
Now, calculate dense optical flow frames as described in the lecture, and convert dense optical flow to polar coordinates:
Build histogram of directions for each of the optical flow frame. A histogram shows how many vectors fall under certain bin, and it should separate out different directions of movement on the frame.
You may also want to zero out all vectors whose magnitude is below certain threshold. This will get rid of small extra movements in the video, such as eyes and head.
Plot the histograms for some of the frames.
Looking at histograms, it should be pretty straightforward how to determine direction of movement. You need so select those bins the correspond to up/down/left/right directions, and that are above certain threshold.
Congratulations! If you have done all steps above, you have completed the lab!