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

2D point radius != None shows up inconsistently in 2D and 3D view #2494

Closed
roym899 opened this issue Jun 20, 2023 · 6 comments · Fixed by #4199
Closed

2D point radius != None shows up inconsistently in 2D and 3D view #2494

roym899 opened this issue Jun 20, 2023 · 6 comments · Fixed by #4199
Assignees
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself user-request This is a pressing issue for one of our users
Milestone

Comments

@roym899
Copy link
Collaborator

roym899 commented Jun 20, 2023

Describe the bug
Logging 2D points to an image plane they show up as huge 3D points (pixels converted to meters?). Things look fine as long as radii=None.

To Reproduce

import numpy as np
import rerun as rr

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

rr.log_view_coordinates("world/camera", xyz="RDF", timeless=True)

rr.log_pinhole(
    "world/camera/image",
    child_from_parent=np.array([[500, 0, 250], [0, 500, 250], [0, 0, 1]]),
    width=500,
    height=500,
)
rr.log_image("world/camera/image/rgb", np.ones((500, 500, 3)))
rr.log_points("world/camera/image/points", np.random.uniform(0, 500, (30, 2)), radii=1)

Expected behavior
good

Actual behavior
bad

Desktop (please complete the following information):

  • OS: Ubuntu 20.04

Rerun version

rerun_py 0.7.0 [rustc 1.69.0 (84c898d65 2023-04-16), LLVM 15.0.7] x86_64-unknown-linux-gnu prepare-0.7 9cf3033, built 2023-06-16T15:47:32Z
@roym899 roym899 added 👀 needs triage This issue needs to be triaged by the Rerun team 🪳 bug Something isn't working labels Jun 20, 2023
@roym899
Copy link
Collaborator Author

roym899 commented Jun 20, 2023

Maybe related to #2279.

@emilk
Copy link
Member

emilk commented Jun 26, 2023

It seems all points in 2D views have too small radius, at least on retina displays

@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself and removed 👀 needs triage This issue needs to be triaged by the Rerun team labels Jun 27, 2023
@Wumpf Wumpf added this to the 0.10 Polish milestone Oct 2, 2023
@abey79 abey79 added the user-request This is a pressing issue for one of our users label Nov 9, 2023
@abey79
Copy link
Member

abey79 commented Nov 9, 2023

This issue has been encountered and reported by some of our users. IMHO, since the 2D point radius correspond to "pixel" units in the 2D space view, and these pixels have a defined size in the 3D space view (on the pinhole widget projection plan), we should be able to adjust the 3D radius to be consistant. That would involve taking into account both the pinhole project itself and the "Image plan distance" parameter.

Expected

image

Actual

image

@abey79
Copy link
Member

abey79 commented Nov 9, 2023

Fun fact: setting the "Image plan distance" to the same value as the pinhole focal yields the correct behaviour:

image

@SeaOtocinclus
Copy link
Contributor

@abey79 FYI, it seems to happen too if you are logging a Boxes2D, so the problem is most likely happening for more than one archetype.

@abey79
Copy link
Member

abey79 commented Nov 10, 2023

Indeed, and the glitches are... interesting:

image

Again, like for points, better handling of "Image plan distance" might improve on this issue:

image
Code
import numpy as np
import rerun as rr

rr.init("rerun_example_pinhole")
rr.connect()

rng = np.random.default_rng(12345)

image = rng.uniform(10, 30, size=[200, 300, 3])
rr.log("world/image", rr.Pinhole(focal_length=300, width=300, height=200))
rr.log("world/image", rr.Image(image))
rr.log("world/image/point", rr.Points2D([50, 70], radii=5))
rr.log("world/image/box", rr.Boxes2D(centers=[100, 100], half_sizes=[20, 30], radii=2))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself user-request This is a pressing issue for one of our users
Projects
None yet
5 participants