Long hours waiting in line at a career fair or not knowing how long it will take to pass TSA in airports ultimately leads to huge amounts of time wasted. It would be nice to have some application that could accurately detect the length and wait time of a line before spending my own time waiting in them. I wanted to build an application that could make use of a camera to detect formations of human lines and the speed of that line.

What it does

My application contains 3 demos from parsed video data I have collected on my phone this past week. For each video, the application parses the video into every 10th frame and passes this photo to Google Cloud Vision's object detection. The application then runs a cross-correlation algorithm on subsequent frames to detect which direction the observed line is moving in. Finally the application utilizes OpenCV to draw boxes around detected people and an arrow to visualize the current velocity of the line.

Built With

Python OpenCV Google Cloud Vision Javascript Plotly Jquery Bootstrap HTML CSS

Challenges I ran into

Google Cloud Vision's API doesn't detect every person in a photo, especially when there are resolution issues or if the person in the photo is too small. I had to find another way to detect where a line was and the movement of the line. Furthermore, most of my video data has individual students walking by and creating noise in the data. Therefore, instead of basing the line velocity on the detected humans in the video, I spliced a frame into 1/20th's, then ran a cross - correlation algorithm to find the direction and magnitude of the greatest similarity to the subsequent frame relative to the original frame.

After finding the direction and magnitude of the line, I realized that this information was stored as pixels/seconds. I had to find a way to convert this data into a metric of greater relevance.

Accomplishments that I'm proud of

First time doing a hackathon mainly on my own!

What I learned

Sleep is very important and computer vision doesn't always work the way you want to. Also I wanted to use Tensorflow and ML, but my computer doesn't have a GPU... so that's important to have

What's next for Align a Line

Hopefully this algorithm and concept idea can be implemented to help Save Time and Shorten Lines

Share this project: