Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DepthImage flickering in rerun 0.18 #7252

Closed
makeecat opened this issue Aug 22, 2024 · 4 comments
Closed

DepthImage flickering in rerun 0.18 #7252

makeecat opened this issue Aug 22, 2024 · 4 comments
Assignees
Labels
🪳 bug Something isn't working 🦟 regression A thing that used to work in an earlier release

Comments

@makeecat
Copy link

Describe the bug

The depthimage logged in rerun 0.18 may become inconsistent between frames. It looks like flickering. The same behavior does not exist in 0.17. I feel like it could be related to the background rrd file compression?

To Reproduce
Steps to reproduce the behavior:

  1. compile and run code in https://github.com/makeecat/Peng
  2. you will see depthimage flickering in the logged data
  3. The rerun related code is https://github.com/makeecat/Peng/blob/a936a9dd47ecde4719b268004082aa0d06eba670/src/main.rs#L1276

Desktop (please complete the following information):

  • OS: macOS, Ubuntu 22.04 (x64)

Rerun version
0.18.0

@makeecat makeecat added 👀 needs triage This issue needs to be triaged by the Rerun team 🪳 bug Something isn't working labels Aug 22, 2024
@teh-cmc teh-cmc added 🦟 regression A thing that used to work in an earlier release and removed 👀 needs triage This issue needs to be triaged by the Rerun team labels Aug 23, 2024
@teh-cmc teh-cmc added this to the 0.18.1 milestone Aug 23, 2024
@emilk
Copy link
Member

emilk commented Aug 23, 2024

Can you please elaborate - inconsistent how? Do you have some screenshots or video you can add?

You're using an 8-bit buffer for the depth image - this will cause severe quantizing. You can use a full f32 instead:

-    let depth_image_buffer: image::GrayImage =
-        image::ImageBuffer::from_fn(width as u32, height as u32, |x, y| {
-            let depth = depth_image[y as usize * width + x as usize];
-            if depth.is_infinite() {
-                image::Luma([0u8])
-            } else {
-                let normalized_depth = (depth - min_depth) / (max_depth - min_depth);
-                image::Luma([(normalized_depth * 255.0) as u8])
-            }
-        });
+    let depth_image_buffer = ndarray::Array::from_iter(depth_image.iter().cloned())
+        .into_shape((height, width))
+        .unwrap();

with

ndarray = "0.15"

in your Cargo.toml

@makeecat
Copy link
Author

I will try to use f32 or u16 illustrated in https://rerun.io/docs/reference/types/archetypes/depth_image. I am using u8 since that is the only way I can work with related to #7134

Here is the flickering video:
rerun_0 18_flickering

@makeecat
Copy link
Author

It could be related to #6106

@emilk
Copy link
Member

emilk commented Aug 26, 2024

Yes, I think this is just #6106 aggravated by using u8 instead of f32

@emilk emilk closed this as not planned Won't fix, can't repro, duplicate, stale Aug 26, 2024
@emilk emilk removed this from the 0.18.1 milestone Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 🦟 regression A thing that used to work in an earlier release
Projects
None yet
Development

No branches or pull requests

4 participants