opencv (emgucv) not working in unity in osx?

痴心易碎 提交于 2019-12-23 06:00:43

问题


i am at the point, where i just would want to know if anybody out there has emguCV.unity running inside unity in osx?

there are many tips concerning DllNotFoundExceptions and unity. all of them do not work in my case. i spent allmost four days searching and trying out everything.

the exact error is:

System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.OCR.OcrInvoke ---> System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke ---> System.DllNotFoundException: Assets/Plugins/emgucv.bundle/Contents/MacOS/libopencv_core.3.0.0.dylib at (wrapper managed-to-native) Emgu.CV.CvInvoke:cvRedirectError (Emgu.CV.CvInvoke/CvErrorCallback,intptr,intptr) at Emgu.CV.CvInvoke..cctor () [0x001f7] in /Users/Lev/Documents/workspace/Text_Scanner/Assets/Emgu.CV/Emgu.CV/PInvoke/CvInvoke.cs:353 --- End of inner exception stack trace --- at Emgu.CV.OCR.OcrInvoke..cctor () [0x00006] in /Users/Lev/Documents/workspace/Text_Scanner/Assets/Emgu.CV/Emgu.CV.OCR/OcrInvoke.cs:26 --- End of inner exception stack trace --- at Emgu.CV.OCR.Tesseract..ctor () [0x00011] in /Users/Lev/Documents/workspace/Text_Scanner/Assets/Emgu.CV/Emgu.CV.OCR/Tesseract.cs:45

(there is the emgucv.bundle in Assets/Plugins/ with the libopencv_core.3.0.0.dylib inside at the correct position. i copied the dylibs and the whole bundle to alle possible positions. including the project folder, unity-editor folder, ...)

there is no compilition error. the error happens after starting play in editor and in standallone mac as well. i built emgucv with the cmake settings in emgucv.unity from emgucv 3.0.0.

(i even tried opencvsharp did not work neither)

i am desperate. please help me or just tell me, there is no way. thanks in advance, lev


回答1:


It works!

this is, how i got it to work:

  1. do as instructed here until the cmake command (don't do the cmake) http://www.emgu.com/wiki/index.php/Download_And_Installation#OSX
  2. instead do:
    1. cd platforms/osx/
    2. ./configure_universal
    3. ./makeBundle
    4. cd ../../Emgu.CV.Unity/
    5. ./copy_unity_assets
    6. ./copy_demo_assets
  3. then copy the folder Emgu.CV.Unity to your workspace and
  4. open it with unity as a project.

that was it for me :-)

cheers, lev



来源:https://stackoverflow.com/questions/30557198/opencv-emgucv-not-working-in-unity-in-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!