robotology / yarp-device-realsense2

realsense2 device for YARP (https://www.yarp.it/)
Other
8 stars 10 forks source link

realsense2 getDepthWidth() is not consistent with data output #5

Open randaz81 opened 4 years ago

randaz81 commented 4 years ago

I want to discuss this strange behavior of the yarp realsense2 driver (in the tests, I used a D435 camera)

Introduction: resolution 320x240 is not available for the depth camera, but it is ok for the rgb camera. The minimum resolution for the depth camera is 422x240.

Issue: If I set depth resolution to 422x240 and the rgb resolution 320x240, then I have the two following possibilities:

  1. if depth and rgb outputs are not aligned (option needAlignment= false), then the depth output port broadcasts an image with a width of 422 (that's ok). Additionally, the method realsense2Driver::getDepthWidth() returns a width of 422 (that's ok too).

  2. if depth and rgb outputs are aligned (option needAlignment= true), then the depth output port broadcasts an image with a width of 320 (that's ok, since the alignment crops the depth image to the width of the rgb image). But the method realsense2Driver::getDepthWidth() returns a width of 422.

I think this behavior is either wrong or, if it is intentional, it seems to me that it is not documented, and it generates confusion. What do you think? @xEnVrE @lnobile @Nicogene

Nicogene commented 4 years ago

Hi @randaz81 ,

The resolution of the depth and rgb are taken from the internal structures without interrogating the hardware.

I don't remember if I didn't do it because it wasn't possible or if I just did a mistake. In the latter case I think it is a bug that can easily addressed