我是一个统一的开发尽我的手在OpenCV的首次。我最初的目标是运行摄像头,并通过在OpenCV的检测unity3d斑点。我是新来的OpenCV,我试图给它的Unity3D(使用Unity 4.3.2,并与统一4.2.1f在Mac电脑上的Windows 8)集成。我跟着这个线程。但我一旦收到以下错误,因为我添加一个新的C#脚本。我删除这个剧本的那一刻,错误的推移(这个脚本是统一生成的C#脚本)。
I am a unity developer trying my hands on opencv for the first time. My initial goal is to run the camera and detect blobs via opencv in unity3d. I am new to OpenCV and am trying to integrate it in Unity3D (on Windows 8 with Unity 4.3.2 and on a mac with Unity 4.2.1f). I followed this thread. But I am getting the following error as soon as I add a new C# script. And the moment I delete this script, the error goes (this script is Unity generated C# script).
Internal compiler error. See the console log for more information. output was: Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded. at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0 at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in <filename unknown>:0 at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in <filename unknown>:0 at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in <filename unknown>:0 at Mono.CSharp.Driver.LoadReferences () [0x00000] in <filename unknown>:0 at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0我找不到太多关于团结和OpenCV集成。这将是巨大的,如果你能帮助我这个错误,并指向我最近的教程,了解更多信息。
I couldn't find much about Unity and OpenCV integration. It would be great if you could help me out with this error and point me to a recent tutorial to learn more.
在此先感谢!
推荐答案我们最近不得不面对同样的问题,我会后,将解决你的问题,并帮助其他人的一些通用的信息。
We recently had to deal with the same problem, I'll post some generic information that would solve your problem and help other people.
若要使用OpenCV的项目中的C#脚本中,按照此代码示例:
To use your OpenCV project inside a C# script, follow this code example: using UnityEngine; using System.Collections; using System; using System.Runtime.InteropServices; public class PluginImport : MonoBehaviour { //Lets make our calls from the Plugin [DllImport ("OpenCVProject")] private static extern int openCVFunction(); void Start () { openCVFunction(); } }
注意使用到指令
其他信息来源:
- 团结手册:插件
- Unity Manual:Plugins
更多推荐
OpenCV中+整合Unity3D
发布评论