How to Use OpenCV in Unity for Android

If you’ve read my previous articles (especially this one) about how to use OpenCV in Unity and how to pass images between them, this post will feel like a breeze and you can just quickly skim through it. However, if you haven’t, I recommend doing so because in this post I’ll describe how to create an Android library that uses the OpenCV library and then include it in your Unity project, or in other words describe what we did in Unity for Windows this time in Unity for Android.

Continue reading “How to Use OpenCV in Unity for Android”

How to Pass Images Between OpenCV and Unity

A question I got a lot after writing this post quite some time ago was “How to pass a processed image from OpenCV back to Unity?!” Obviously, that tutorial described just the way to pass images from Unity to C# (because of the nature of what it needed to do) and my answers in the comments section didn’t quite clarify things for most people, so I thought why not write another tutorial and address all those questions in one go. This article is the result, so I hope it helps you understand not just how images are passed from Unity to OpenCV and vice versa, but also why it needs to be done like this.

Continue reading “How to Pass Images Between OpenCV and Unity”

How to Use OpenCV in Unity (Example Project)

This is a post that many people have requested recently. I’m going to describe how you can use OpenCV in Unity. Of course we’ll be using official OpenCV libraries and not any assets or existing plugins.  For those of you who aren’t familiar with the subject, Unity is a very popular game engine which allows building games, apps and so called experiences with much ease. Unity allows some modified form of JavaScript and also C# for its scripting. In this example project I’ll use C# since that’s the language I’m familiar with but it shouldn’t be hard to adapt this to JavaScript (but you’re gonna do it yourself if needed, sorry) so let’s start.

Continue reading “How to Use OpenCV in Unity (Example Project)”