-1

I'm trying to get emgu cv working with unity3d on osx. I followed the steps on http://www.emgu.com/wiki/index.php/Download_And_Installation#OSX and opencv (emgucv) not working in unity in osx?

Unfortunately I keep running into DllNotFoundException errors:

DllNotFoundException: Assets/Emgu.CV/Plugins/emgucv.bundle/Contents/MacOS/libcvextern.dylib
Emgu.CV.CvInvoke..cctor () (at Assets/Emgu.CV/Emgu.CV/PInvoke/CvInvoke.cs:464)
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke
CameraTexture.Start () (at Assets/Emgu.CV/Emgu.CV.Demo/CameraTexture.cs:49)

and

DllNotFoundException: Assets/Emgu.CV/Plugins/emgucv.bundle/Contents/MacOS/libcvextern.dylib
Emgu.CV.CvInvoke..cctor () (at Assets/Emgu.CV/Emgu.CV/PInvoke/CvInvoke.cs:464)
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.CvInvoke
Emgu.CV.Image`2[Emgu.CV.Structure.Bgr,System.Byte].AllocateData (Int32 rows, Int32 cols, Int32 numberOfChannels) (at Assets/Emgu.CV/Emgu.CV/Image.cs:331)
Emgu.CV.Image`2[Emgu.CV.Structure.Bgr,System.Byte]..ctor (Int32 width, Int32 height) (at Assets/Emgu.CV/Emgu.CV/Image.cs:281)
HelloTexture.Start () (at Assets/Emgu.CV/Emgu.CV.Demo/HelloTexture.cs:19)

Does anyone know if any additional steps are needed or the files should be in different folders?

1 Answer 1

2

Ok so I answered my own question by fiddling around, as it turned out I was looking at a more complicated solution, while it turned out to be a reference problem which required moving some files to different folders...

For anyone who wants to run EmguCV in Unity, here it goes:

  1. git clone git://git.code.sf.net/p/emgucv/code emgucv cd emgucv
  2. git checkout -b emgucv_3.0
  3. git submodule update --init --recursive
  4. cd platforms/osx/
  5. ./configure_universal
  6. ./makeBundle
  7. cd ../../Emgu.CV.Unity/
  8. ./copy_unity_assets
  9. ./copy_demo_assets
  10. Now move the Plugins folder to the Emgu.CV folder
  11. Copy the Assets, Library and ProjectSettings folders to your Unity project folder

That should be it... the problem with my error was that the EmguCV library is looking for the .bundle in the Emgu.CV/Plugins folder and not the default Plugins folder.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.