• process recorded data from Oak-D without access to Oak-D

I have access to Oak-D POE camera for a limited time and unable to analyze the effect of different filters and settings on depth data in real-time. So I want to record aligned color and depth videos once and process those videos afterwards even if I have no access to Oak-D Poe camera. By process, I mean to apply different filters (median, temporal, hole-filling etc.)

How can I record such aligned rgb-d videos and how can I replay them for processing/filtering?

    Hi asif
    You could use the SDK to record multiple inputs. Examples should point you in the right direction. I'd suggest recording everything you need into a mcap or rosbag, which you can then recreate when testing.

    More documentation.

    Hope this helps,
    Jaka

    • asif replied to this.

      @jakaskerl I get the following error while running rosbag_record.py

      oak.record([left.out.encoded, right.out.encoded, stereo.out.depth, imu], 'records', record_type=RecordType.DB3)

      raise AttributeError(name) from None

      AttributeError: DB3

      I get the following error while running mcap_record.py

      from mcap.mcap0.writer import Writer as McapWriter

      ModuleNotFoundError: No module named 'mcap.mcap0'

      This example looks suitable to solve the problem but I get the following error:

      ImportError: cannot import name 'EncodingQuality' from 'depthai_sdk' (/home/tface/.local/lib/python3.10/site-packages/depthai_sdk/init.py)

      Can you please help to resolve this issue?

        Hi asif
        Could you update to the latest version of depthai_sdk please?

        Thanks,
        Jaka

        • asif replied to this.

          jakaskerl I uninstalled the previous version and pip install depthai-sdk==1.10.1

          But it doesn't solve the problem.

          runfile('/media/tface/Disk/Projects/depthai/depthai-experiments/gen2-record-replay/record.py', wdir='/media/tface/Disk/Projects/depthai/depthai-experiments/gen2-record-replay')

          Reloaded modules: depthai_sdk.oak_outputs, depthai_sdk.oak_outputs.xout, depthai_sdk.oak_outputs.fps, depthai_sdk.oak_outputs.xout.xout_base, depthai_sdk.components.component, depthai_sdk.classes.nn_results, depthai_sdk.classes.packets, depthai_sdk.classes, depthai_sdk.classes.enum, depthai_sdk.components.camera_helper, depthai_sdk.components.parser, depthai_sdk.recorders, depthai_sdk.recorders.abstract_recorder, depthai_sdk.recorders.video_recorder, depthai_sdk.recorders.video_writers.base_writer, depthai_sdk.recorders.video_writers.utils, depthai_sdk.recorders.video_writers.av_writer, depthai_sdk.recorders.video_writers.file_writer, depthai_sdk.recorders.video_writers.video_writer, depthai_sdk.recorders.video_writers, depthai_sdk.visualize.configs, depthai_sdk.visualize.bbox, depthai_sdk.visualize.encoder, depthai_sdk.visualize.visualizer_helper, depthai_sdk.visualize.objects, depthai_sdk.visualize.visualizer, depthai_sdk.visualize, depthai_sdk.oak_outputs.xout.xout_frames, depthai_sdk.oak_outputs.xout.xout_h26x, depthai_sdk.oak_outputs.xout.xout_mjpeg, depthai_sdk.readers, depthai_sdk.readers.abstract_reader, depthai_sdk.utils, depthai_sdk.replay, depthai_sdk.components.camera_control, depthai_sdk.components.camera_component, depthai_sdk.classes.yolo_config, depthai_sdk.classes.nn_config, depthai_sdk.integrations, depthai_sdk.integrations.roboflow, depthai_sdk.types, depthai_sdk.components.multi_stage_nn, depthai_sdk.components.nn_helper, depthai_sdk.components.undistort, depthai_sdk.oak_outputs.xout.xout_depth, depthai_sdk.oak_outputs.xout.xout_disparity, depthai_sdk.components.stereo_control, depthai_sdk.components.stereo_component, depthai_sdk.oak_outputs.syncing, depthai_sdk.oak_outputs.xout.xout_seq_sync, depthai_sdk.visualize.colors, depthai_sdk.oak_outputs.xout.xout_nn, depthai_sdk.oak_outputs.xout.xout_nn_encoded, depthai_sdk.tracking.kalman, depthai_sdk.tracking, depthai_sdk.oak_outputs.xout.xout_tracker, depthai_sdk.components.nn_component, depthai_sdk.oak_outputs.xout.xout_imu, depthai_sdk.components.imu_component, depthai_sdk.components, depthai_sdk.args_parser, depthai_sdk.logger, depthai_sdk.trigger_action.actions.abstract_action, depthai_sdk.trigger_action.actions.record_action, depthai_sdk.trigger_action.actions, depthai_sdk.trigger_action.triggers.abstract_trigger, depthai_sdk.trigger_action.triggers.detection_trigger, depthai_sdk.trigger_action.triggers, depthai_sdk.trigger_action.trigger_action, depthai_sdk.trigger_action, depthai_sdk.record, depthai_sdk.classes.output_config, depthai_sdk.oak_device, depthai_sdk.oak_camera, depthai_sdk.previews, depthai_sdk

          Traceback (most recent call last):

          File ~/.local/lib/python3.10/site-packages/spyder_kernels/py3compat.py:356 in compat_exec

          exec(code, globals, locals)

          File /media/tface/Disk/Projects/depthai/depthai-experiments/gen2-record-replay/record.py:16

          from depthai_sdk import Record, EncodingQuality

          ImportError: cannot import name 'EncodingQuality' from 'depthai_sdk' (/media/tface/Disk/Projects/depthai/depthai/depthai_sdk/src/depthai_sdk/init.py)

          Oh, sorry, didn't realize it was an experiment script. The script is running on sdk==1.2.3. You should install the requirements from requirements.txt before running it.

          Thanks,
          Jaka

          • asif replied to this.

            jakaskerl

            After following installation instructions on https://docs.luxonis.com/projects/api/en/latest/install/ and installing requiremtns, still I get the same error. ImportError: cannot import name 'EncodingQuality' from 'depthai_sdk' (/home/tface/.local/lib/python3.10/site-packages/depthai_sdk/init.py)

            Can I use the same experiment without using "EncodingQuality"? For example, we can replace "checkQuality" by a constant (what is that constant?) in the following line:

            parser.add_argument('-q', '--quality', default="HIGH", type=checkQuality, help='Selects the quality of the recording. Default: %(default)s')

            While running https://github.com/luxonis/depthai/blob/main/depthai_sdk/examples/recording/stereo_record.py, it can visualize color and depth streams but cannot write to disk due to the following error. Even after pip install av, it cannot write to disk.

            import av as av

            ModuleNotFoundError: No module named 'av'

            @asif

            python -m pip install av
            # Or, install depthai-sdk version that includes recording;
            python -m pip install depthai-sdk[record]