ÿþ<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>ECE 5760 Final Project</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="container"> <div id="main"> <div id="header"> <div width=1024 height=285><a href="index.html"><img src="images/ECE5760_05.png" width=1024 height=245 margin-left=25></a></div> <div class="highlevelon"><a href="highlevel.html">HIGH LEVEL DESIGN</a></div> <div class="hardware"><a href="hardware.html">HARDWARE/SOFTWARE</a></div> <div class="results"><a href="results.html">RESULTS</a></div> <div class="conclusion"><a href="conclusion.html">CONCLUSION</a></div> <div class="appendix"><a href="appendix.html">APPENDIX</a></div> </div> <div id="content"> <div id="full"> <div class="post"> <h1>High Level Design</h1><span></span> <br> <p>This project consisted of two main parts: face detection and drawing projections of a 3D cube onto 2D space. The following diagram shows the overall schematic of our design:</p> <div style= "text-align: center;"> <img src ="images/diagram.png" width="700" height ="400"> <br> <caption>Figure 1: Overall Schematic</caption> <br> </div> <br> <h3>Face Detection</h3> <p>There are many different algorithms to track human faces. One popular method tries to express images as a linear combination of reference faces or eigenfaces. Other methods use the color content of images to determine which pixels can represent human skin. We chose to use a color algorithm because we did not believe that we had enough memory to implement our project and store a large set of reference faces.</p> <p>For each video frame, we determined which pixels represented human skin based on the red and green color components. We performed various averaging operations to remove noise effects and to remove details like glasses and moustaches that are not skin tone but may affect face detection. The face s location was determined and passed to the Nios II to perform the projection calculations.</p> <br> <h3>Projection and Display</h3> <p>The projection calculations were performed on the Nios II so they could be done in floating point. The Nios took the offset from the user s face to the center of the VGA screen as input and returned the coordinates of the 8 corners of the projected cube. The cube was then displayed using a Bresenham line drawing algorithm in hardware to connect these 8 points. </p> <br> <h3>Hardware/Software Tradeoffs</h3> <p>We had to optimize our C code to have enough memory to run our project. The Terasic camera modules used the SDRAM as a frame buffer, and they used a complicated SDRAM controller. We were using SRAM to store the 12 line segments of the projected cube to display. We originally wanted to use SDRAM for the Nios II as well, since it had the most capacity. Unfortunately, we found that the Nios II could not share the SDRAM with the camera. We decided to use the on-chip memory for the Nios II, since that seemed easier than deciphering the SDRAM controller and storing the frames elsewhere. The biggest problem with on-chip memory was its size. We could not make allocate too much memory to the Nios II, otherwise our entire project would not fit on the FPGA, but we still needed to allocate enough memory for our C program. We were forced to optimize our C program to reduce how much memory was required. Therefore, in order to avoid importing math.h, we replaced the trigonometric functions we needed with simpler algorithms that only require arithmetic operations (see <a href="trig.html">Appendix</a>). We also compressed the other libraries we used. This limits the functionality of the Nios II, but we only needed basic pointer and arithmetic operations.</p> <br> </div> </div> <div class="clear"></div> </div> </div> <div id="footer"> <br> <ul> <li><a href="index.html">Introduction</a></li> | <li><a href="highlevel.html">High Level Design</a></li> | <li><a href="hardware.html">Hardware/Software </a></li> | <li><a href="results.html">Results</a></li> | <li><a href="conclusion.html">Conclusion</a></li> | <li><a href="appendix.html">Appendix</a></li> </ul> <br> <p><a href="mailto:ty244@cornell.edu">Chuck Yang</a> and <a href="mailto:jgs33@cornell.edu>Jasper Schneider</a></p> </div> </div> </body> </html>