ECE 497 Project - Fun Face Cam
Embedded Linux Class by Mark A. Yoder
Team members: Joe Militello, Tim Smith
Contents
Grading Template
Draft Feedback
Overall it looks good. I got it to work on my Bone using apt install libopencv-dev.
I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!
09 Executive Summary 10 Installation Instructions 09 User Instructions 09 Highlights 10 Theory of Operation 10 Work Breakdown 10 Future Work 10 Conclusions 10 Demo 10 Not Late Comments: I'm looking forward to seeing this. Score: 97/100
Executive Summary
Using the PSEye, a user can take a picture of himself or herself. He or she is able to edit the picture to put fun things on their face such as sunglasses, mustaches, and a hat.
We initially did lots of research on different types of of sample code to do face recognition. We found that the easiest was to do to it was through OpenCV. We were able to get OpenCV working and we were able to take pictures with it. We also used OpenCV to do the face recognition.
We also built a server on the bone to display the images as well as give the user options. We coded the pages in HTML and in JavaScript.
Our web server was based on code from Mark A. Yoder, which we modified for our uses. We also combined together OpenCV examples from Derek Molloy and the OpenCV website to make our facial recognition application
Packaging
There is no packaging for this. Just attach the PSEye onto the beagle bone and connect the beagle bone to a computer.
Installation Instructions
Here are the instructions on how to install the Fun Face Cam
- You can grab the github repo for the project from here: https://github.com/timSmith740/embeddedLinux. The project is located in the project directory.
- Before you begin building the project you must make sure you have OpenCV installed. The following instructions are from https://solarianprogrammer.com/2014/04/21/opencv-beaglebone-black-ubuntu/
- Make sure that your Linux distribution is up-to-date
Beagle$ sudo apt-get update Beagle$ sudo apt-get upgrade
I wouldn't upgrade. Sometimes it doesn't work.
- Install the OpenCV prerequisites
Beagle$ sudo apt-get install build-essential cmake pkg-config Beagle$ sudo apt-get install libtiff4-dev libjpeg-dev libjasper-dev libpng12-dev Beagle$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
- Download the lastest OpenCV from GitHub:
Beagle$ git clone https://github.com/Itseez/opencv.git
- Now you can start building OpenCV, WARNING this could take a couple hours!!!
apt install libopencv-dev worked for me. Took only 8.5 minutes to install.
Beagle$ cd opencv Beagle$ mkdir build && cd build Beagle$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=OFF -D WITH_CUFFT=OFF -D WITH_CUBLAS=OFF -D WITH_NVCUVID=OFF -D WITH_OPENCL=OFF -D WITH_OPENCLAMDFFT=OFF -D WITH_OPENCLAMDBLAS=OFF -D BUILD_opencv_apps=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D ENABLE_NEON=on .. Beagle$ make Beagle$ sudo make install Beagle$ sudo ldconfig
- If that finalized without error, then OpenCV has been installed on your BeagleBone
- Now switch back into the project folder
Beagle$ cd Beagle$ cd embeddedLinux/Project
- Now you must compile the boneCV.cpp file
Beagle$ ./Build
- From there you are ready to start the project
- You can get Playstation Eyes at this link https://www.amazon.com/PlayStation-Eye-3/dp/B000VTQ3LU
User Instructions
- First, make sure the Beagle Bone is off. Plug in the PSEye camera into the USB port on the bone. Now turn on the bone by plugging it in to a PC.
- To run the program, run the following command. It will take a bit before the Listening on 9090 appears.
beagle$ node boneServer.js Listening on 9090
The following message will pop up as well, but this is just a side not. Ignore it.
Option log level is not valid. Please refer to the README.
Your bone is now running a sever. To view it, on your web browser go to the following.
192.168.7.2:9090
- From there you can have a picture taken, and can start placing FUN images on your picture. Start by pressing the take a picture button. A a few seconds, a new picture will pop up on the screen. Press the hat, sunglasses, and mustache buttons to add the corresponding features to the face. You can also press the hat, sunglasses, and mustache buttons after placing them to remove them. If no face is detected a pop up shows up and requests that you take another picture.
Highlights
Watch our youtube video https://www.youtube.com/watch?v=nO4rIyi-xgw&app=desktop
Theory of Operation
We are using OpenCV to take and analyze pictures. This is running as a C++ application. We are also running a web server on the bone, which serves an HTML page to a web browser.
The HTML page and web server are connected together through sockets. Through these sockets commands are sent from the HTML page to take a picture which runs the C++ application, and through the same sockets data containing the location of the face is sent to the HTML page for place of our funny additions.
Work Breakdown
Completed: Setting up web page hosted on Beaglebone: Joe Militello
Pictures and Placement: Joe Militello
Setting up facial feature recognition: Tim Smith
Setting up sockets: Tim Smith
Sending Data from OpenCV to Sever: Tim Smith/Joe Militello
Documentation: Tim Smith/Joe Militello
Future Work
This project could be changed so that live stream video can be added. Instead of it taking a picture, it would live stream the video to the web browser.
Furthermore, the program could do live tracking, so when the face moves, the fun face elements would move along with it.
It is also possible to try and write a custom picture grabber, so that the pictures could be taken at 640x480, which is the maximum the Playstation Eye allows
Conclusions
Overall we are happy with the results of our project. We are able to take pictures from the Beagle Bone, upload them to a web sever hosted by the Beagle Bone, do facial recognition, and finally add funny elements to the picture.
If we were to do this again, we would try to add live video streaming to it. Furthermore we would add more fun elements to add to the picture.
Embedded Linux Class by Mark A. Yoder