Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering OpenCV Android Application Programming

You're reading from   Mastering OpenCV Android Application Programming Master the art of implementing computer vision algorithms on Android platforms to build robust and efficient applications

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781783988204
Length 216 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Setting up OpenCV

OpenCV is the short form of Open Source Computer Vision library. It is the most widely used computer vision library. It is a collection of commonly used functions that perform operations related to computer vision. OpenCV has been natively written in C/C++, but has wrappers for Python, Java, and any JVM language, which is designed to create the Java byte code, such as Scala and Clojure. Since most of the Android app development is done in C++/Java, OpenCV has also been ported as an SDK that developers can use to implement it in their apps and make them vision enabled.

We will now take a look at how to get started with setting up OpenCV for the Android platform, and start our journey. We will use Android Studio as our IDE of choice, but any other IDE should work just as well with slight modifications. Follow these steps in order to get started:

  1. Download Android Studio from https://developer.android.com/sdk/ and OpenCV4Android SDK from http://sourceforge.net/projects/opencvlibrary/files/opencv-android/.
  2. Extract the two files to a known location.
  3. Create a normal Android Project and name it FirstOpenCVApp. Navigate to File | Import.
  4. Select the OpenCV_SDK_location/sdk/java/ directory.
  5. Navigate to Build | Rebuild Project.
  6. Navigate to File | Project Structure.
  7. Add the OpenCV module to your app by selecting the app module in the left column. Click on the green in the dependencies tab, and finally, select the OpenCV module.
  8. You are now ready to use OpenCV in your Android project. It should look like this:
Setting up OpenCV
You have been reading a chapter from
Mastering OpenCV Android Application Programming
Published in: Jul 2015
Publisher:
ISBN-13: 9781783988204
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image