Stitching images#3
Open
andredaa wants to merge 51 commits into
Open
Conversation
prompt for table setup details if no calibration file found
…add exported visualization images
- 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
Updated description for camera_setup.py to clarify functionality.
this is the setup for the Leipzig COUP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.