render_to_depth_image() on macbook macos give half width and half height scene but at right resolution #6999
Closed
3 tasks done
Labels
bug
Not a build issue, this is likely a bug.
Checklist
main
branch).Describe the issue
When using both scene render_to_image() and render_to_depth_image() it provide the right resolution of the image in my case. But the depth image is only half the width and half the height of the actual rendered scene. This might be related to macbook pixel density.
The actual rendered scene render_to_image() result (ok, this is exactly what is scene into the viewport)
The depth capture for render_to_depth_image(), it has the right image resolution, but the actual scene in it is half the width and half the height (this is normalized value to make a black to white scale visible):
The overlap when I scale down the depth to half width and half height and bring it to 0,0 image coordinate, the depth is put atop with 98% alpha on top of the render image:
I also did try to bring the window to an external monitor full HD no high density but the result is the same.
Steps to reproduce the bug
#6996 provide the original question with the files but here is the code copied, just need to run it and wait a few seconds, it will generate the depth and the capture image.
Error message
NA
Expected behavior
Having the same resolution and the same scene dimension to superpose both capture depth and scene image.
Open3D, Python and System information
Additional information
Tested on normal external monitor (macbook screen still first monitor). No difference sadly. I do not have another computer on hand to test it on a Windows/Linux PC with a "normal" screen.
Personnal Code note
Not sure if this might help, I did not debug the whole thing, but here is something that might differ between the render to image and render depth to image.
Depth:
https://github.com/isl-org/Open3D/blob/db00e339c1645440dea6951c2971ffa759934112/cpp/open3d/visualization/rendering/Renderer.cpp#L113C17-L116C72
Compare to the buffer size used directly for the:
Open3D/cpp/open3d/visualization/rendering/Renderer.cpp
Line 83 in db00e33
I would need to dig what the render->Configure(... bool depth_image,) does exactly, because the rest seem to be the same at high level.
only seems to affect the view ConfigureForColorPicking():
Open3D/cpp/open3d/visualization/rendering/filament/FilamentRenderToBuffer.cpp
Line 142 in db00e33
Hopefully, this can be fixed rather quickly, since it block me from doing anything with it so far.
The text was updated successfully, but these errors were encountered: