View my account

unable to get depth_scale

Comments

3 comments

  • MartyG

    Hi Nicola Ariutti  It looks as though if you are defining the depth sensor as sensorAuto then that name should be used to get the depth scale instead of 'sensor':

    auto depthScale = sensorAuto.get_depth_scale();

     

    Almost all 400 Series camera models have a default depth unit scale of 0.001 (the D405's is 0.01) so whilst you can retrieve the depth scale in real-time from the camera, the scale does not change unless altered deliberately by the program or a user input and so it can be easier simply to use a fixed numeric value of 0.001 for the scale.

    0
    Comment actions Permalink
  • Nicola Ariutti

    thank you MartyX Grover for your quick reply,
    and sorry for this trivial mistake of distraction.

    Now that my code has been fixed, I don't have the error anymore and, as you pointed out, I get a value of 0.001.

    If I understood correctly it means that every unit in the Z16 depth frame I get from the sensor, corresponds to 0.001 meters, isn't it?

    So, when it cames to set the min and max thresholds for the depth threshold filter, I have to think in terms of depth unit (and not in terms of meters), is it correct?
    What are the extremes of the scale within which these values can vary?

    Thank you so much!

    0
    Comment actions Permalink
  • MartyG

    The raw pixel depth value (uint16_t) has a range of 0-65535 and the real-world distance in meters is obtained by multiplying the pixel depth value by the depth unit scale value of the camera.  So on a 400 Series camera, 65535 x 0.001 gives a real-world maximum depth distance of 65.535 meters.

     

    In real-world conditions the D435 has a min-max depth range of between 0.1 meters (10 cm) and 10 meters.  Whilst you could set the threshold maximum to a further distance, the camera will not be able to read depth information at that greater distance beyond 10 meters.

    0
    Comment actions Permalink

Please sign in to leave a comment.