Cvcamera of Android-opencv

Source: Internet
Author: User

This article from http://blog.csdn.net/hellogv/, reference must indicate the source!

Android-opencv is a transplanted version of opencv on Android phones, while cvcamera is a sample of this transplanted version. This document describes how to install and use Android-opencv.

  • Android-opencv Installation

Opencv is based on C ++, so Android-opencv must also rely on ndk (android-ndk-r4-crystax) to compile. PS: on the installation and use of android-ndk-r4-crystax and cygwin, this article no longer nagging, see http://blog.csdn.net/hellogv/archive/2010/12/23/6094127.aspx

The installation steps are as follows:

 

 

  1. SVN checkout http://android-opencv.googlecode.com/svn/trunk/, download source code
  2. Make sure that the system path contains D:/cygwin/bin; D:/cygwin/android-ndk-r4-crystax; (the directory you decide, the path must contain the bin of cygwin and the path of the android-ndk-r4-crystax)
  3. Copy the android-ndk-r4-crystax to the/cygwin/home/gv/android-ndk-r4-crystax, compile Android-opencv, after the compilation is successful, you can delete this copy.
  4. Run cygwin, to the opencv directory, input sh build. Sh for compilation, if the compilation is successful, it will be in the/opencv/Android/libs/generate armeabi and armeabi-v7a two folders, which contain libandroid-opencv.so.

 

PS: if a file is missing during compilation, search and download it from the Internet.

 

  • Use of Android-opencv
  1. Open the eclipse and import opencv project. The project is located in/opencv/Android /. PS: if a file is missing, you need to search and download it from the Internet.
  2. After the opencv project is compiled, you can export it, select the JAR file of Java, remove the two folders [OBJ] and [libs] during export, androidmanifest. XML and default. properties. The output file name is opencv. jar and export settings are as follows:
  3. Download swigwin-1.3.39, add D:/cygwin/swigwin-1.3.39 in system path (storage location custom), restart
  4. Open cygwin, go to/samples/cvcamera/, input sh build. Sh, and start to compile JNI of cvcamera. After successful compilation, libcvcamera. So will be generated.
  5. Copy/opencv/Android/libs to/samples/cvcamera/Because cvcamera requires both libandroid-opencv.so and libcvcamera. So
  6. Import the cvcamera project and add opencv. jar to the libraries
  7. Compile the cvcameraproject and generate the cvcamera.apk (with the size of 6.06mb)

The cvcamera program runs as follows:

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.