Skip to content

Enhance video processing and improve extrinsics detection fallback - #285

Merged
AlbertoCasasOrtiz merged 6 commits into
mainfrom
dev
Jun 24, 2026
Merged

Enhance video processing and improve extrinsics detection fallback#285
AlbertoCasasOrtiz merged 6 commits into
mainfrom
dev

Conversation

@Seeeeeyo

Copy link
Copy Markdown
Contributor

This pull request introduces comprehensive support for handling LiDAR video data and associated depth information throughout the data processing pipeline. The main changes include robust downloading, extraction, compression, and uploading of LiDAR depth data and camera intrinsics, as well as improved API interactions for video and result uploads. Additionally, a new local trial processing script is added for sandbox testing.

LiDAR Data Handling and Depth Compression:

  • Added functions to handle LiDAR video files, including safe extraction, locating and copying camera_matrix.csv, and compressing depth data for database upload using zstandard. This includes _compressDepthForDB, _compressLidarDepthFiles, and related helpers in utils.py. [1] [2] [3]
  • Enhanced the video download logic to support LiDAR data, including correct handling of zipped LiDAR bundles and unmapped LiDAR videos.

Camera Intrinsics and Calibration:

  • Modified the main pipeline to prefer LiDAR camera intrinsics (camera_matrix.csv) when present, ensuring accurate calibration for LiDAR cameras. [1] [2] [3]

API and S3 Upload Improvements:

  • Refactored file upload logic to use a new uploadFileToS3 function for both videos and results, ensuring consistent and robust S3 uploads and updating API references accordingly. [1] [2] [3]
  • Improved logic for updating video file locations in the API, with better error handling and retry strategies.

Result Management Enhancements:

  • Updated result deletion to allow targeting by both tag and device ID, improving cleanup precision for device-specific LiDAR results.

New Local Trial Processing Script:

  • Added sandbox_app_local.py, a standalone script for locally polling and processing trials, supporting both single-trial and continuous modes with robust logging and error handling.

These changes collectively enable seamless handling of LiDAR data in the pipeline, from download to upload, while improving maintainability and reliability.

Most important changes:

LiDAR Data Handling and Compression:

  • Added comprehensive functions for extracting, compressing, and uploading LiDAR depth data and camera intrinsics, including robust handling of zipped LiDAR bundles and unmapped LiDAR videos (utils.py). [1] [2] [3]

Camera Intrinsics and Calibration:

  • Updated the main pipeline to load LiDAR-specific camera intrinsics (camera_matrix.csv) when available, ensuring correct calibration for LiDAR cameras (main.py). [1] [2] [3]

API and S3 Upload Improvements:

  • Refactored all file uploads to use a new unified S3 upload function and improved API update logic for both videos and results (utils.py). [1] [2] [3]

Result Management:

  • Enhanced result deletion to allow filtering by both tag and device ID, enabling precise removal of LiDAR-specific results (utils.py).

Local Trial Processing:

  • Introduced sandbox_app_local.py for local polling and processing of trials, with command-line options and robust error handling.

suhlrich and others added 6 commits June 12, 2026 23:24
-if zip in video field, pull out video, rewrite video to database, put zip as a result
-if an extra camera is in recording that was not calibrated, ignore it
calcExtrinsics relied solely on cv2.findChessboardCorners with
CALIB_CB_ADAPTIVE_THRESH, which can fail on otherwise-valid frames
(certain contrast/exposure profiles), causing "checkerboard not detected
by at least one camera" even when the board is clearly visible.

Add the SB detector as a fallback that only runs when the primary
detector fails. SBWithMeta corners are already subpixel-accurate, so
cornerSubPix is skipped in that path. Uses ACCURACY|LARGER (no EXHAUSTIVE)
to keep the fallback fast and avoid OpenCL-related crashes.

No behavior change when the primary detector succeeds.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add findChessboardCornersSBWithMeta fallback for extrinsics detection

@AlbertoCasasOrtiz AlbertoCasasOrtiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AlbertoCasasOrtiz
AlbertoCasasOrtiz merged commit 489972b into main Jun 24, 2026
1 check passed
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