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

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:
主站蜘蛛池模板: 托克逊县| 恭城| 亚东县| 华池县| 云梦县| 津南区| 南昌县| 惠州市| 泊头市| 东源县| 新津县| 拜城县| 格尔木市| 静乐县| 建德市| 崇明县| 宁海县| 宝山区| 西吉县| 甘德县| 凤城市| 镇赉县| 东山县| 新安县| 新郑市| 巴林右旗| 滕州市| 呼伦贝尔市| 阿拉善盟| 葵青区| 葵青区| 驻马店市| 含山县| 镇安县| 禄丰县| 于都县| 湾仔区| 寿宁县| 芒康县| 江阴市| 宜都市|