2

I am now developing a application and plans to use native OpenCV library by jni approach. Reference this tutorial as my environment.

http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html

To use the nonfree module of the OpenCV such as SurfFeatureDetector, I have to build opencv myself and use the tutorial from OpenCV website:

http://code.opencv.org/projects/opencv/wiki/Building_OpenCV4Android_from_trunk

When I follow the steps in tutorial (windows native part) and want to run script cmake_android.cmd to compile them, I get the error message like this:

In file included from E:\git\opencv\3rdparty\libtiff\tif_stream.cxx:30:
E:\git\opencv\3rdparty\libtiff\/tiffiop.h:54:21: error: search.h: No such file or directory
make[2]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/tif_stream.cxx.o] Error 1
make[1]: *** [3rdparty/libtiff/CMakeFiles/libtiff.dir/all] Error 2
make: *** [all] Error 2

Is there any way to solve this problem or make me able to use native OpenCV library with nonfree module in Android application?

3 Answers 3

1

I have this problem too. My fix was to install the latest version 2.4.5 ,and then to follow the tutorial. 1.Download clean 2.4.5 version and unzip it. 2.Follow tutorial. http://code.opencv.org/projects/opencv/wiki/Trunk_OpenCV_for_Android

This fixes the error that you have mentioned. I had after that another error that I don't remember now what it was,But I saw where the error is and I replaced the line with the line in script of version 2.4.2 and that was it(It's a small difference between them)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks your advise, I have built OpenCV 2.4.5 in my Ubuntu, it's very easy to build it myself.
1

if you just want to use SIFT or SURF in the nonfree module, you don't need to rebuild the whole opencv package. You can only build nonfree module as a standalone library and use it in your project. This tutorial will give you details about how to do that.

Comments

0

Compiler Opencv4android,libtiff is opened default. You can close it to complier the sdk because its thirdparty. search.h is not exist in NDK dir,but system path usr/include/ has one,so you compiler the sources for linux or mac,it works ok.

solution: 1、vi CMakeList.txt 2、Search "TIFF",/TIFF

edit

OCV_OPTION(WITH_TIFF "Include TIFF support" ON IF (NOT IOS) )

to

OCV_OPTION(WITH_TIFF "Include TIFF support" OFF IF (NOT IOS) )

Done!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.