<< Chapter < Page Chapter >> Page >
Students will implement histogram equalization on the Android platform. Concepts include color conversion, histograms, cumulative distribution functions, and tone mappings.

Lab overview

In this lab, you will create an Android application that performs histogram equalization on streaming video, and deploy it on the Google Nexus 7 tablet. You will input a video stream from the front-facing camera, equalize each frame of video, and then display the equalized video on the screen alongside the unprocessed video.

Part 1: setting up android and eclipse

After completing Lab 4, you should be familiar with the Android development process, and you should feel comfortable working with Eclipse and the Nexus 7. This includes understanding the difference between Java and native C code, being able to compile and run your code on the tablet, and using both the Java and C debuggers to troubleshoot your code.

If you are not familiar with all of the above concepts, go back to Lab 4 and read the relevant sections.
  1. Start Cygwin by double-clicking on C:\NvPack\cygwin\cygwin.bat
  2. In the prompt, navigate to the Eclipse folder by typing cd /cygdrive/c/NvPack/eclipse
  3. Launch Eclipse with ./eclipse

Once Eclipse opens, select File>Import...

  1. General>Existing Projects into Workspace
  2. V:\ece420\nexus\OpenCV - 2.4.5
  3. V:\ece420\nexus\Lab5\
  4. Check "Copy into Workspace"

Additionally, in Lab5 Project Properties>Android , remove the current reference to the OpenCV library, which should have a red check mark next to it, and add the library that is in your workspace.

The lab machines currently do not support Android 4.2.2. If your tablet has upgraded, you have two options:

  • Get a TA to roll back your OS to 4.1.2. See this link for instructions.
  • Develop on your own machine by installing the latest Nvidia Tegra Development Pack.

For this lab project, the build process in Eclipse has already been configured to build everything automatically, and so building your project is as simple as clicking Project>Build Project .

You may want to uncheck Build Automatically , and then build by first Clean ing the project and checking the "Immediately start build" option.

The first time you run the application, you will be asked to download the OpenCV Manager from the Play Store; make sure you are connected to the internet.

Running the demo now will only stream video in grayscale. Pressing the ... in the corner of the screen will bring up the options menu, allowing you to view the RGB or equalized image; you will implement these functionalities in Parts 2 and 3.

Part 2: color conversion

In this part, you will implement your own color-conversion algorithm. The purpose is to obtain a better understanding of different color spaces, along with becoming more comfortable with accessing multidimensional data in an environment other than MATLAB.

As discussed in the prelab, there is more than one way to represent the pixels in an image. We will be applying histogram equalization in a color space known as YUV. The Y channel encodes the luma component (brightness), and the U and V are the chroma (color) components. The equalized image will be displayed in RGB.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ece 420 fall 2013. OpenStax CNX. Sep 26, 2013 Download for free at http://cnx.org/content/col11560/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ece 420 fall 2013' conversation and receive update notifications?

Ask