{"id":26780945,"url":"https://github.com/christianbator/zed-open-capture-mac","last_synced_at":"2026-01-07T16:45:07.453Z","repository":{"id":272284683,"uuid":"916079094","full_name":"christianbator/zed-open-capture-mac","owner":"christianbator","description":"macOS camera library for the ZED USB3 stereo cameras","archived":false,"fork":false,"pushed_at":"2025-03-19T10:21:57.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T11:29:42.391Z","etag":null,"topics":["stereo-vision","video-capture","zed-camera"],"latest_commit_sha":null,"homepage":"","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christianbator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-13T12:19:49.000Z","updated_at":"2025-03-19T10:22:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a0ef405-4989-4b82-9a70-67758e77e051","html_url":"https://github.com/christianbator/zed-open-capture-mac","commit_stats":null,"previous_names":["christianbator/zed-open-capture-mac"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianbator%2Fzed-open-capture-mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianbator%2Fzed-open-capture-mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianbator%2Fzed-open-capture-mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christianbator%2Fzed-open-capture-mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christianbator","download_url":"https://codeload.github.com/christianbator/zed-open-capture-mac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150514,"owners_count":20731430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["stereo-vision","video-capture","zed-camera"],"created_at":"2025-03-29T07:19:09.130Z","updated_at":"2026-01-07T16:45:07.448Z","avatar_url":"https://github.com/christianbator.png","language":"Objective-C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  ZED Open Capture (macOS)\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA macOS camera and sensor capture API for the \u003ca href=\"https://www.stereolabs.com/products/zed-2\"\u003eZED 2i, ZED 2, and ZED Mini\u003c/a\u003e stereo cameras\u003c/h4\u003e\n\u003ch5 align=\"center\"\u003e*** not compatible with GMSL2 devices: \u003ca href=\"https://www.stereolabs.com/products/zed-x\"\u003eZED X, ZED X Mini, and ZED X One\u003c/a\u003e ***\u003c/h5\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e •\n  \u003ca href=\"#run\"\u003eRun\u003c/a\u003e • \n  \u003ca href=\"#calibration\"\u003eCalibration\u003c/a\u003e •\n  \u003ca href=\"#examples\"\u003eExamples\u003c/a\u003e •\n  \u003ca href=\"#related\"\u003eRelated\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n## Features\n\n- Video data capture\n    - [x] YUV 4:2:2 (native camera format)\n    - [x] Greyscale\n    - [x] RGB (hardware-accelerated conversion)\n    - [x] BGR (hardware-accelerated conversion)\n- Resolution control\n    - [x] HD2K: 2208 x 1242 (15 fps)\n    - [x] HD1080: 1920 x 1080 (15, 30 fps)\n    - [x] HD720: 1280 x 720 (15, 30, 60 fps)\n    - [x] VGA: 672 x 376 (15, 30, 60, 100 fps)\n- Camera info\n    - [x] Name\n    - [x] Unique connection ID\n    - [x] Serial number\n    - [x] Calibration data\n- Camera control\n    - [x] LED on / off\n    - [x] Brightness\n    - [x] Contrast\n    - [x] Hue\n    - [x] Saturation\n    - [x] Sharpness\n    - [ ] Gamma\n    - [ ] Gain\n    - [ ] Exposure\n    - [x] White balance temperature\n    - [x] Auto white balance temperature\n- Sensor data capture\n    - [ ] 6-DOF IMU (3-DOF accelerometer \u0026 3-DOF gyroscope)\n    - [ ] 3-DOF Magnetometer (ZED 2 \u0026 ZED 2i)\n    - [ ] Barometer (ZED 2 \u0026 ZED 2i)\n    - [ ] Temperature (ZED 2 \u0026 ZED 2i)\n    - [ ] Video and sensor data synchronization\n\n### Description\n\nThe ZED Open Capture library is a macOS library for low-level camera and sensor capture for the ZED stereo camera family.\n\nThe library provides methods to access raw video frames, calibration data, camera controls, and raw data from the USB 3 camera sensors. A synchronization mechanism is provided to associate the correct sensor data with a particular video frame.\n\n**Note:** The ZED SDK calibrates all output data, but here you're dealing with raw data. See \u003ca href=\"#calibration\"\u003ecalibration\u003c/a\u003e below for details about downloading and applying the calibration parameters to correct the camera data.\n\n## Install\n\n### Prerequisites\n\n * Stereolabs USB 3 Stereo camera: [ZED 2i](https://www.stereolabs.com/zed-2i/), [ZED 2](https://www.stereolabs.com/zed-2/), [ZED Mini](https://www.stereolabs.com/zed-mini/)\n * macOS (\u003e= 15)\n * Clang (\u003e= 19) (Xcode or Homebrew)\n * CMake (\u003e= 3.31)\n * OpenCV (\u003e= 4.10) (Optional: for examples) \n\n### Install prerequisites\n\n- Install clang via Xcode\n```zsh\nxcode-select -install\n```\n\n- Install clang via Homebrew (optional)\n```zsh\nbrew install llvm\n\n# Add to ~/.zshrc to prefer homebrew clang\nexport PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\nexport CC=$(which clang)\nexport CXX=$(which clang++)\n```\n\n- Install CMake build system\n```zsh\nbrew install cmake\n```\n\n- Install OpenCV to build the examples (optional)\n```zsh\nbrew install opencv\n```\n\n### Clone the repository\n\n```zsh\ngit clone https://github.com/christianbator/zed-open-capture-mac.git\ncd zed-open-capture-mac\n```\n\n### Build the library\n\n```zsh\ncmake -B build\ncmake --build build --parallel\nsudo cmake --install build\n```\n\n### Install the library\n\n```zsh\nsudo cmake --install build\n```\n\n### Uninstall the library\n\n```zsh\nsudo rm -r /opt/stereolabs\n```\n\n## Run\n\n### Video capture\n\nOpen the capture to find an attached ZED camera and initialize USB communcation. This is necessary before using any other methods on the VideoCapture instance:\n```C++\n// Include the header\n#include \"zed_video_capture.h\"\n\n// Create a video capture instance\nVideoCapture videoCapture;\n\n// Open the stream with a color space: YUV, GREYSCALE, RGB, or BGR\n// (resolution defaults to HD2K and 15 fps)\nvideoCapture.open(RGB);\n\n// Alternatively, open the stream with a specified resolution and frame rate\n// (see `zed_video_capture.h` for available resolutions, frame rates, and color spaces)\nvideoCapture.open\u003cHD720, FPS_60\u003e(RGB);\n```\n\nStart the capture to begin processing frames:\n```C++\n// Start the capture, passing a closure or function that's invoked for each frame\nvideoCapture.start([](uint8_t *data, size_t height, size_t width, size_t channels) {\n    //\n    // `data` is an interleaved pixel buffer in the specified color space\n    // `data` is (height * width * channels) bytes long\n    //  \n    // Process `data` here\n    //\n});\n\n// Keep the process alive while processing frames\nwhile (true) {\n    // For example, with OpenCV:\n    cv::waitKey(1);\n}\n```\n\nYou can stop the stream at any point and restart it later:\n```c++\nvideoCapture.stop();\n```\n\nClose the capture when you're done to free resources and release all USB device handles:\n```c++\nvideoCapture.close();\n```\n\nCamera controls with get, set, and reset functionality are available:\n```c++\nuint16_t brightness = videoCapture.getBrightness();\n\nvideoCapture.setBrightness(7);\n\nuint16_t defaultBrightness = videoCapture.getDefaultBrightness();\n\nvideoCapture.resetBrightness();\n```\n\n### Sensor data\n\nTODO...\n\n#### Coordinate system\n\nThe given IMU and magnetometer data are expressed in the coordinate system shown below:\n\n![](images/imu-axis.jpg)\n\n## Calibration\n\nYou can load the factory calibration parameters for your particular camera from the StereoLabs servers using the supplied methods.\n\n```c++\n// Downloads calibration data to ~/.stereolabs/calibration and parses the parameters\nCalibrationData calibrationData = videoCapture.getCalibrationData();\n\n// View the calibration data:\ncout \u003c\u003c calibrationData.toString() \u003c\u003c endl;\n\n// Access parameters by section and key (specify the type: int or float)\nfloat stereoBaseline = calibrationData.get\u003cfloat\u003e(\"STEREO\", \"Baseline\");\ncout \u003c\u003c \"Stereo Baseline = \" \u003c\u003c stereoBaseline \u003c\u003c endl;\n```\n\nYou can also pass a serial number to load the calibration data directly instead of using the convenience method above.\n```c++\nCalibrationData calibrationData;\ncalibrationData.load(\"\u003cDEVICE_SERIAL_NUMBER\u003e\");\n```\n\nSee the calibration example below for details about using the calibration data to rectify video frames.\n\n## Examples\n\nMake sure you've built and installed the library with:\n\n```zsh\ncmake -B build\ncmake --build build --parallel\nsudo cmake --install build\n```\n\nThen you can build the examples with:\n\n```zsh\ncd examples\ncmake -B build\ncmake --build build --parallel\n```\n\nThe following examples are built:\n\n- [video_stream](examples/video_stream.cpp)\n    - Displays the connected ZED camera stream in the desired color space with OpenCV\n    - Usage: `./build/video_stream (yuv | greyscale | rgb | bgr)`\n- [camera_controls](examples/camera_controls.cpp)\n    - Shows how to adjust camera controls and displays the stream with OpenCV\n    - Usage: `./build/camera_controls`\n- [calibration](examples/calibration.cpp)\n    - Shows how to use camera calibration data to rectify frames with OpenCV\n    - Usage: `./build/calibration`\n\n## Related\n\n- [Stereolabs](https://www.stereolabs.com)\n- [ZED SDK](https://www.stereolabs.com/developers/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianbator%2Fzed-open-capture-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristianbator%2Fzed-open-capture-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristianbator%2Fzed-open-capture-mac/lists"}