App (OpenCV 2.4.0) slows down on ICS

166 views
Skip to first unread message

Katrin Lasinger

unread,
May 30, 2012, 8:22:29 AM5/30/12
to android...@googlegroups.com
Hi,

I'm running an Android app with OpenCV 2.4.0 on a Samsung Galaxy S2 with Android 2.3.3 and on another Samsung Galaxy S2 with Android 4.0.3.
Unfortunately on ICS the app is way slower than on 2.3 (about 3 fps instead of 10 fps for both native and Java camera control).
I don't know if the camera control is the problem since frame rates are approximately the same on both devices (up to 30 fps) without image processing (just displaying).
I'm doing some feature detection (SURF), tracking (OpticalFlowPyrLK) and matching (FlannBasedMatcher) on the native part of the app.
Does anyone know what could be the reason for the different frame rates on different Android versions?

Thanks in advance.

Andrey Pavlenko

unread,
May 31, 2012, 3:18:46 AM5/31/12
to android...@googlegroups.com
Check if on Android 4 you works with an image of the same size as on Android 2.3.
No other ideas...

Katrin Lasinger

unread,
Jun 1, 2012, 3:36:05 AM6/1/12
to android...@googlegroups.com
The images have the same size on both devices. I also tried smaller images on Android 4, but it didn't help.
Did no one else encounter such problems?

Rui Marques

unread,
Jun 1, 2012, 5:03:04 AM6/1/12
to android...@googlegroups.com
This will not help much but check how many keypoints are detected and how many are matched for the same picture, on both devices.

If with Android 4, more keypoints are being detected/matched that will explain the extra slowness.

What would remain unexplained is why there is a different number of keypoints.

Andrey Kamaev

unread,
Jun 1, 2012, 7:22:42 AM6/1/12
to android...@googlegroups.com
Probably you are affected by this bug in Android4.0: http://www.moodstocks.com/2012/03/20/ice-cream-sandwich-why-native-code-support-sucks/
You can try to remove armeabi binaries from the OpenCV package and rebuild your app.

/Andrey

Katrin Lasinger

unread,
Jun 8, 2012, 4:42:03 AM6/8/12
to android...@googlegroups.com
Wow, thank you Andrey! It worked! I just removed the armeabi folder from the libs folder in the OpenCV package (or actually only renamed it) and it worked like a charm :)
Reply all
Reply to author
Forward
0 new messages