yukihiko / ThreeDPoseUnitySample

Unity sample of 3D pose estimation
362 stars 76 forks source link

Problem while installing on Android #2

Open murtaza98 opened 5 years ago

murtaza98 commented 5 years ago

Hey, I tested this on my laptop using its webcam and it worked fine.

However, when I am installing it on my Android phone, I am getting some errors like this. 09-26 23:01:08.858 25404 25427 E Unity : DllNotFoundException: OpenCvSharpExtern 09-26 23:01:08.858 25404 25427 E Unity : at (wrapper managed-to-native) OpenCvSharp.NativeMethods.core_Mat_sizeof() 09-26 23:01:08.858 25404 25427 E Unity : at OpenCvSharp.NativeMethods.TryPInvoke () [0x0000e] in <1c4180998434408a87e8d3a3d5f215e6>:0 09-26 23:01:08.858 25404 25427 E Unity : Rethrow as OpenCvSharpException: OpenCvSharpExtern 09-26 23:01:08.858 25404 25427 E Unity : *** An exception has occurred because of P/Invoke. *** 09-26 23:01:08.858 25404 25427 E Unity : Please check the following: 09-26 23:01:08.858 25404 25427 E Unity : (1) OpenCV's DLL files exist in the same directory as the executable file. 09-26 23:01:08.858 25404 25427 E Unity : (2) Visual C++ Redistributable Package has been installed. 09-26 23:01:08.858 25404 25427 E Unity : (3) The target platform(x86/x64) of OpenCV's DLL files and OpenCvSharp is the same as your project's.

Any suggestions would be appreciated. Thank you in advance.

yukihiko commented 5 years ago

Hi, The OpenCvSharp used in this project works only on Windows?

https://github.com/digital-standard/ThreeDPoseUnityForiOS This code can be run on iOS using "OpenCV for Unity" (paid). I haven't tried it on Android yet, but I think it will work on Android.

This is a video when running on iOS. https://www.youtube.com/watch?v=QKCufzG3hW0

murtaza98 commented 5 years ago

Hello. Thanks for the response. I understand that OpenCvSharp and the OpenCV dll files used in this project are meant to be run on a Windows Platform.

BTW, if u won't mind, I would like to get your advice and suggestion on the project that I am developing. Basically, I want to develop an application which uses pose-estimation and I want to render some 3d Models on that pose and all this needs to happen on an Android. So, if u could give me some suggestion about the high level approach that i should follow, it would be really appreciated.

yukihiko commented 5 years ago

Android is not so detailed, so there isn't much advice. If you use pose estimation using Unity, I think it's "OpenCV for Unity" or Unity's "Barracuda" or "TensorFlow". (I think there are other things you can use.)

Barracuda https://github.com/Unity-Technologies/ml-agents/blob/master/UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core/Barracuda.md

This video uses Barracuda. It works fast on a PC but very slow on iOS. I think it works on Android, but I don't know the speed. https://twitter.com/yukihiko_a/status/1178231984264368128?s=20

I haven't used Unity + TensorFlow so I don't know.

Everything that uses my code needs to be changed.

rUsHiKoRe commented 4 years ago

How can I deploy it to an android phone?