• DepthAI-v2
  • Error when trying to run gen2-record-replay example

Hi,

I am trying to run the luxonis/depthai-experimentsblob/master/gen2-record-replay/record.py example using:

python record.py

But I get the below error:

Traceback (most recent call last):
  File "<PATH>/gen2-record-replay/record.py", line 12, in <module>
    from depthai_sdk import Record, EncodingQuality
ImportError: cannot import name 'EncodingQuality' from 'depthai_sdk' (<path>/lib/python3.11/site-packages/depthai_sdk/__init__.py)
Sentry is attempting to send 1 pending error messages
Waiting up to 2 seconds

I saw this issue and am guessing I need to install that specific version of depthai_sdk in the requirements.txt file. When I try running
python3 -m pip install -r requirements.txt

it just freezes at the point:

Building wheel for depthai (pyproject.toml) ...

My guess is that it is something to do with the way I have installed depthai. I had to install it from x86 MacOS wheels (please see this post for more details). But am not sure if these two are connected.

Please could someone let me know how to resolve this?

Best,
AB

Hi erik

Many thanks for the reply.

Actually I wanted to save a sequence of pointcloud data as a video. I see that the example mentions that we can save it as MCAP recording. But it also mentions that depth frame is converted to pointcloud on the host.

Just want to know is there a way to record pointcloud computed on the Oak processor ?

Best,
AB

  • erik replied to this.

    erik

    Thanks for the idea.

    Perhaps it could work but I think I am more comfortable to just record the depth images using VideoEncoder, import them in Matlab and use Matlab's pcfromdepth to estimate the point cloud on host. But then it looks like the pcfromdepth function requires the depth correction/scaling factor. I don't think I have come across this anywhere in the Luxonis documentation. Is there such a correction factor for the OAK-D Pro (which I am using)?

    Best,
    AB

    • erik replied to this.

      erik

      Thanks for that. I had come across that example and know how to get the intrinsics, but Matlab seems to ask for another scalar parameter called depth scaling/correction factor. See the second input for pcfromdepth function. This is what I am not sure about.

      Best,
      AB

      • erik replied to this.

        abhanupr I am not sure why I am searching their docs for you - but the answer is 1, depth map is in mm.

          erik

          Thank you for all the help. I will let you know how it goes.

          Best,
          AB