Skip to content
SDB
Sensing & Perception

2 hours

Camera-based Robotic Sensing and Machine Vision

Visual Perception and Computer Vision for Robots

Subhendu Datta BhowmikRobotics Tutorials

Camera Types for Robotic Vision

Cameras are the richest exteroceptive sensors available to robots, providing dense 2D or 3D information about the scene at every frame. Different camera types offer different trade-offs between depth information, resolution, frame rate, and cost.

Monocular cameras capture a standard 2D color or grayscale image using a single lens. They provide no direct depth information — depth must be inferred through motion (Structure from Motion), known object size, or machine learning. They are the lowest cost and simplest to use.

Stereo cameras pair two cameras separated by a known baseline distance. By finding corresponding pixels in the left and right images (stereo matching / disparity estimation) and applying triangulation, dense depth maps are computed. Depth accuracy decreases quadratically with distance; near-range performance is excellent. Examples: ZED (Stereolabs), Intel RealSense 400 series (stereo), Carnegie Robotics MultiSense.

RGB-D cameras combine a color camera with a depth sensor, producing aligned color + depth images. Two depth sensing technologies are used:

  • Structured light: Projects a known IR pattern onto the scene; deformation of the pattern reveals depth (Intel RealSense D415/D435, Microsoft Kinect v1, Orbbec Astra). Works poorly in outdoor sunlight (overwhelms the IR pattern).
  • Time-of-Flight (ToF): A modulated IR signal is emitted and the phase shift or pulse delay of the return measures depth (Microsoft Azure Kinect, PMD pico flexx). More robust outdoors but lower resolution than structured light.

Event cameras (Dynamic Vision Sensors, DVS) output asynchronous events for each pixel that detects a brightness change above threshold, rather than synchronous frames. This provides microsecond-resolution motion detection, high dynamic range, and no motion blur — ideal for fast robot motion. Examples: DAVIS346 (IniVation), Prophesee EVK4.

Camera Type Comparison for Robotics

TypeDepth InfoTypical ResolutionFrame RateCostPrimary Use Case
MonocularNone (indirect)1 – 20 MP30 – 200 fps$20 – $500Object detection, classification, visual odometry
StereoTriangulation (0.1 – 10 m)1 – 4 MP per eye15 – 60 fps$100 – $5,000Mobile robot navigation, 3D reconstruction
RGB-D (structured light)Structured light (0.1 – 5 m)640×480 depth + 1080p color15 – 90 fps$100 – $800Manipulation, indoors SLAM, human pose
RGB-D (ToF)Phase shift ToF (0.3 – 10 m)512×512 depth + 1080p color15 – 30 fps$200 – $1,500Outdoor RGB-D, body tracking
Event cameraNone (indirect via stereo event)240×180 – 1280×720 events1 MHz event rate$200 – $5,000High-speed motion, high-dynamic-range scenes
360° fisheyeNone (indirect)4 – 12 MP30 – 60 fps$100 – $2,000Omnidirectional navigation, panoramic SLAM

Pinhole Camera Model

The pinhole camera model relates a 3D world point to a 2D image point:

u = f_x × (X / Z) + c_x
v = f_y × (Y / Z) + c_y

In homogeneous form:  λ × [u, v, 1]ᵀ = K × [X, Y, Z]ᵀ

Intrinsic matrix K = | f_x   0   c_x |
                     |  0   f_y  c_y |
                     |  0    0    1  |
where:
  (X, Y, Z) = 3D point in camera frame
  (u, v) = 2D pixel coordinates
  f_x, f_y = focal lengths in pixels (horizontal, vertical)
  c_x, c_y = principal point (image center in pixels)
  λ = projective scale factor (= Z)

For stereo triangulation, disparity d = u_left − u_right relates to depth:
  Z = f_x × baseline / d

Real lenses deviate from the pinhole model due to lens distortion (radial and tangential). Distortion coefficients (k₁, k₂, p₁, p₂, k₃) are determined during calibration and applied to undistort images before processing.

Classical Computer Vision Pipeline

The classical machine vision pipeline processes camera images through a sequence of deterministic steps to extract actionable information:

1. Image acquisition and preprocessing: Debayering (for Bayer-pattern sensors), noise removal (Gaussian blur, median filter), histogram equalization for contrast enhancement, and color space conversion (BGR → grayscale, HSV, or Lab).

2. Edge detection: The Canny edge detector applies Gaussian smoothing → gradient magnitude estimation (Sobel operators: ∂I/∂x, ∂I/∂y) → non-maximum suppression → hysteresis thresholding. Produces thin, connected edge maps robust to noise.

3. Feature extraction:

  • SIFT (Scale-Invariant Feature Transform): Detects keypoints at multiple scales using Difference-of-Gaussian; computes 128-dimensional gradient orientation histograms — invariant to scale, rotation, and illumination change
  • ORB (Oriented FAST and Rotated BRIEF): A binary feature descriptor combining FAST keypoint detector and BRIEF descriptor with orientation; 100× faster than SIFT for real-time use (ORB-SLAM2/3 relies on ORB)
  • Harris corner detector: Detects image corners by analyzing the second-moment matrix of image gradients; computationally simple, widely used

4. Feature matching and geometric reasoning: FLANN (Fast Library for Approximate Nearest Neighbors) matches feature descriptors. RANSAC (Random Sample Consensus) robustly estimates geometric transformations (homography, essential matrix) from noisy correspondences.

5. Object detection (classical): Template matching via normalized cross-correlation; Viola-Jones (Haar cascades) for face detection; HOG + SVM (Histogram of Oriented Gradients + Support Vector Machine) for pedestrian detection.

Deep Learning for Robot Vision

Convolutional Neural Networks (CNNs) have largely superseded classical feature engineering for high-level visual recognition tasks. CNNs learn hierarchical feature representations directly from labeled training data.

Image classification: CNNs (VGG, ResNet, EfficientNet) output a probability distribution over semantic categories. ResNet-50 achieves ~76% top-1 accuracy on ImageNet with 25M parameters, running at ~50 fps on a modern GPU.

Object detection: Two-stage detectors (Faster R-CNN) first propose regions of interest, then classify them — high accuracy but slower (~10 fps). Single-stage detectors (YOLO, SSD, DETR) predict bounding boxes and classes in a single forward pass — YOLOv8 achieves ~50 ms/frame on an NVIDIA Jetson Orin.

Semantic segmentation: Models (DeepLab, SegFormer, Mask2Former) assign a class label to every pixel, enabling robots to understand drivable surfaces, object boundaries, and scene layout at pixel level.

6-DoF object pose estimation: Networks (DOPE by NVIDIA, FoundPose, MegaPose) predict the full 6D pose (3D position + 3D orientation) of known objects for robotic grasping. They typically output 2D keypoint predictions on object CAD model vertices, then use PnP (Perspective-n-Point) to recover the 3D pose.

Visual foundation models: Large pretrained vision-language models (CLIP, SAM — Segment Anything Model, DINOv2) provide zero-shot or few-shot generalization, enabling robots to identify objects from text descriptions without task-specific training.

Classical Computer Vision vs. Deep Learning for Robotics

Classical Computer Vision

  • Handcrafted feature descriptors (SIFT, ORB, Canny edges)
  • Deterministic and interpretable — known failure modes
  • Works well with little or no training data
  • Robust to domain shift if task is well-defined geometrically
  • Computationally efficient — runs on CPU in real time
  • Struggles with occlusion, illumination variation, deformable objects
  • Still the backbone of visual odometry (ORB-SLAM3) and stereo matching

Deep Learning Computer Vision

  • Learned feature representations from large labeled datasets
  • State-of-the-art performance on recognition and detection benchmarks
  • Handles illumination, viewpoint, and appearance variation robustly
  • Requires large labeled training datasets and GPU computation
  • Black-box behavior — difficult to diagnose failure modes
  • Prone to distribution shift between training and deployment environments
  • Foundation models (SAM, CLIP) reduce data requirements for new tasks

Sensing & Perception