how to include libjpeg in OpenCV 3.1 Android

asked 2016-08-29 04:21:29 -0600

boazgarty gravatar image

updated 2016-08-29 07:21:20 -0600

with openCV 2.4.X I had no problem using turbo-libjpeg I've used the library as shared library:

Android.mk includes- 
LOCAL_C_INCLUDES += ../../libjpeg-turbo and include $(BUILD_SHARED_LIBRARY)

when I upgrade to openCV 3.1 I get compilation error below after runing NDK-BUILD. from openCV 3.1 Android.mk file I can see that libjpeg is not included. the static lib can be found under native->libs, how can I set libjpeg to be include with openCV?

 error: undefined reference to 'jpeg_CreateDecompress'
error: undefined reference to 'jpeg_stdio_src'
error: undefined reference to 'jpeg_read_header'
error: undefined reference to 'jpeg_start_decompress'
error: undefined reference to 'jpeg_read_scanlines'
 error: undefined reference to 'jpeg_finish_decompress'
error: undefined reference to 'jpeg_destroy_decompress'
 error: undefined reference to 'jpeg_std_error'
error: undefined reference to 'jpeg_CreateDecompress'
error: undefined reference to 'TIFFOpen'
error: undefined reference to 'TIFFWriteEncodedStrip'
edit retag flag offensive close merge delete

Comments

1

you're adding includes, but no libs (those are a linker errors)

berak gravatar imageberak ( 2016-08-29 07:47:19 -0600 )edit

this is the problem of course liblibjpeg.a is already included with openCV under native->3rdparty, and Im using libjpeg by including the code LOCAL_C_INCLUDES. how can I use this when Im using openCV?

boazgarty gravatar imageboazgarty ( 2016-08-30 01:53:30 -0600 )edit

Have you been able to use libjpeg turbo with OpenCV 3.1 finally? I've removed liblibjpeg.a from 3rd party libs and I get everything to compile but when I call imread, the returned image is always empty.

guillaume-tgl gravatar imageguillaume-tgl ( 2016-09-19 04:41:53 -0600 )edit