Skip to main content

RealsenseRecorder

A set of Python scripts to operate Intel Realsense Cameras. By using multi-thread techniques, this script can record color + depth from up to 4 Realsense Cameras (2 x L515 and 2 x D435)

Installation

From Source

git clone https://github.com/mvig-robotflow/rfimu-realsense-recorder
cd rfimu-realsense-recorder
python setup.py

From PyPi

python -m pip install realsense-recorder

Usage

Script Usage

import io

import cv2
import numpy as np
import yaml
from realsense_recorder.common import new_realsense_camera_system_from_config, RealsenseSystemModel

cfg_str = """
realsense:
  cameras:
  - color:
    - exposure: -1
      format: rs.format.bgra8
      fps: 30
      height: 1080
      width: 1920
    depth: [] # Do not user depth 
    endpoint: {}
    imu: []
    product_id: 0B64 # 0B64 for L515
    product_line: L500 # Currently supported models are L500(L515) and D400(D435)
    ref: 1
    sn: f0220485 # SN of target Camera, can get from RealSenseViewer
  system:
    base_dir: ./realsense_data
    frame_queue_size: 100
    interactive: false
    interval_ms: 0
    use_bag: false
"""


def main():
    cfg = yaml.load(io.StringIO(cfg_str), yaml.SafeLoader)
    sys = new_realsense_camera_system_from_config(RealsenseSystemModel, cfg['realsense'], None)
    print(sys.cameras)
    cam = sys.cameras[0]
    cam.open()
    cam.start()
    mtx = np.array(cam.intrinsics_matrix)
    while True:
        color_image, depth_image, ts, sys_ts, frame_counter = cam.get_frames()
        cv2.imshow("frame", color_image)
        key = cv2.waitKey(1)
        if key == 27:
            print('esc break...')
            cv2.destroyAllWindows()
            break

main()

Command Line Usage

To Create and persist record configuration:

python -m realsense-recorder configure

To launch a remote record station that supports REST API

python -m realsense-recorder run --app=remote_record_seq

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

realsense-recorder-1.4.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

realsense_recorder-1.4-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file realsense-recorder-1.4.tar.gz.

File metadata

  • Download URL: realsense-recorder-1.4.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for realsense-recorder-1.4.tar.gz
Algorithm Hash digest
SHA256 0a47d457b67f064e60886a47ac7c359e361ea749d35eeab3ece0ebce51ae6801
MD5 215a6079452d61b3b0febb9db976d496
BLAKE2b-256 3b509b16ec3a71e8c3c44d036fcce53555dd5bdf9b8969129b7739fb104bef49

See more details on using hashes here.

File details

Details for the file realsense_recorder-1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for realsense_recorder-1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4c3a569bafd4bd764942c68366ccd0ff7493723eba25dff55664abdcc5c9ee4f
MD5 d66a580d0fac7230d2a7a1bef6575c08
BLAKE2b-256 13bab788bbba3625daf7e74e8183ac4a228279352c7815dc2c6758045c7a3a1c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page