Skip to content

PNG Lossless compression - #61

Closed
satishontrack wants to merge 5 commits into
cvg:mainfrom
constructn-corp:main
Closed

satishontrack wants to merge 5 commits into
cvg:mainfrom
constructn-corp:main

Conversation

@satishontrack

Copy link
Copy Markdown
Contributor

Summary

Panorama projection saves each rendered pinhole view with PIL's default PNG level (6), and that encoding dominates the step. This switches to compress_level=1, which is still lossless.

Measurements

Sample of 60 panoramas from a 4096×2048 360 video(3 views each), run through prepare_panorama_capture:

level 6 (before) level 1 (after)
Time per panorama 1.56 s 0.48 s
Projected for 1,252 panoramas ~32 min (measured 31 min in a full run) ~10 min
Size per view 1,498 KB 1,628 KB (+9%)
Pixel differences – 0 / 180 views

satishontrack and others added 5 commits November 11, 2026 18:24
PIL's default PNG level (6) dominated panorama projection time. Level 1
is still lossless and encodes ~3.2x faster end-to-end (1.56 -> 0.48 s per
4096x2048 panorama, 3 views) for ~9% larger files. Rendered pixels are
identical (0/180 views differ on a 60-panorama sample).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-level

Render panorama views with PNG compress_level=1
poselib's monodepth relative pose can return NaN for weak pairs. The pair
was still marked valid, and when it was scored with the frontend's F or H
(UNCALIBRATED / PLANAR_OR_PANORAMIC pairs) nothing removed it, so the NaN
edge reached rotation averaging and Ceres failed ("Rotation averaging
failed"), aborting the whole section.

Mark a pair invalid ("non_finite_relative_pose") when the rotation,
translation or depth scale is non-finite or the quaternion is not unit
length, on both the pinhole MDRP path and the distorted-camera path.
Zero translation stays valid, as pure-rotation pairs still constrain
rotation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Zador-Pataki

Copy link
Copy Markdown
Collaborator

Thanks, nice improvement! Could you please move the relative-pose changes into a separate PR and remove the prototype calibration config? Let’s keep this PR focused on PNG compression.

Did you observe invalid relative-pose estimates in your runs? If so, could you share a failing example so we can reproduce it?

Minor nit: please remove the benchmark numbers from the code comment and keep them in the PR description.

@satishontrack

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @Zador-Pataki. My mistake: this PR was opened from our fork's main, so later merges there (the relative-pose fix and a prototype calibration config) were pulled in. Superseded by #62, which contains only the PNG compress_level=1 change, with the benchmark numbers moved out of the code comment and into the PR description. The relative-pose fix will come as a separate PR with a reproducible failing example.

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.

2 participants