Intermediate

Scene Understanding

Learn how AI parses entire environments semantically, detects planes and surfaces, reconstructs 3D meshes, and enables intelligent content placement in AR/VR.

Beyond Object Detection

While object recognition identifies individual items, scene understanding comprehends the entire environment: where the floor is, which surfaces are walls, where furniture sits, and how spaces connect. This holistic understanding enables AR content to behave realistically within physical spaces.

Semantic Segmentation

Semantic segmentation classifies every pixel in an image into categories like floor, wall, ceiling, furniture, or person:

Python
# Semantic segmentation for AR scene understanding
import torch
from transformers import SegformerForSemanticSegmentation, SegformerFeatureExtractor

model = SegformerForSemanticSegmentation.from_pretrained(
    "nvidia/segformer-b0-finetuned-ade-512-512"
)
extractor = SegformerFeatureExtractor.from_pretrained(
    "nvidia/segformer-b0-finetuned-ade-512-512"
)

inputs = extractor(images=frame, return_tensors="pt")
outputs = model(**inputs)
segmentation = outputs.logits.argmax(dim=1)

# Each pixel now has a label: floor, wall, table, etc.
# Use this to place AR content on appropriate surfaces

Plane Detection

Plane detection identifies flat surfaces in the environment - essential for placing virtual objects on tables, floors, and walls:

  • Horizontal planes - Floors, tables, shelves for placing objects.
  • Vertical planes - Walls for hanging virtual art or displaying information.
  • Arbitrary planes - Slanted surfaces like ramps or angled desks.
ARKit/ARCore: Both Apple ARKit and Google ARCore provide built-in plane detection powered by AI. They classify planes as floor, table, seat, wall, ceiling, or door automatically.

Mesh Reconstruction

Scene meshes provide a 3D geometric representation of the environment that virtual objects can interact with physically:

Python
# Conceptual mesh reconstruction from depth maps
import open3d as o3d
import numpy as np

# Create point cloud from depth image
depth = o3d.geometry.Image(depth_array)
rgb = o3d.geometry.Image(color_array)
rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(rgb, depth)

# Generate point cloud
pcd = o3d.geometry.PointCloud.create_from_rgbd_image(rgbd, intrinsics)

# Reconstruct mesh using Poisson surface reconstruction
mesh, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd)

# The resulting mesh enables physics simulation
# Virtual balls can bounce off real tables!

Scene Graphs

Scene graphs represent relationships between objects in a structured format, enabling higher-level reasoning:

ComponentDescriptionExample
NodesDetected objectsTable, chair, cup
EdgesSpatial relationships"cup is on table"
AttributesObject propertiesColor, size, material

Light Estimation

AI-powered light estimation ensures virtual objects match the real-world lighting conditions, making AR content look natural:

  • Ambient light intensity - Match brightness of virtual objects to the environment.
  • Directional light - Cast shadows in the correct direction.
  • Environmental HDR - Realistic reflections on virtual objects using estimated environment maps.

Next: Applications

See how these scene understanding techniques come together in real-world AI+AR/VR applications.

Next: Applications →

Ready to Go Deeper?

Live instructor-led courses from our partners. Affiliate disclosure.