rerun-io / rerun

Visualize streams of multimodal data. Free, fast, easy to use, and simple to integrate. Built in Rust.
https://rerun.io/
Apache License 2.0
6.51k stars 325 forks source link

Pixel center convention not documented #3896

Open roym899 opened 1 year ago

roym899 commented 1 year ago

Describe the annoyance I believe Rerun assumes the pixel center to be at 0.5, 0.5. OpenCV (mostly?) uses 0.0, 0.0, Matlab uses 1.0, 1.0 (see e.g., https://se.mathworks.com/help/vision/ref/cameraintrinsicstoopencv.html). It would be nice to document this fact in a few places where it could be relevant. Such as when logging any 2D primitive, images, and pinhole projections. Especially in the latter case the pinhole projection comes with some convention based on how the calibration was performed.

emilk commented 1 year ago

Yes, we use (0.5, 0.5) convention for our 2D spaces, showing each texel as a 1x1 square, so that a 640 pixel wide image spans the inclusive range [0.0, 640.0]

Wumpf commented 1 year ago

unclear to me though where we document it apart from pinhole where it's relevant. It's a property of the viewer otherwise

rgolovanov commented 2 months ago

@emilk, @Wumpf it seems (0.5, 0.5) convention may lead to confusion. For example, when one deals with feature detection algorithms (like corner detector) the visualization of detected features on top of the image isn't aligned well. Point #1 points to exact pixel by rerun visualizes it in the corner and we need to mentally move it to (+0.5, +0.5).

Agree with @Wumpf that it seems to be the Viewer's property and it might be good idea to consider other conventions, e.g. (0, 0) - in this case the 2D view of feature points and theimage will be consistent and automatically aligned. image