Processing the images stored on your phone
In this section, you will learn how to load an image from your phone and apply some interesting image processing algorithms to it, such as contrast enhancing, smoothing (removing noise from your image), and applying some filters.
Loading an image to a Mat object
Let's get started by first creating a new Android project. As you've seen in the previous chapter, in order to start using the OpenCV algorithms, you will need to add the OpenCV library to your project:
- Launch Eclipse.
- Create a new Android project application; let's name it
DarkRoom
. - Choose the package name. In this example, I chose it to be
com.example.chapter2.darkroom
. - Set the minimum required SDK to be anything above API 11 (Android 3.0). In my case, and it is highly recommended, I chose it to be API 16 (Android 4.1). For the target SDK, you should choose API 19 because there is an issue when loading the OpenCV library if you are using a target SDK higher than 19.
- Click Next...