Ask Your Question
0

Building for Android with JPEG, TIFF libraries etc.

asked 2014-03-04 14:55:54 -0600

guraaf gravatar image

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!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-03-04 16:16:40 -0600

guraaf gravatar image

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

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-04 14:55:54 -0600

Seen: 1,211 times

Last updated: Mar 04 '14