Ask Your Question
1

Reducing Android package

asked Apr 24 '13

mbox2000 gravatar image

updated Apr 24 '13

Andrey Pavlenko gravatar image

i only want to use


Mat m1 = new Mat();
Imgproc.blur(m, m1, new Size(s, s));
Utils.matToBitmap(m1, b);

but the SO file unexpectedly 20+M how to lower OpenCV SO?

thanks.

Preview: (hide)

2 answers

Sort by » oldest newest most voted
1

answered Apr 24 '13

Probably you are including the complete openCV library folder containing the dll's with your so file. In order to reduce the size you should only include the dlls necessary, in this case the core dll and the imageprocessing dll.

Preview: (hide)

Comments

i delete some so file, only remain must 4 files, libopencv_core.a libopencv_features2d.a libopencv_imgproc.a libopencv_java.so

these files total 14M, still so big for android app

mbox2000 gravatar imagembox2000 (Apr 24 '13)edit
2

Did you try to use OpenCV Manager (http://docs.opencv.org/android/service/doc/index.html)? It allows you to reduce .apk size.

Daniil Osokin gravatar imageDaniil Osokin (Apr 24 '13)edit

thank you very much for reply.

mbox2000 gravatar imagembox2000 (Apr 24 '13)edit
1

OpenCV Manager cant be answer for this question. Anyway to lower libopencv_java.so's file size? I think, this file has all modules.

atasoyh gravatar imageatasoyh (Apr 24 '13)edit
1

answered Apr 24 '13

Andrey Pavlenko gravatar image

If you need small APK - the only choice is the OpenCV Manager.

If you can't use OpenCV Manager you need to keep libnative_camera_*.so (for VideoCapture class) and libopencv_java.so (for the rest of API) for all supported platforms.

Preview: (hide)

Question Tools

Stats

Asked: Apr 24 '13

Seen: 2,861 times

Last updated: Apr 24 '13