Ask Your Question

guraaf's profile - activity

2018-09-09 11:05:38 -0600 received badge  Notable Question (source)
2016-04-07 11:55:23 -0600 received badge  Popular Question (source)
2014-10-30 15:32:46 -0600 received badge  Student (source)
2014-03-28 11:14:33 -0600 received badge  Editor (source)
2014-03-28 10:58:10 -0600 asked a question Build OpenCV for Linux on ARM with FFmpeg

Hi all, I saw very helpful instructions at: http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html

However, it doesn't talk about how to enable FFmpeg and saying that it is optional. I am trying to build OpenCV 2.4.8 for Linux running on ARM Cortex-A9. This is what I did:

cd opencv-2.4.8/platforms/linux/
mkdir build-soft
cd build-soft
cmake -DSOFTFP=ON -DENABLE_NEON=ON -DCMAKE_TOOLCHAIN_FILE=../arm-gnueabi.toolchain.cmake ../../..

This went through. Now when I inspect the configuration produced I see that I didn't get FFmpeg support:

-   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       gentoo-style:              YES

Any suggestions to build FFmpeg for 32-bit ARM would help. I am cross-compiling on 64-bit Ubuntu 12.04. Also, I went ahead and tried to build but failed with a problem due to Python. I think I don't have the correct Python cross-compiled for 32-bit ARM. How can I do so? The error was:

[100%] Building CXX object modules/python/CMakeFiles/opencv_python.dir/src2/cv2.cpp.o
In file included from /usr/include/python2.7/Python.h:58:0,
                 from /home/tmp/opencv-2.4.8/modules/python/src2/cv2.cpp:6:
/usr/include/python2.7/pyport.h:849:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
[100%] Built target opencv_perf_stitching
Linking CXX executable ../../bin/opencv_test_contrib

Thanks in advance!

2014-03-04 16:16:40 -0600 commented question Building for Android with JPEG, TIFF libraries etc.

I figured it out. I need to add "jpeg" to the LOCAL_STATIC_LIBRARIES and liblibjpeg.a to the LOCAL_SRC_FILES. Thanks all.

2014-03-04 14:55:54 -0600 asked a question Building for Android with JPEG, TIFF libraries etc.

Hello all, I am building OpenCV for Android on Ubuntu. I got the code from trunk (2.4.8 on 3/3/2013) and was able to go to platforms and use scripts/cmake_android_arm.sh and then make to build the package.

However, I was unable to use libopencv_highgui in a sample app that I created. My app is C++ native app that I am compiling with ndk-build (not cmake). libopencv_highui doesn't find the image decoder 3rd party libraries like JPEG, TIFF, Jasper etc. I searched and tried a few experiments but can't figure out how to get this working.

So I was able to go into build_android/3rdparty/libjpeg and do a make. I got the liblibjpeg.a and I tried to link this in but didn't work. Any tips appreciated.

Android.mk looks like:

include $(CLEAR_VARS)
LOCAL_MODULE := libopencv_highgui
LOCAL_SRC_FILES := $(OPENCV_LIB_PATH)/libopencv_highgui.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := libopencv_core
LOCAL_SRC_FILES := $(OPENCV_LIB_PATH)/libopencv_core.a
include $(PREBUILT_STATIC_LIBRARY)
LOCAL_STATIC_LIBRARIES += libopencv_core libopencv_highgui

Where should I include the libjpeg libtiff or how should I build the OpenCV for Android that these 3rd party are statically linked in to begin with? Thanks!