OpenCV and Unity

Now, we can finally start working in Unity in this section. This is the easier part, where we just need to create our wrapper and our MonoBehaviour script to attach to an object.

Navigate to the dll file that we created. This should be in the x64 | Debug folder of the source project:

Create two folder called Plugins and Scripts in Unity, just as we did in Chapter3.

Now, we will create two scripts. One for our Wrapper class, and the other for our MonoBehaviour. The Wrapper class will be called OpenCVWrapper, and the MonoBehaviour class will be called OpenCVFaceDetection.

Open the OpenCVWrapper class in Visual Studio. It is ...

Get Unity 2018 Augmented Reality Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.