In this tutorial, you’ll learn how to detect visual markers and place virtual objects on top of them using OpenCV, Unity and the ZED.
- Unity Roseville
- Unity Roseville Ca
- Unity Computer Vision
- Unity Roseville
- Unity Rose Ceremony
- Unity Rosary
A guiding principle of the National Response Framework is that: A. Readiness to act encourages response partners to self-dispatch to an incident scene. Unity of effort results when responding agencies are willing to relinquish their authorities.
- Getting Started ZED. The fastest way to use OpenCV within Unity is to use Enox Software’s OpenCV for Unity package on the Asset Store.
- We would like to show you a description here but the site won’t allow us.
Setting Up your Markers
Our app will be looking for “ArUco” style markers. OpenCV natively includes a collection of these markers, and scripts from the ZED Unity plugin already tell OpenCV which markers to look for. All you need to do is get some real-world markers to look at.
Unity Roseville
You’ll find five example markers that OpenCV looks for in the ZED -> Examples -> OpenCV ArUco Detection -> ArUco Marker Images folder. We’ll use aruco_4x4_0.png for this tutorial. You need to display this image somewhere in the real world for your app to see. There are several ways to do this:
- Open the file and leave it open on a second monitor
- Display the marker on your cell phone and turn the brightness all the way up. You can find the marker online at http://chev.me/arucogen/
- Print the marker onto paper
Import OpenCV
Unity Roseville Ca
The fastest way to use OpenCV within Unity is to use Enox Software’s OpenCV for Unity package on the Asset Store. You can use the free trial version for the tutorial, but you won’t be able to build a standalone app.
Download and import the OpenCV for Unity package. You won’t actually touch these assets during the tutorial - they are required for the marker detection scripts in the ZED Unity plugin to work. These scripts are excluded from compilation when the OpenCV for Unity package isn’t imported.
Create the Scene
- Create a new scene and delete the main camera
- In the Projects tab, go to ZED -> Prefabs and drag a ZED_Rig_Mono into your scene (use ZED_Rig_Stereo instead if you want to use pass-through AR)
- Create an empty GameObject, rename it “ZED to OpenCV Retriever” and add a ZEDToOpenCVRetriever component to it.
- Create another empty GameObject, name it “ArUco Detection Manager” and add a ZEDArUcoDetectionManager component to it.
- Create a cube object and add a MarkerObject_MoveToMarker component to it.
Note the Marker ID value in MarkerObject_MoveToMarker. It’s 0 by default - this tells it to detect ArUco marker of index 0, which corresponds to the one you are displaying (aruco_4x4_0). If you use a different marker, you will need to change this value.
Your scene should look like this:
Measure Your Markers
OpenCV does not use the ZED’s depth features to determine the 3D position of a marker. It compares the known size of the marker to its size in a given image frame. Therefore, we need to tell it how big the marker is for it to calculate the position accurately.
- Get a ruler with centimeters on it and measure the width of the marker.
- Select the ArUco Detection Manager object you made earlier.
- In the Marker Width Meters field, put that measurement in meters (1cm = 0.01m)
Note: If displaying the marker on a screen, be careful not to zoom in/out after you measure the marker. This will cause OpenCV to think it’s closer or further from the camera than it really is.
Unity Computer Vision
Fine-Tuning Placement
Run the scene and point your ZED at your marker. You’ll see the cube will move to where the marker is. But it doesn’t look good yet.
Let’s make it so the cube rests atop the marker. We’ll need to shrink the cube and also add an offset between the cube and the MarkerObject. For the offset, we’ll have to make the Cube a separate child object of the MarkerObject.
- Delete your Cube object
- Create a new empty GameObject and rename it “Marker Cube”
- Add the MarkerObject_MoveToMarker component to it
- Create a Cube object as a child of Marker Cube
- Set the X, Y and Z values of the Cube’s Scale to match the width value you put in ArUco Detection Manager
- Set the Z value of the Cube’s Position to be one half of that width value
Note: We adjust the Z position because objects are oriented such that the Z axis is pointing outward from the face of the marker.
Run the scene. The cube should now appear to be sitting atop the marker.
Copyright © 2021 Stereolabs Inc.Unite Now is a free ongoing channel for Unity creators everywhere.
Start watching today for access to informative and inspiring sessions for programmers, artists, live-games developers, and others. Learn expert tips and tricks, best practices, how-to demos, and Q&As from Unity to level up your game – live and on demand.
Using Magic Leap with AR Foundation in Unity 2020.1
Unity’s AR Foundation is a cross-platform API to support augmented reality applications. In this session, you learn how to use AR Foundation to quickly develop or port your AR experience to the Magic Leap 1 headset, while still being able to incorporate Magic Leap-specific features into your apps.
Leveraging Unity in the New Age of Digital Twins
Using Unity Reflect, Booz Allen Hamilton leverages digital twins to create holistic solutions that enable cross-functional collaboration and planning, and identify long-term cost savings. They built a 3D digital space by implementing BIM, AI and other images. Learn how Booz Allen develops various approaches by combining applications and platforms.
Crunching the numbers: Navigating mobile-game metrics
Are you developing an indie mobile game? Join us and our partner Adjust to explore the metrics, reporting, and optimization necessary for success. We’ll also dive into what the core metrics mean and how you can leverage them to take your game to the next level.
Neonverse – Lessons and best practices learned
Developing a fully functional game that can run on even the cheapest device is the holy grail of mobile development. In this session on Neonverse, learn how Tamasenco & Pixel Reign combined vertex lighting with new techniques to achieve rapid and beautiful results, animated in Shaders instead of animators and C# scripts, and more.
First look at 2020.2’s features
Unity Roseville
Join us to see Unity 2020.2’s features in action. In the Editor, we’ll show you the new tools, improvements, and fixes for all major areas. The session is hosted by Unity Creator Advocate, Amel Negra.
ArtEngine: Key AI-assisted artistry features
Join Sebastian Pohl from Binary Impact as he walks you through the key features of Unity ArtEngine. Demoing an example-based workflow, he shows you how to enhance, expand, and transmute physically based rendered (PBR) materials. ArtEngine’s AI-assisted artistry lets you quickly create ultra-realistic materials by up-resing, deblurring, removing seams, unwarping, color matching, and more.
Little Orpheus tech talk: Developing for Apple Arcade
Unity Rose Ceremony
In this deep dive into their development process, The Chinese Room shares lessons learned developing their first Apple Arcade title, Little Orpheus. They’ll discuss various aspects of development, including technical decisions and optimization, as well as how the studio empowered their artists and designers and gave them (almost) free reign, while keeping their work manageable.
Hardspace: Shipbreaker Tech Talk: Explosions with VFX Graph
Hardspace: Shipbreaker artist David and programmer Trevor show you how they use Unity’s Visual Effect Graph to create dynamic explosions with data-driven VFX parameters. They also demonstrate how you can customize explosions for different situations.
Unity Rosary
Access the most popular topics for programmers, artists, live-game developers, and others now. Learn expert tips & tricks and access the best talks, demos, and Q&As from Unity to level up your game, live and on demand.