OpenCV Java code running faster than OpenCV native C++ code

asked 2016-03-12 02:51:33 -0500

stalin gravatar image

I have written two versions of an android application using OpenCV. OpenCV is being used for following operations:

  • Resizing images
  • Color conversion from RGB to HSV
  • Computing ratio of pixel values of two images

The first version of the application does all these operations in Java and takes around 200 ms. However, the native implementation takes around 700 ms!

Moreover, I also measured the timings of Java implementation on Nexus 5 and Nexus 6 and I got following results:

Nexus 5: Java: 200 ms, C++: 700 ms!

Nexus 6: Java: 180 ms, C++: 900 ms!

Can somebody please explain why this is happening? Isn't the native implementation supposed to run faster?

edit retag flag offensive close merge delete



show us your native code. :)

berak gravatar imageberak ( 2016-03-12 02:56:37 -0500 )edit