View my account

Setting and Querying Options in Matlab with D405



  • MartyG

    Hi Daniel S Esser  Thanks very much for your questions.


    1.  Could you provide further information please about the meaning of "trying to query the range for the accuracy object".


    For example, if you are trying to find the distance from the camera to the target object then uint16_t would typically be used, like in the MATLAB code example at the link below.


    2.  The link below has a discussion about multicam with MATLAB.

    Comment actions Permalink
  • Daniel S Esser

    Thanks for the quick reply. I realized my initial question was confusing (I didn't mean the camera depth range, I meant the range/set of allowed option values for a particular option). I think I have figured out how to change options.

    First I select the device and sensor:

    myDevice = profile.get_device();
    d_sensor = myDevice.first('depth_sensor');

    Then I create an option enumerator and set/get the option value

    option = realsense.option(uint64(1));
    My issue now is that most of the options do not seem to be supported. Only options 0-11 appear to work. I would like to change options such as accuracy (14), filter_option (16), min_distance (33) and max_distance(34) etc.
    How can I change these options? They appear to be valid options in realsense viewer fpor the D405 camera.
    Thank you!
    Comment actions Permalink
  • MartyG

    The MATLAB wrapper's programming language is almost 1:1 with the SDK's C++ language, so if an option is supported for the D405 then it should be possible to access it through the MATLAB wrapper.  A list of the wrapper's options can be found at the link below.


    I note your mention that only options 0-11 are apparently working.  These are all RGB options.  The rest after 11 are depth options.  I see that you are accessing the depth sensor in your script, so the options after 11 should be accessible.


    The D405 does not have a separate RGB sensor and so its RGB options are accessed via the depth sensor, as RGB is provided by the depth sensor on D405.  


    It is possible to set an option in MATLAB with the option name instead of its number, so you could try that to see whether it makes a difference.


    profile = pipe.start();
    dev = profile.get_device();
    d_sensor = dev.first('depth_sensor');
    if d_sensor.supports_option(option.emitter_enabled)
    d_sensor.set_option(option.emitter_enabled, <_**0 OR 1**_>);
    Comment actions Permalink

Please sign in to leave a comment.