markit-rs-recorder


Namemarkit-rs-recorder JSON
Version 2.0.0 PyPI version JSON
download
home_page
SummaryRealsense remote recorder
upload_time2023-04-22 02:15:20
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/rfimarkit-rs-recorder
cd rfimarkit-rs-recorder
python setup.py
```

### From PyPi

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

## Usage

### Script Usage

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

```shell
python -m markit_rs_recorder configure
```

To launch a remote record station that supports REST API

```shell
python -m markit_rs_recorder serve
```

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

To run calibration

```shell
python -m markit_rs_recorder calibrate
```

To run post-processing

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "markit-rs-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/42/d5/7c8cd9203dfc14cb24227d30c2b697e4901470a8826bf71521128fcce41b/markit-rs-recorder-2.0.0.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/rfimarkit-rs-recorder\ncd rfimarkit-rs-recorder\npython setup.py\n```\n\n### From PyPi\n\n```shell\npython -m pip install markit-rs-recorder\n```\n\n## Usage\n\n### Script Usage\n\n```python\nimport io\n\nimport cv2\nimport numpy as np\nimport yaml\nfrom markit_rs_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\n\nmain()\n```\n\n### Command Line Usage\n\nTo Create and persist record configuration:\n\n```shell\npython -m markit_rs_recorder configure\n```\n\nTo launch a remote record station that supports REST API\n\n```shell\npython -m markit_rs_recorder serve\n```\n\nTo launch a remote record station that is calibrated \n```shell\npython -m markit_rs_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 markit_rs_recorder calibrate\n```\n\nTo run post-processing\n\n```shell\npython -m markit_rs_recorder post_process --base_dir path/to/recording\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Realsense remote recorder",
    "version": "2.0.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39c49e8a1874b513ddcc93bf84534204246a58c314f0c2b3d45228fb127b6229",
                "md5": "ceef848899eabac12f6adaa1811f0fde",
                "sha256": "2654383caf47a70a89501d1351099e88a0266fd316ac556718dbec388acb31e7"
            },
            "downloads": -1,
            "filename": "markit_rs_recorder-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ceef848899eabac12f6adaa1811f0fde",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 27984,
            "upload_time": "2023-04-22T02:15:19",
            "upload_time_iso_8601": "2023-04-22T02:15:19.325954Z",
            "url": "https://files.pythonhosted.org/packages/39/c4/9e8a1874b513ddcc93bf84534204246a58c314f0c2b3d45228fb127b6229/markit_rs_recorder-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "42d57c8cd9203dfc14cb24227d30c2b697e4901470a8826bf71521128fcce41b",
                "md5": "a3bbffb63e7f1449622bb21c1c377b12",
                "sha256": "54638480a36bc3e1e0ae3891c265c2cc4ecbf14989ec564480e2756f28b471c1"
            },
            "downloads": -1,
            "filename": "markit-rs-recorder-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a3bbffb63e7f1449622bb21c1c377b12",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 24229,
            "upload_time": "2023-04-22T02:15:20",
            "upload_time_iso_8601": "2023-04-22T02:15:20.961753Z",
            "url": "https://files.pythonhosted.org/packages/42/d5/7c8cd9203dfc14cb24227d30c2b697e4901470a8826bf71521128fcce41b/markit-rs-recorder-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-22 02:15:20",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "markit-rs-recorder"
}
        
Elapsed time: 0.06913s