官术网_书友最值得收藏!

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:
主站蜘蛛池模板: 琼结县| 台江县| 察隅县| 七台河市| 谷城县| 静海县| 永清县| 嵊泗县| 南宫市| 娱乐| 台中市| 大埔区| 即墨市| 罗山县| 淮滨县| 唐山市| 沈阳市| 舒兰市| 奉化市| 同德县| 中山市| 高平市| 凌云县| 岱山县| 平武县| 民县| 湟中县| 涪陵区| 蓝山县| 利辛县| 博湖县| 拜泉县| 徐闻县| 昌图县| 石家庄市| 蒙山县| 曲沃县| 驻马店市| 东丽区| 龙游县| 邳州市|