Difference between revisions of "ECE 497 Project - Fun Face Cam"

From eLinux.org
Jump to: navigation, search
(Changed team member link)
m
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:ECE497 |Pf]]
+
[[Category:ECE497Fall2016|Pf]]
 
{{YoderHead}}
 
{{YoderHead}}
 
+
[[File:Fun Face Cam PromotionImage.jpg|thumbnail|This picture shows what our program can do. ]]
 
Team members: [[user:Joseph Militello|Joe Militello]], [[user:Smithtl|Tim Smith]]
 
Team members: [[user:Joseph Militello|Joe Militello]], [[user:Smithtl|Tim Smith]]
  
 
== Grading Template ==
 
== 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.
 
I'm using the following template to grade.  Each slot is 10 points.
 
0 = Missing, 5=OK, 10=Wow!
 
0 = Missing, 5=OK, 10=Wow!
  
 
<pre style="color:red">
 
<pre style="color:red">
00 Executive Summary
+
09 Executive Summary
00 Installation Instructions  
+
10 Installation Instructions  
00 User Instructions
+
09 User Instructions
00 Highlights
+
09 Highlights
00 Theory of Operation
+
10 Theory of Operation
00 Work Breakdown
+
10 Work Breakdown
00 Future Work
+
10 Future Work
00 Conclusions
+
10 Conclusions
00 Demo
+
10 Demo
00 Late
+
10 Not Late
 
Comments: I'm looking forward to seeing this.
 
Comments: I'm looking forward to seeing this.
  
Score:  10/100
+
Score:  97/100
 
</pre>
 
</pre>
 
<span style="color:red">(Inline Comment)</span>
 
  
 
== Executive Summary ==
 
== Executive Summary ==
  
Give two sentence intro to the project.
+
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.
  
Give two sentences telling what works.
 
  
Give two sentences telling what isn't working.
+
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.  
  
End with a two sentence conclusion.
+
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.
  
The sentence count is approximate and only to give an idea of the expected length.
+
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 ==
 
== Packaging ==
  
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final 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 ==
 
== Installation Instructions ==
  
Give step by step instructions on how to install your project.   
+
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 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/ 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
 +
<span style="color:red">I wouldn't upgrade.  Sometimes it doesn't work.</span>
 +
* 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, <span style="color:red"> WARNING this could take a couple hours!!!</span>
 +
<span style="color:blue"> apt install libopencv-dev worked for me.  Took only 8.5 minutes to install.</span>
 +
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 https://www.amazon.com/PlayStation-Eye-3/dp/B000VTQ3LU]
 +
 
 +
== User Instructions ==
 +
[[File:BoardOfFunFace.jpg|thumbnail|The hardware components of the Fun Face Cam ]]
 +
 
 +
* 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.
  
* Include your [https://github.com/ github] path as a link like this to the read-only git site:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].
+
* To run the program, run the following command. It will take a bit before the Listening on 9090 appears.  
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
 
* Include a Makefile for you code.
 
* Include any additional packages installed via '''opkg'''.
 
* Include kernel mods.
 
* If there is extra hardware needed, include links to where it can be obtained.
 
  
== User Instructions ==
+
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
  
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
+
* 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 ==
 
== Highlights ==
 +
[[File:UserFunFaceCam.jpg|thumb|right|The user having fun with the Fun Face Cam ]]
  
Here is where you brag about what your project can do.
 
  
Include a [http://www.youtube.com/ YouTube] demo.
+
Watch our youtube video https://www.youtube.com/watch?v=nO4rIyi-xgw&app=desktop
  
 
== Theory of Operation ==
 
== Theory of Operation ==
  
Give a high level overview of the structure of your software. Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.
+
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 ==
 
== Work Breakdown ==
  
List the major tasks in your project and who did what.
+
Completed:
 +
Setting up web page hosted on Beaglebone: Joe Militello
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
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 ==
 
== Future Work ==
  
Suggest addition things that could be done with this project.
+
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 ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
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.  
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 08:42, 26 October 2017

thumb‎ Embedded Linux Class by Mark A. Yoder


This picture shows what our program can do.

Team members: Joe Militello, Tim Smith

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

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

User Instructions

The hardware components of the Fun Face Cam
  • 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

The user having fun with the Fun Face Cam


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.




thumb‎ Embedded Linux Class by Mark A. Yoder