Project

shelf_aligner

ShelfAligner Module Technical Report

Overview

The ShelfAligner module implements computer vision-based shelf localization and alignment for retail monitoring systems. It identifies which reference shelf a camera frame corresponds to using feature matching and homography estimation.

Architecture

Core Components

  • ShelfAligner: Main orchestrator class that manages shelf identification workflow
  • FeatureMatcher: Handles feature extraction and matching using ORB/SIFT descriptors
  • HomographyEstimator: Computes geometric transformations between frames and references

Key Features

  • Multi-shelf Support: Loads and matches against multiple reference shelf images
  • Feature-based Matching: Uses configurable ORB or SIFT feature detectors
  • Robust Homography: RANSAC-based homography estimation with validation
  • Confidence Scoring: Inlier ratio-based confidence assessment

Technical Implementation

Feature Matching Pipeline

  1. Feature Extraction: Detects keypoints and computes descriptors (ORB/SIFT)
  2. Descriptor Matching: K-nearest neighbor matching with Lowe’s ratio test
  3. Outlier Filtering: Geometric consistency through homography estimation

Homography Validation

  • Determinant bounds check (0.1 ≤ det ≤ 10)
  • Perspective distortion limits (|H[2,0]|, |H[2,1]| < 0.002)
  • Condition number validation (singular value ratio < 10)

Configuration Parameters

ParameterDefaultPurpose
min_alignment_confidence0.3Minimum confidence threshold
max_features5000Maximum keypoints per image
match_threshold0.75Lowe’s ratio test threshold
ransac_reproj_threshold5.0RANSAC reprojection error

Performance Characteristics

Computational Complexity

  • Feature Extraction: O(n) where n = image pixels
  • Matching: O(m×k) where m = features, k = reference shelves
  • Homography: O(matches) with RANSAC iterations

Quality Metrics

  • Alignment Success: Determined by inlier ratio > threshold
  • Geometric Consistency: Validated through homography constraints
  • Runtime Efficiency: Precomputed reference features for fast matching