Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Native Android OpenCV + Unity3D 5

Hello,

I am trying to develop an Unity3D game using the OpenCV Android implementation. Using the ColorBlobDetector example (http://opencv.org/platforms/android/opencv4android-samples.html) I try to obtain some coordinates and give it to Unity to place some objects in these points.

Before this, I have made a simpler example from 0 to test the communication between an Android library (made in Eclipse) and Unity, and I know how to develop an Android plugin for Unity.

In the case of ColorBlobDetector, when I try to call any method (and even some created by myself) I get the following error:

09-27 17:16:19.160: I/Unity(16572): AndroidJavaException: java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.core.Mat.n_Mat() (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__)
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.AndroidJNISafe.NewObject (IntPtr clazz, IntPtr methodID, UnityEngine.jvalue[] args) [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[] args) [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.AndroidJavaObject..ctor (System.String className, System.Object[] args) [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at ShareApp.getArea () [0x00000] in C:\OpenCV\Unity\AndroidTest\Assets\Scripts\ShareApp.cs:73
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) [0x00000] in <filename unknown="">:0
09-27 17:16:19.160: I/Unity(16572): at UnityEngine.Events.UnityEventB

I have exported even the OpenCVLibrary3.0.0 as .jar into Unity but still the same.

Could anyone give me some help about this case? If some screenshot or code is needed, I can give it.

Thanks in advance.