Passing data from Unity3D to C++ dll and vice versa
<p>I'm currently working on my thesis (MSc Computer Science) which is an Augmented Reality project using OpenCV C++ integrated with Unity3D (for the rendering part). In order to integrate OpenCV with Unity3D I exported the OpenCV (c++) code as a dll and then I am importing that dll in Unity3D for accessing the dll's methods etc.. In addition the University gave me some money to buy OpenCV for Unity (it is implemented in C# using OpenCV for Java) and I am using it as well in Unity3D. The problem is that, it does not support SURF feature extractor and that's why I am not implementing my C++ code straightforward into C# using that asset. </p>

<p>So I want to pass a frame (Mat) from Unity3D (C#) to the C++ dll, then do some calculations and after that return some Mat objects, for example the rotation matrix,translation vector and the camera pose. The most important thing is that I don't know how to pass the Mat frame from Unity3D to the C++ dll. </p>

<p>Can anyone explain to me how to achieve this and also can you post a sample code ? </p>

<p><strong>EDIT:</strong> The Unity3D asset that I am using can be found here : <a href="https://www.assetstore.unity3d.com/en/#!/content/21088" rel="nofollow">OpenCV for Unity3D</a> </p>