realsense

How to turn off depth sensor completely in realsense D435?


I know the point of the realsense is the depth image, but is there any way to just turn off the depth camera completely for a while? I'm using the c++ api. Python's fine too.


Solution

  • It is possible to disable the depth stream before starting the camera. Also you can configure the streams as per your requirement.

    rs2::config config;
    config.disable_stream(RS2_STREAM_DEPTH); // disable depth streams
    
    rs2::pipeline pipeline;
    rs2::pipeline_profile pipeline_profile;
    
    pipeline_profile = pipeline.start(config); //  start camera
    
    while(true)
    {
        rs2::frameset current_frameset = pipeline.wait_for_frames(); //get all synched frames
        rs2::video_frame current_rgb_frame   = current_frameset.get_color_frame();// get rgb frame
        ..
        ..
    }