fix: preserve camera image channels and BGR colors - #92
Open
chaiyuntian wants to merge 1 commit into
Open
chaiyuntian wants to merge 1 commit into
chaiyuntian wants to merge 1 commit into
Conversation
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.
RGB PNG camera responses currently lose their blue channel because the decoder unconditionally removes the last channel. Palette and grayscale PNGs also fail, while BMP
fastcapture returns RGB even though PNG/file capture, display and video recording use BGR. This corrupts RGB observations and segmentation label colors when switching transports.Normalize PNG inputs to three RGB channels before converting to BGR, and preserve BMP's native BGR order. Keep BMP padding, alpha removal and top-down/bottom-up handling intact.
Validation evidence
The same 12 regression cases were run before and after the fix on Windows:
1f588ec, Python 3.12Coverage includes RGB/RGBA/palette/grayscale PNGs, 24/32-bit BMPs with row padding in both storage orientations, and the public
get_imagepath for bothlitandobject_maskobservations. The PNG payloads are encoded by Pillow and the BMP fixtures have explicit headers and known pixel values. Only the server response is mocked; the production decoders are exercised.Reproduce from the repository root:
The repository's pre-commit checks pass for changed files (flake8 was limited to one worker locally). The added CI workflow runs on Windows/Linux with Python 3.10/3.12 and uploads JUnit reports.
Remote CI passed on all four combinations for commit
54a0d9804d1c6a9329c67957154a42d1d1f3a93a: workflow run and downloadable JUnit evidence. Each job reports12 passed.Found while investigating #88. This PR repairs client image decoding. The runtime actor registration defect is addressed separately in #95, which includes before/after captures from the official UE package, original metric depth payloads, and moving-actor validation.