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

Camera extrinsics and intrinsics on same path does not work for depth images #3296

Closed
roym899 opened this issue Sep 12, 2023 · 0 comments · Fixed by #3514
Closed

Camera extrinsics and intrinsics on same path does not work for depth images #3296

roym899 opened this issue Sep 12, 2023 · 0 comments · Fixed by #3514
Assignees
Labels
🪳 bug Something isn't working

Comments

@roym899
Copy link
Collaborator

roym899 commented Sep 12, 2023

Describe the bug
#2568 added the option to log extrinsics + intrinsics (+ image) on the same path. It works fine for RGB images, however for depth images it does not work, even when the depth image is on a separate path.

This works:

rgbd_camera <- Transform3D
rgbd_camera/image/ <- Pinhole
rgbd_camera/image/depth <- DepthImage

These do not work

rgbd_camera <- Transform3D, Pinhole
rgbd_camera/depth <- DepthImage
and
rgbd_camera <- Transform3D, Pinhole, DepthImage

To reproduce

import numpy as np
import rerun as rr
import rerun.experimental as rr2
from rerun.experimental import dt as rrd

rr.init("depth_camera", spawn=True)
rr2.log(
    "world/rgbd_camera",
    rrd.TranslationAndMat3x3(translation=[10.0, 0.0, 0.0], matrix=np.eye(3)),
)
rr.log_pinhole("world/rgbd_camera", height=480, width=640, focal_length_px=500.0)
rr2.log("world/rgbd_camera", rr2.DepthImage(np.random.rand(480, 640)))

gives
Screenshot world - 2

while

import numpy as np
import rerun as rr
import rerun.experimental as rr2
from rerun.experimental import dt as rrd

rr.init("depth_camera", spawn=True)
rr2.log(
    "world/rgbd_camera",
    rrd.TranslationAndMat3x3(translation=[10.0, 0.0, 0.0], matrix=np.eye(3)),
)
rr.log_pinhole("world/rgbd_camera/image", height=480, width=640, focal_length_px=500.0)
rr2.log("world/rgbd_camera/image/depth", rr2.DepthImage(np.random.rand(480, 640)))

gives
Screenshot world - 1

Expected behavior
Should work similar to color images. Ideally color and depth on same path would also be supported, but if that's not possible, I'd expect

rgbd_camera <- Transform3D, Pinhole
rgbd_camera/rgb <- Image
rgbd_camera/depth <- DepthImage

to work.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04

Rerun version

rerun_py 0.9.0-alpha.4 [rustc 1.72.0 (5680fa18f 2023-08-23), LLVM 16.0.5] x86_64-unknown-linux-gnu 7db7b54, built 2023-09-12T08:50:21Z
@roym899 roym899 added 🪳 bug Something isn't working 👀 needs triage This issue needs to be triaged by the Rerun team labels Sep 12, 2023
@nikolausWest nikolausWest removed the 👀 needs triage This issue needs to be triaged by the Rerun team label Sep 19, 2023
@Wumpf Wumpf self-assigned this Sep 28, 2023
teh-cmc pushed a commit that referenced this issue Sep 28, 2023
…unt (#3514)

### What

* Fixes #3296

Repro code:
```python
import numpy as np
import rerun as rr

rr.init("depth_camera", spawn=True)

rr.log(
    "world0/rgbd_camera",
    rr.TranslationAndMat3x3(translation=[10.0, 0.0, 0.0], matrix=np.eye(3)),
)
rr.log_pinhole("world0/rgbd_camera/image", height=480, width=640, focal_length_px=500.0)
rr.log("world0/rgbd_camera/image/depth", rr.DepthImage(np.random.rand(480, 640)))


rr.log(
    "world1/rgbd_camera",
    rr.TranslationAndMat3x3(translation=[10.0, 0.0, 0.0], matrix=np.eye(3)),
)
rr.log_pinhole("world1/rgbd_camera", height=480, width=640, focal_length_px=500.0)
rr.log("world1/rgbd_camera/depth", rr.DepthImage(np.random.rand(480, 640)))


rr.log(
    "world2/rgbd_camera",
    rr.TranslationAndMat3x3(translation=[10.0, 0.0, 0.0], matrix=np.eye(3)),
)
rr.log_pinhole("world2/rgbd_camera", height=480, width=640, focal_length_px=500.0)
rr.log("world2/rgbd_camera", rr.DepthImage(np.random.rand(480, 640)))
```

Before:
<img width="1089" alt="Screenshot 2023-09-28 at 12 02 06"
src="https://github.com/rerun-io/rerun/assets/1220815/fafa90e9-03e8-40ee-aec6-422fd5ad3dbd">

After:
<img width="1058" alt="image"
src="https://github.com/rerun-io/rerun/assets/1220815/690d229f-2a61-4196-bdac-7bea7f8fb685">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants