title: OpenCV + Android + Unity
body: <p>I am looking for a way to use OpenCV in a Unity project and my target platform is an Android device.</p>
  
  <p>I know that some assets exists on Unity asset store but I <strong>DO NOT</strong> want to use them as I find them way too expensive.</p>
  
  <p>I manage to use use opencv in Unity as a C++ native pluggins by precompiling OpenCV in dlls using <a href="http://thomasmountainborn.com/2016/09/11/unity-and-opencv-part-one-install/" rel="noreferrer">this</a> tutorial, but dll means Windows Desktop so it doesn't help me much to build my project for Android.</p>
  
  <p>I also found opencv jar archive, I know they can be easily imported into Unity, but I don't know how to do the next step: that is how to access OpenCV stuff from Unity C# scripts.</p>
  
  <p>So, if anyone knows how to configure even a dummy hello world project using OpenCV in Unity editor for build to Android, or even has hints, I would take any infos about that.</p>
  
  <p>Thanks in advance.</p>
  
  <p>PS: I know this question is some sort of vague, and trust me it is not a LMGFY question as on google there is a lot of question like this and no real answer, so please don't rush -1 vote.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Using <a href="https://www.youtube.com/watch?v=Vp20EdU5qjU" rel="noreferrer">this</a> tutorial, I managed to build opencv for Android using Android studio, but still I don't know how to use OpenCV from C# scripting. For example, how to create a cv::Mat?</p>
  
  <p>So what I managed to do:</p>
  
  <ul>
  <li>Build OpenCV and run some native code using Android studio (so from Java).</li>
  <li>Build the <a href="https://docs.unity3d.com/Manual/AndroidNativePlugins.html" rel="noreferrer">Unity native example</a> (one single C function) and call it from a C#script.</li>
  </ul>
  
  <p>But I still can't figure out how to build some C++ code with OpenCV dependencies and call this code from a C# script.</p>