Skip to content

Stitching images#3

Open
andredaa wants to merge 51 commits into
mainfrom
stitching-images
Open

Stitching images#3
andredaa wants to merge 51 commits into
mainfrom
stitching-images

Conversation

@andredaa

@andredaa andredaa commented Sep 11, 2025

Copy link
Copy Markdown
Contributor
image

PR Description: Camera Stitching and Distortion Analysis System
🎯 Overview
This PR introduces a comprehensive multi-camera stitching system for the CityScope object tracking project, enabling real-time fusion of multiple Intel RealSense camera feeds into a unified top-down view of the table surface.
✨ Key Features Added
🔧 Camera Stitching System (camera_stitching.py)
Automatic layout detection: Analyzes physical camera positions to create flexible 1×2 or 2×2 grid layouts
Perspective transformation: Uses calibration markers to warp each camera view to table coordinates
Real-time processing: Pre-calculates transforms at startup for ~30 FPS performance
Scale normalization: Ensures consistent sizing across all camera feeds

📐 Calibration & Quality Analysis
Enhanced calibration system (find_calibration_markers.py):
Detects 4 corner markers per camera (ArUco markers 48, 44, 41, 43 for camera 000; 68, 62, 69, 999 for camera 001)
Exports calibration data to calibration_markers.json
Generates per-camera visualization images
Distortion analysis (distortion_analysis.py):
Quantifies calibration quality with 4 metrics: center uniformity, side uniformity, diagonal ratio, angle uniformity
Provides actionable scores (Excellent ≥0.95, Good ≥0.90, etc.)
Exports detailed analysis reports and visualizations
📊 Quality Monitoring & Visualization
Comprehensive reporting: Exports to calibration_visualizations/ directory
Per-camera marker detection: camera_XXX_markers.png
Distortion analysis reports: camera_XXX_distortion_analysis.png
Cross-camera comparison: distortion_summary.png
Sample stitched output: stitched_sample.png
Real-time feedback: Console output with quality scores and recommendations
🚀 Integration & Performance
Server integration: server.py now initializes stitching system at startup
Optimized pipeline: Perspective transforms calculated once, applied at 30 FPS
Mock camera support: mock_camera.py for testing without hardware
Enhanced detection: Updated marker detection with improved accuracy
🔄 Code Changes Summary
2,200+ lines added, 875 lines removed
New files: 7 major new modules (stitching, distortion analysis, calibration, etc.)
Enhanced files: Updated server, detection, HUD, and requirements
Cleanup: Removed legacy TableTracker files and unused scripts
Documentation: Comprehensive README updates and new distortion analysis guide
🎨 Visual Outputs
The system generates rich visual feedback:
Calibration marker detection overlays
Color-coded distortion analysis charts
Side-by-side camera comparisons
Real-time stitched table view samples
🧪 Testing & Validation
Test suite: test_distortion_analysis.py with sample data scenarios
Standalone tools: Individual modules can run independently for debugging
Quality metrics: Quantitative scoring system for camera positioning validation
💡 Usage Impact
Improved accuracy: Multi-camera fusion provides complete table coverage
Better calibration: Visual quality feedback guides optimal camera positioning
Streamlined setup: Automated calibration detection and layout analysis
Production ready: Real-time performance with comprehensive error handling
🔗 Dependencies
Added matplotlib for visualization
Enhanced OpenCV usage for perspective transforms
Maintained compatibility with existing Intel RealSense pipeline
This PR transforms the single-camera system into a robust multi-camera stitching solution with professional-grade calibration analysis and quality monitoring capabilities.

Holtorf and others added 30 commits August 13, 2025 13:23
made with chatgpt
prompt for table setup details if no calibration file found
- Remove unused stitching implementations (simple_stitcher.py, sticthing_v2.py, run_stitching.py, stitching.py)
- Remove old tracking scripts (TableTracker*.py)
- Remove unused calibration files (calibration.json, simple_calibration.json, etc.)
- Remove sample/test image outputs that aren't produced by current system
- Update README to only reference files actually produced by active system
- Keep client.py for testing TCP connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants