EmguCV插件的Unity3d DllNotFoundException

时间:2015-08-03 09:12:23

标签: opencv dll unity3d emgucv

我试图让emgu cv在osx上使用unity3d。我按照http://www.emgu.com/wiki/index.php/Download_And_Installation#OSXopencv (emgucv) not working in unity in osx?

上的步骤操作

不幸的是我一直遇到DllNotFoundException错误:

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)

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)

是否有人知道是否需要任何其他步骤或文件应位于不同的文件夹中?

1 个答案:

答案 0 :(得分:2)

好吧所以我通过摆弄来回答我自己的问题,因为事实证明我正在寻找一个更复杂的解决方案,而事实证明这是一个参考问题,需要将一些文件移动到不同的文件夹......

对于任何想要在Unity中运行EmguCV的人来说,就在这里:

  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. 现在将Plugins文件夹移动到Emgu.CV文件夹
  11. 将Assets,Library和ProjectSettings文件夹复制到Unity项目文件夹
  12. 应该是这样......我的错误问题是EmguCV库正在.bundle文件夹中查找Emgu.CV/Plugins而不是默认的Plugins文件夹。