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

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:
主站蜘蛛池模板: 黔江区| 通化市| 田林县| 大埔区| 梅河口市| 扶沟县| 长寿区| 嘉善县| 桃园县| 元朗区| 新密市| 广德县| 双鸭山市| 乌审旗| 安义县| 阿勒泰市| 达州市| 吉水县| 青川县| 原平市| 潞西市| 大英县| 贡山| 广昌县| 台北市| 绥化市| 马尔康县| 长垣县| 陆良县| 且末县| 开鲁县| 乌海市| 五河县| 浦县| 云南省| 三都| 鄂托克旗| 武城县| 巴塘县| 裕民县| 江达县|