Hardware

Reality Check: The marvel of computer vision technology in today’s camera-based AR systems

Comment

Image Credits: Busakorn Pongparnit (opens in a new window) / Getty Images

Alex Chuang

Contributor

Alex Chuang is the managing partner of Shape Immersive, a leading VR/AR agency that drives innovation for the world’s top brands and enterprises.

More posts from Alex Chuang

British science fiction writer, Sir Arthur C. Clarke, once said, “Any sufficiently advanced technology is indistinguishable from magic.”

Augmented reality has the potential to instill awe and wonder in us just as magic would. For the very first time in the history of computing, we now have the ability to blur the line between the physical world and the virtual world. AR promises to bring forth the dawn of a new creative economy, where digital media can be brought to life and given the ability to interact with the real world.

AR experiences can seem magical but what exactly is happening behind the curtain? To answer this, we must look at the three basic foundations of a camera-based AR system like our smartphone.

  1. How do computers know where it is in the world? (Localization + Mapping)
  2. How do computers understand what the world looks like? (Geometry)
  3. How do computers understand the world as we do? (Semantics)

Part 1: How do computers know where it is in the world? (Localization)

Mars Rover Curiosity taking a selfie on Mars. Source: https://www.nasa.gov/jpl/msl/pia19808/looking-up-at-mars-rover-curiosity-in-buckskin-selfie/

When NASA scientists put the rover onto Mars, they needed a way for the robot to navigate itself on a different planet without the use of a global positioning system (GPS). They came up with a technique called Visual Inertial Odometry (VIO) to track the rover’s movement over time without GPS. This is the same technique that our smartphones use to track their spatial position and orientation.

A VIO system is made out of two parts.

  • The Optical System
  • The Inertial System or Inertial Measurement Unit (IMU)

The optical system is comprised of a camera stack which includes the lens, shutter and image sensors. The inertial system is made up of an accelerometer, which measures acceleration and a gyroscope, which measures orientation. Together, they help your device determine its position (x, y, z) and orientation (pitch, yaw, roll), which is also known as your 6-degrees-of-freedom (6DoF) pose.

Six degrees of freedom general definitions. Source: https://sensing.honeywell.com/honeywell-sensing-inertial-measurement-unit-6df-applicationnote.pdf

As you move your smartphone to look at the AR content, your phone is essentially capturing many photos of the environment and comparing them to figure out its position. For each photo it captures, it is also identifying key features in the environment that are visually unique and interesting in nature such as the edges, corners, ridges of unique objects in the scene. By comparing two images and their respective key features and using the sensor data from the phone’s IMU, your phone can figure out its position through stereoscopic calculation. It’s very similar to how our eyes can infer depth.

The features of the two images are detected and matched through a robust and accurate algorithm called (SIFT scale-invariant feature transform). Source: https://www.cc.gatech.edu/~hays/compvision/proj2/

How does mapping work?

When I am lost in a foreign city, the first thing I do is open my Google Maps and look around for visual clues (landmarks, Starbucks, road signs, etc.) to figure out where I am on the map.

For your phone to understand where it is in space, it needs to first build and memorize a map of its surrounding by “looking” around. This machine-readable map is basically a graph of all the interesting points that your phone identified including their descriptions (e.g. colors and lighting). Together, these points or features form a sparse point cloud that looks like the gif below.

A sparse point cloud map generated for localization and 3D reconstruction purposes. Source: https://www.youtube.com/watch?v=RbOcpOmEbiI&t=15s

This map is very important for your phone to relocalize itself when it loses tracking. Your phone can lose tracking if you cover the camera, drop your phone or move your phone too fast and it’s capturing blurry images. When these scenarios happen, your phone will need to relocalize itself. The relocalization process starts when your phone looks at the scene again and identifies the key features of the scene. It then compares those features with the features on the map it previously memorized. When a match has been found, it will be able to find its spatial position again.

What is SLAM (Simultaneous Localization and Mapping)?

To bring everything together, SLAM refers to the broader system that allows your phone to construct and update a map of an unknown environment while simultaneously keep track of its location within the map. SLAM systems include subsystems that we already mentioned like the phone’s optical systems, inertial systems, and mapping systems. Through tight integration between hardware and software, your phone now has this incredible ability to understand where it is in the world and track itself within its environment.

Why isn’t GPS good enough?

GPS will be able to give you a rough estimate of your latitude and longitude position in the world, but it is not accurate enough to give you your precise location. Also, GPS doesn’t work in many underground or indoor environments because the signal from the satellites weakens or distorts as it travels through solid material.

Part 2: How do computers understand what the world looks like? (Geometry)

When Pokemon Go first took the world by storm in 2016, we were charmed by the iconic yellow furry monster that we can see in the real world. However, we quickly realized that Pikachu did not have a clue what the world looked like. To our disappointment, Pikachu was simply a computer-generated graphic that was overlayed on top of the real world.

Expectation VS Reality. The Pikachu on the right does not have any idea of what the world looks like. Source: http://papagamedev.com/wp-content/uploads/2016/08/pokemon_pikachu_ar.jpg

Fast forward to 2019, your phone now has an incredible ability to map your environment spatially (3D reconstruction) with the help of 6D.ai’s software. This means it can understand the shape or structure of real objects in the scene, making occlusion and collision possible. Occlusion is the ability for virtual objects to hide behind real-world objects. And collision is the ability for virtual objects to collide with real-world objects. When virtual objects respond to real-world physics as if they are real, this makes the AR experience so much more believable.

6d.ai is making huge technological advancement in the field of 3D reconstruction for mobile phones. Through their software, the monocular RGB camera on your phone now possesses the power of a depth sensor. It can scan the environment and capture a dense point cloud, which is later converted into a mesh through computational geometry.

Think of a mesh like a thin invisible blanket that drapes over the scene, outlining the external surface of objects. As you move your phone around, this mesh is updated in real-time, providing your device with the most accurate spatial understanding of your physical environment. With this new information, the virtual Pikachu can hop on to your couch, go under a table, and run behind your kitchen counter.

Spatial mapping in action with 6D.ai’s software, no depth sensor needed! Source: https://www.6d.ai/
Spatial mapping in action with ZED’s 3D camera. Source: https://www.youtube.com/watch?v=HnXnBKaCqpU

In this demo below, we used 6D.ai to rapidly generate a textured 3D mesh of the physical environment and allow virtual alien plants to grow on the surfaces of walls, floors, and tables.

Through the lens of our camera, we can now step into a magical alternate dimension that is parallel to our world, just like “The Upside Down” in Stranger Things.

Will enters “The Upside Down”, a parallel alternate dimension in Stranger Things. Source: https://www.netflix.com/

Part 3: How can computers understand the world as we do? (Semantics)

Cuteness alert! Tell me what do you see in the following photo?

Source: https://www.alamy.com

Some of you might say that you see 2 dogs and 2 cats. Some of you might say you see 2 puppies and 2 kittens. And for those of you who are really good, you would say you spot 2 Dachshund puppies and 2 Russian Blue kittens.

When computers see this image, all they see is a bunch of 1’s and 0’s. But with a convolutional neural network (CNN) model, computers can be trained to localize, detect, classify and segment objects. At the simplest level, a convolutional neural network is a system that takes a source image like the one above and figure out the different patterns that it sees in the photo through a series of specialized layers. Each layer has filters that are trained to recognize a specific pattern like edges, shapes, textures, corners or even sophisticated objects like dogs, cats, humans, cars or stop signs.

With CNN as the backbone, the computer can now perform other computer vision tasks such as object detection and classification, semantic segmentation, and instance segmentation.

Source: https://www.youtube.com/watch?v=nDPWywWRIRo

Object Detection + Classification

Object detection and classification is the process of drawing a bounding box around the object(s) in the image and giving it a class label such as dog, cat, person etc. There are two types of algorithms to consider:

  1. Algorithms based on classification work in two stages. In the first step, the model selects an interesting region and then it attempts to classify those regions using CNN. Predictions are ran for every selected region until the CNN model is confident that it has detected the object that it is looking for. This is a computationally expensive method because you’re essentially processing the entire image to look for one thing.
  2. Algorithms based on regression predicts classes and bounding boxes for the whole image in one run of the algorithm. The most well-known example of this type of algorithms is YOLO (You only look once), which is commonly used for real-time object detection.

Semantic Segmentation 

Semantic segmentation is a process that aims to recognize and understand what’s in the image at the pixel level. Each pixel of the image is associated with a class label such as grass, cat, tree, and sky. Each class label is also highlighted by a unique color.

Source: https://tariq-hasan.github.io/concepts/computer-vision-semantic-segmentation/

However, semantic segmentation does not highlight individual instances of a class differently. For example, if there are 2 cows in the photo, it will highlight the collective area of the 2 cows and we won’t be able to distinguish one cow from another. This is where instance segmentation comes into play.

Instance Segmentation

Instance segmentation is actually a combo method of object detection and semantic segmentation. First, the model will use object detection to draw a bounding box around each of the two dogs. Then it will perform semantic segmentation within the bounding box to segment out the instances.

This particular model is called Mask R-CNN (mask regional convolutional neural network), which was built by the Facebook AI research team in 2017.

Can Mask R-CNN be used in real-time for Augmented Reality?

The short answer is yes, but there is a trade-off in quality and speed. Niantic used a similar deep neural network to infer 3D information about the surrounding world so perceived occlusion can be possible. In the demo below, it is quite obvious that dynamic objects like humans are segmented and masked in real-time so Pikachu and Eevee can run behind them.

Here is another example of how real-time instance segmentation is applied to let you virtually try on new hair color.

And here is a demo of a context-aware AR shooting game. The neural network is able to identify the different objects in the scene as well as its material (e.g. wood, glass, fabric). As a result, when the virtual bullet passes through each material, a different animation effect takes place. For example, when the bullet passes through the fabric chair, feathers exploded out.

What does all of this mean for the future of Augmented Reality?

As computers learn to localize itself, see and understand the world as we do, we are one step closer to merging the virtual and physical world.

One day, we will create a machine-readable, 1:1 scale model of the world known as “The AR Cloud”. The AR Cloud has many alternative names such as “the world’s digital twin”, “the mirror world” or “magicverse”. Personally, I’d like to think of it as a digital replica of our world that perfectly overlays on top of our real world.

 “The AR Cloud is going to become the single most important software infrastructure in the history of computing, far bigger than Facebook’s Social Graph or Google’s Search Index.”- Ori Inbar, Super Ventures

Not only will The AR Cloud enable everyone to have a shared experience, but its applications also extend well into self-driving cars, Internet of Things, automation, smart cities or self-navigating delivery drones.

Soon we will be able to program context-aware media to interact with our real world. In 2015, Niantic released a Pokemon Go concept trailer where they showed hundreds of people using their Pokemons to fight Mewtwo in Timesquare. This type of experience will be possible as key technologies such as The AR Cloud, 5G, AI and AR glasses mature over time.

Source: https://www.youtube.com/watch?v=2sj2iQyBTQs

JK Rowling once said, “We do not need magic to change the world, we carry all the power we need inside ourselves already: we have the power to imagine better.” With augmented reality, our world becomes a canvas for us to paint our imagination over. Hopefully, this article was able to inspire you to experiment and create with AR!

More TechCrunch

Ahead of the AI safety summit kicking off in Seoul, South Korea later this week, its co-host the United Kingdom is expanding its own efforts in the field. The AI…

UK opens office in San Francisco to tackle AI risk

Companies are always looking for an edge, and searching for ways to encourage their employees to innovate. One way to do that is by running an internal hackathon around a…

Why companies are turning to internal hackathons

Featured Article

I’m rooting for Melinda French Gates to fix tech’s broken ‘brilliant jerk’ culture

Women in tech still face a shocking level of mistreatment at work. Melinda French Gates is one of the few working to change that.

8 hours ago
I’m rooting for Melinda French Gates to fix tech’s  broken ‘brilliant jerk’ culture

Blue Origin has successfully completed its NS-25 mission, resuming crewed flights for the first time in nearly two years. The mission brought six tourist crew members to the edge of…

Blue Origin successfully launches its first crewed mission since 2022

Creative Artists Agency (CAA), one of the top entertainment and sports talent agencies, is hoping to be at the forefront of AI protection services for celebrities in Hollywood. With many…

Hollywood agency CAA aims to help stars manage their own AI likenesses

Expedia says Rathi Murthy and Sreenivas Rachamadugu, respectively its CTO and senior vice president of core services product & engineering, are no longer employed at the travel booking company. In…

Expedia says two execs dismissed after ‘violation of company policy’

Welcome back to TechCrunch’s Week in Review. This week had two major events from OpenAI and Google. OpenAI’s spring update event saw the reveal of its new model, GPT-4o, which…

OpenAI and Google lay out their competing AI visions

When Jeffrey Wang posted to X asking if anyone wanted to go in on an order of fancy-but-affordable office nap pods, he didn’t expect the post to go viral.

With AI startups booming, nap pods and Silicon Valley hustle culture are back

OpenAI’s Superalignment team, responsible for developing ways to govern and steer “superintelligent” AI systems, was promised 20% of the company’s compute resources, according to a person from that team. But…

OpenAI created a team to control ‘superintelligent’ AI — then let it wither, source says

A new crop of early-stage startups — along with some recent VC investments — illustrates a niche emerging in the autonomous vehicle technology sector. Unlike the companies bringing robotaxis to…

VCs and the military are fueling self-driving startups that don’t need roads

When the founders of Sagetap, Sahil Khanna and Kevin Hughes, started working at early-stage enterprise software startups, they were surprised to find that the companies they worked at were trying…

Deal Dive: Sagetap looks to bring enterprise software sales into the 21st century

Keeping up with an industry as fast-moving as AI is a tall order. So until an AI can do it for you, here’s a handy roundup of recent stories in the world…

This Week in AI: OpenAI moves away from safety

After Apple loosened its App Store guidelines to permit game emulators, the retro game emulator Delta — an app 10 years in the making — hit the top of the…

Adobe comes after indie game emulator Delta for copying its logo

Meta is once again taking on its competitors by developing a feature that borrows concepts from others — in this case, BeReal and Snapchat. The company is developing a feature…

Meta’s latest experiment borrows from BeReal’s and Snapchat’s core ideas

Welcome to Startups Weekly! We’ve been drowning in AI news this week, with Google’s I/O setting the pace. And Elon Musk rages against the machine.

Startups Weekly: It’s the dawning of the age of AI — plus,  Musk is raging against the machine

IndieBio’s Bay Area incubator is about to debut its 15th cohort of biotech startups. We took special note of a few, which were making some major, bordering on ludicrous, claims…

IndieBio’s SF incubator lineup is making some wild biotech promises

YouTube TV has announced that its multiview feature for watching four streams at once is now available on Android phones and tablets. The Android launch comes two months after YouTube…

YouTube TV’s ‘multiview’ feature is now available on Android phones and tablets

Featured Article

Two Santa Cruz students uncover security bug that could let millions do their laundry for free

CSC ServiceWorks provides laundry machines to thousands of residential homes and universities, but the company ignored requests to fix a security bug.

2 days ago
Two Santa Cruz students uncover security bug that could let millions do their laundry for free

TechCrunch Disrupt 2024 is just around the corner, and the buzz is palpable. But what if we told you there’s a chance for you to not just attend, but also…

Harness the TechCrunch Effect: Host a Side Event at Disrupt 2024

Decks are all about telling a compelling story and Goodcarbon does a good job on that front. But there’s important information missing too.

Pitch Deck Teardown: Goodcarbon’s $5.5M seed deck

Slack is making it difficult for its customers if they want the company to stop using its data for model training.

Slack under attack over sneaky AI training policy

A Texas-based company that provides health insurance and benefit plans disclosed a data breach affecting almost 2.5 million people, some of whom had their Social Security number stolen. WebTPA said…

Healthcare company WebTPA discloses breach affecting 2.5 million people

Featured Article

Microsoft dodges UK antitrust scrutiny over its Mistral AI stake

Microsoft won’t be facing antitrust scrutiny in the U.K. over its recent investment into French AI startup Mistral AI.

2 days ago
Microsoft dodges UK antitrust scrutiny over its Mistral AI stake

Ember has partnered with HSBC in the U.K. so that the bank’s business customers can access Ember’s services from their online accounts.

Embedded finance is still trendy as accounting automation startup Ember partners with HSBC UK

Kudos uses AI to figure out consumer spending habits so it can then provide more personalized financial advice, like maximizing rewards and utilizing credit effectively.

Kudos lands $10M for an AI smart wallet that picks the best credit card for purchases

The EU’s warning comes after Microsoft failed to respond to a legally binding request for information that focused on its generative AI tools.

EU warns Microsoft it could be fined billions over missing GenAI risk info

The prospects for troubled banking-as-a-service startup Synapse have gone from bad to worse this week after a United States Trustee filed an emergency motion on Wednesday.  The trustee is asking…

A US Trustee wants troubled fintech Synapse to be liquidated via Chapter 7 bankruptcy, cites ‘gross mismanagement’

U.K.-based Seraphim Space is spinning up its 13th accelerator program, with nine participating companies working on a range of tech from propulsion to in-space manufacturing and space situational awareness. The…

Seraphim’s latest space accelerator welcomes nine companies

OpenAI has reached a deal with Reddit to use the social news site’s data for training AI models. In a blog post on OpenAI’s press relations site, the company said…

OpenAI inks deal to train AI on Reddit data

X users will now be able to discover posts from new Communities that are trending directly from an Explore tab within the section.

X pushes more users to Communities