Hi Jaka,

Thank you for your response. I would like to confirm that you are referring to the following code for MCAP recording? https://github.com/luxonis/depthai/blob/main/depthai_sdk/examples/recording/mcap_record.py

I've been using the mp4 recording method (code below) but find that the RGB FOV is a zoomed-in version of the depth data. For instance, if I take a video of myself, I can only see part of my head/face in the RGB video but I can see the whole thing and more behind me in the depth video. Am I missing something? This is why I ended up resorting to the RGB-D alignment code.

Thank you so much for your help.

    Hi gloria
    To align the depth to color camera you need to specify the stereoconfig:
    stereo.config_stereo(align=color)
    I also think 1080p is not supported on mono cameras, so they are set to 720p. You will need to downscale the color camera (ispScale 2/3).

    If you wish to blend the streams together, i suggest you create a callback function for the visualizer in which you use the code from API version of RGB_depth_align.

    Thanks,
    Jaka

    Hi gloria
    "depth" variable in your code is a stereo component. You can call depth.config_stereo(align=color) (sorry, I was using the same naming scheme as in the stock example for mcap-recording)

    Hope this helps,
    Jaka

    Hi Jaka,

    Thank you so much for all of your help. If I may bother you with one last question (I am hoping this is the last issue I need to resolve). Please see below the error message I am receiving, I am not sure what might be wrong with the code.

    Thanks

      Hi gloria
      Update the AV package, depthai respository (git pull) and depthai_sdk package. Then change the out.depth to out.disparity. It should work, I just tested it myself.

      Thanks,
      Jaka

      Hi Jaka,

      Please see below, it seems like it has an issue with align=color.

      From my understanding, disparity is not the same as depth. Shouldn't I be using out.depth instead?

      Thanks

        Hi gloria
        Could you add your code as well please?

        Disparity is similar to depth in a sense that depth is calculated from disparity. The advantage disparity has over depth is that it can be encoded using VideoEncoder.

        Thanks,
        Jaka

        Hi gloria
        Add this to the top

        import depthai
        import av
        import depthai_sdk
        print('depthai module: ', depthai.__version__)
        print('depthai_sdk module: ', depthai_sdk.__version__)
        print('av module: ', av.__version__)

        I am running the exact same code and I am getting no error.

        Thanks,
        Jaka

        Hi Jaka,

        I would like to thank you for your patience and all of your help. It is working for me now! I do have one last question about how I can get the depth from the disparity? I can't seem to find it in your documentation.

        Warm regards,

        Gloria

        Is there no way to directly record depth as an .mp4 using this method?

          Hi gloria
          Guide here.

          There is no way to record depth with videoencoder on device. You still can record depth, but you have to do it host side. You will have to find/code a way to save UINT16 depth to mp4. I'd suggest GPT for aid.

          Thanks,
          Jaka

          2 years later

          Thanks all in advance for the help. I recorded video with RGB, left and right camera with 20fps. The RGB was collected image with 12 MP and scale it to 1/4 (tried to have maximum FOV) and left/right has 720 P. Is there any solution to align the depth information using disprity map using left+right camera with RGB?

          Thanks

            12 days later