Skip to content

feat: depth_units turns 0 into NaN in an integer depth image - #188

Merged
petercorke merged 1 commit into
mainfrom
feat/rosbag-depth-nan
Nov 20, 2026
Merged

petercorke merged 1 commit into
mainfrom
feat/rosbag-depth-nan

Conversation

@petercorke

Copy link
Copy Markdown
Owner

In an integer depth image 0 means no measurement, and in a float one (REP 118) NaN does. A converted integer image now has NaN where it was 0, so that no measurement means the same in both and a minimum, mean or point cloud does not take it for a depth of 0 m. A 32FC1 image already uses NaN and is left alone. There is no extra argument.

This changes the output that #187 (ROSBag depth_units returns depth images as float32 metres, merged) added, which has not been released. Docstring and tests updated, and checked on the real bags in bags/.

Fixes #151

🤖 Generated with Claude Code

In an integer depth image 0 means no measurement, and in a float one (REP 118) NaN
does.  A converted integer image now has NaN where it was 0, so that no measurement means the
same in both and a minimum, mean or point cloud does not take it for a depth of 0 m.  A 32FC1
image already uses NaN and is left alone.  Checked on the real bags.

Refs #151

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit 4150231 into main Nov 20, 2026
34 checks passed
@petercorke
petercorke deleted the feat/rosbag-depth-nan branch November 20, 2026 04:47
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
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.

ROSBag: RealSense bags have a 4-byte depth-units trailer that is guessed, not parsed

1 participant