Realsense remote recorder
Project description
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/rfimarkit-rs-recorder
cd rfimarkit-rs-recorder
python setup.py
From PyPi
python -m pip install markit-rs-recorder
Usage
Script Usage
import io
import cv2
import numpy as np
import yaml
from markit_rs_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 markit_rs_recorder configure
To launch a remote record station that supports REST API
python -m markit_rs_recorder serve
To launch a remote record station that is calibrated
python -m markit_rs_recorder serve --calibration=path/to/calibration
Note: The calibration.json file is expected to be in the
path/to/calibration
directory. The calibration file can be generated by runningpython -m realsense_recorder calibrate
To run calibration
python -m markit_rs_recorder calibrate
To run post-processing
python -m markit_rs_recorder post_process --base_dir path/to/recording
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file markit-rs-recorder-2.0.0.tar.gz
.
File metadata
- Download URL: markit-rs-recorder-2.0.0.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54638480a36bc3e1e0ae3891c265c2cc4ecbf14989ec564480e2756f28b471c1 |
|
MD5 | a3bbffb63e7f1449622bb21c1c377b12 |
|
BLAKE2b-256 | 42d57c8cd9203dfc14cb24227d30c2b697e4901470a8826bf71521128fcce41b |
File details
Details for the file markit_rs_recorder-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: markit_rs_recorder-2.0.0-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2654383caf47a70a89501d1351099e88a0266fd316ac556718dbec388acb31e7 |
|
MD5 | ceef848899eabac12f6adaa1811f0fde |
|
BLAKE2b-256 | 39c49e8a1874b513ddcc93bf84534204246a58c314f0c2b3d45228fb127b6229 |