markit-realsense-recorder


Namemarkit-realsense-recorder JSON
Version 1.8.2 PyPI version JSON
download
home_page
SummaryRealsense remote recorder
upload_time2023-04-21 18:50:10
maintainer
docs_urlNone
authordavidliyutong
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

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

### From PyPi

```shell
python -m pip install markit-realsense-recorder
```

## Usage

### Script Usage

```python
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:

```shell
python -m realsense_recorder configure
```

To launch a remote record station that supports REST API

```shell
python -m realsense_recorder serve
```

To launch a remote record station that is calibrated 
```shell
python -m realsense_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 running `python -m realsense_recorder calibrate`

To run calibration

```shell
python -m realsense_recorder calibrate
```

To run post-processing

```shell
python -m realsense_recorder post_process --base_dir path/to/recording
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "markit-realsense-recorder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "davidliyutong",
    "author_email": "davidliyutong@sjtu.edu.cn",
    "download_url": "https://files.pythonhosted.org/packages/a5/63/977700b0e4ade64e054e5ab6870dbaa3bb601165bc6b7b5a3306c9618c1f/markit-realsense-recorder-1.8.2.tar.gz",
    "platform": null,
    "description": "# RealsenseRecorder\n\nA 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)\n\n## Installation\n\n### From Source\n\n```shell\ngit clone https://github.com/mvig-robotflow/rfimu-realsense-recorder\ncd rfimu-realsense-recorder\npython setup.py\n```\n\n### From PyPi\n\n```shell\npython -m pip install markit-realsense-recorder\n```\n\n## Usage\n\n### Script Usage\n\n```python\nimport io\n\nimport cv2\nimport numpy as np\nimport yaml\nfrom realsense_recorder.common import new_realsense_camera_system_from_config, RealsenseSystemModel\n\ncfg_str = \"\"\"\nrealsense:\n  cameras:\n  - color:\n    - exposure: -1\n      format: rs.format.bgra8\n      fps: 30\n      height: 1080\n      width: 1920\n    depth: [] # Do not user depth \n    endpoint: {}\n    imu: []\n    product_id: 0B64 # 0B64 for L515\n    product_line: L500 # Currently supported models are L500(L515) and D400(D435)\n    ref: 1\n    sn: f0220485 # SN of target Camera, can get from RealSenseViewer\n  system:\n    base_dir: ./realsense_data\n    frame_queue_size: 100\n    interactive: false\n    interval_ms: 0\n    use_bag: false\n\"\"\"\n\n\ndef main():\n    cfg = yaml.load(io.StringIO(cfg_str), yaml.SafeLoader)\n    sys = new_realsense_camera_system_from_config(RealsenseSystemModel, cfg['realsense'], None)\n    print(sys.cameras)\n    cam = sys.cameras[0]\n    cam.open()\n    cam.start()\n    mtx = np.array(cam.intrinsics_matrix)\n    while True:\n        color_image, depth_image, ts, sys_ts, frame_counter = cam.get_frames()\n        cv2.imshow(\"frame\", color_image)\n        key = cv2.waitKey(1)\n        if key == 27:\n            print('esc break...')\n            cv2.destroyAllWindows()\n            break\n\nmain()\n```\n\n### Command Line Usage\n\nTo Create and persist record configuration:\n\n```shell\npython -m realsense_recorder configure\n```\n\nTo launch a remote record station that supports REST API\n\n```shell\npython -m realsense_recorder serve\n```\n\nTo launch a remote record station that is calibrated \n```shell\npython -m realsense_recorder serve --calibration=path/to/calibration\n```\n\n> Note: The calibration.json file is expected to be in the `path/to/calibration` directory. The calibration file can be generated by running `python -m realsense_recorder calibrate`\n\nTo run calibration\n\n```shell\npython -m realsense_recorder calibrate\n```\n\nTo run post-processing\n\n```shell\npython -m realsense_recorder post_process --base_dir path/to/recording\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Realsense remote recorder",
    "version": "1.8.2",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "596bf53c123beab52d64ffa8a7aeb713ae82f2cf34438814dc47f422e6315cc2",
                "md5": "e388f446fa0364707ed84d8fe03aba52",
                "sha256": "77267ccd73a2a75d0501aa7d4c38887de8b885af7486d5fc11517f4592383e43"
            },
            "downloads": -1,
            "filename": "markit_realsense_recorder-1.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e388f446fa0364707ed84d8fe03aba52",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 28019,
            "upload_time": "2023-04-21T18:50:09",
            "upload_time_iso_8601": "2023-04-21T18:50:09.003751Z",
            "url": "https://files.pythonhosted.org/packages/59/6b/f53c123beab52d64ffa8a7aeb713ae82f2cf34438814dc47f422e6315cc2/markit_realsense_recorder-1.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a563977700b0e4ade64e054e5ab6870dbaa3bb601165bc6b7b5a3306c9618c1f",
                "md5": "0827c0d16b2747ec2ca571836ad28157",
                "sha256": "42105f77ac69c58eb484a51786de8ce15fbf67b27d28790c8a7912053d09454b"
            },
            "downloads": -1,
            "filename": "markit-realsense-recorder-1.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0827c0d16b2747ec2ca571836ad28157",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 23044,
            "upload_time": "2023-04-21T18:50:10",
            "upload_time_iso_8601": "2023-04-21T18:50:10.800861Z",
            "url": "https://files.pythonhosted.org/packages/a5/63/977700b0e4ade64e054e5ab6870dbaa3bb601165bc6b7b5a3306c9618c1f/markit-realsense-recorder-1.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-21 18:50:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "markit-realsense-recorder"
}
        
Elapsed time: 0.07922s