2015-11-05 10:25:23 -0600 | asked a question | Unclear integration into Android.mk / building from source I am attempting to integrate OpenCV into the Android.mk file of one of my projects and am running into severe difficulties there. Our build policies mandate that all external libraries are to be built from source. Besides, it's good practice to do so. In any case, I would naively expect to have to do something along the lines of the following steps:
This seems to be not the case, as I could not find a suitable Android.mk file in the source distribution. The official documentation refers to an OpenCV.mk file which simply does not exist in this source distribution. Also, the include directories seem to be scattered around the module directories, making it difficult to refer to exactly one base include directory. (This seems to be a questionable design decision.) There appears to be an official "SDK" for Android, which only distributes some binary files, i.e. that is not a complete source distribution. It is unclear to me how to build exactly this SDK distribution from the source distribution. I have found this unmaintained page ("Building OpenCV4Android from trunk"), which seems to explain exactly this step, and I can successfully complete all the steps described there in the section 'Linux (Ubuntu) and Mac OS (10.6.7)'. But:
My questions are the following:
Thanks for any help! |
2014-10-15 07:00:35 -0600 | received badge | ● Student (source) |
2014-10-15 03:27:24 -0600 | asked a question | Android.mk: problems selectively integrating OpenCV modules I’m having issues installing the prebuilt OpenCV libraries for Android. I have followed the documentation, and can properly install the prebuilt shared library like this: (see http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#native-c) However, the issue with this way of integrating is a conflict between the libjpeg version we’re statically compiling into our project (version 9), and the version of libjpeg that’s included in the highgui library (seems to be version 8). At runtime, the OpenCV-included symbols seem to be called, which does not match the version in our header: Bummer. The obvious (and preferred) solution is to statically link only the parts of OpenCV that we actually need (core, features2d, calib3d, imgproc), via the provided .a files, and to leave away everything else that might lead to conflicts or bloat the resulting APK. However, this is where I run into issues. First attempt: Just try to link everything statically, by uncommenting the above “OPENCV_LIB_TYPE:=STATIC” line. I would then still have to change the OpenCV.mk file by removing all references to libjpeg (and other unneeded libraries). However, just uncommenting the line leads to a multitude of linker errors when recompiling with ndk-build. Shouldn’t this “just work” (according to the documentation, where no additional steps are mentioned)? It seems that the OpenCV.mk makefile should include them as prebuilt static binaries. Second attempt: Include the prebuilt libraries manually. This would be my preferred way, but seems to be thoroughly undocumented. Instead of including the OpenCV.mk file, I added the following sections to my makefile (assume that MY_OPENCV_LIBPATH and MY_OPENCV_EXT_LIBPATH are set to point to the respective directory with the .a files): and then, in the section of the MyLib module, added the following: If I understood the OpenCV makefile correctly, this should roughly mimic what the makefile achieves when included via "include OpenCV.mk". Again, this does lead to lots of linker errors. I cannot even see the prebuilt libraries being generated in the ./obj or ./lib folders of my project. Who ... (more) |
2014-05-06 07:06:44 -0600 | asked a question | Compiler error using GCC 4.8.2 (MacPorts), OS X 10.9.2 I'm trying to build OpenCV 2.4.9 from source on Mac OS X 10.9.2, using GCC 4.8.2 from MacPorts. Unfortunately I'm getting compile errors when trying to build the highgui module. I'm attaching the CMake output as well as the error messages. It was suggested here to disable QuickTime support (-D WITH_QUICKTIME=OFF) for a similar-looking error, however that doesn't seem to help. Can someone reproduce this behavior (I'd assume quite a few users must have experience this?) and let me know how to fix the build process? Thanks! (more) |