I am trying to implement SLIC superpixel algorithm in Android tablet (SLIC)
I port the code which in C++ to work with android environment using stl-lib and all. What application doing is taking an image from camera and send data to process in native code.
I got the app running but the problem is that it took 20-30 second to process a single frame (640 x 400) while in my notebook running with visual studio application would be almost instantly finish!
I check the memory leak, their isn’t any… is their anything that might cause computation time to be way more expensive than VS2010 in notebook?
I know this question might be very open and not really specific but I’m really in the dark too. Hope you guys can help.
Thanks
PS. I check running time for each process, I think that every line of code execution time just went up. I don’t see any specific function that take way longer than usual.
PSS. Do you think follow may cause the slow?
- Memory size : investigated, during native not much of paused time show from GC
- STL-library : not investigate yet, is it possible that function like vector, max and min running in STL may cause significant slow?
- Android environment it self?
- Lower hardware specification of Android Tablet (Acer Iconia tab – 1GHz Nvidia Tegra 250 dual-core processor and has 1GB of RAM)
- Would be better to run in Java?
PSSS. If you have time please check out the code
I’ve taken a look to your code and can make the following recommendations:
APP_ABI := armeabi-v7ainto yourApplication.mkfile. Otherwise your code is compiled for old armv5te architecture where you have no any FPU (all floating point arithmetic is emulated), have less registers available and so on.doublefloating-point values for computation. You should replace them withfloatwherever possible because ARM still misses hardware support fordoubletype.