{"id":15065608,"url":"https://github.com/elerac/easypyspin","last_synced_at":"2025-05-11T04:56:48.129Z","repository":{"id":48081502,"uuid":"224398798","full_name":"elerac/EasyPySpin","owner":"elerac","description":"cv2.VideoCapture like wrapper for FLIR Spinnaker SDK","archived":false,"fork":false,"pushed_at":"2023-06-27T13:10:14.000Z","size":137,"stargazers_count":103,"open_issues_count":4,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-11T04:56:18.192Z","etag":null,"topics":["flir-cameras","opencv","python","spinnaker","spinnaker-sdk"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elerac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-11-27T09:55:33.000Z","updated_at":"2025-04-24T08:34:50.000Z","dependencies_parsed_at":"2024-09-29T11:45:22.288Z","dependency_job_id":"db2a170c-0ec0-493d-8599-31ca464a8b5b","html_url":"https://github.com/elerac/EasyPySpin","commit_stats":{"total_commits":139,"total_committers":2,"mean_commits":69.5,"dds":0.2517985611510791,"last_synced_commit":"cab699b70840112f2b54441b3e85b00387ff6e25"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elerac%2FEasyPySpin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elerac%2FEasyPySpin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elerac%2FEasyPySpin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elerac%2FEasyPySpin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elerac","download_url":"https://codeload.github.com/elerac/EasyPySpin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518967,"owners_count":21921083,"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":["flir-cameras","opencv","python","spinnaker","spinnaker-sdk"],"created_at":"2024-09-25T00:43:02.541Z","updated_at":"2025-05-11T04:56:48.102Z","avatar_url":"https://github.com/elerac.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EasyPySpin\n\nEasyPySpin is an unofficial wrapper for FLIR [Spinnaker SDK](https://www.flir.com/products/spinnaker-sdk/). This wrapper provides much the same way as the OpenCV VideoCapture class.\n\n## Requirement\n* PySpin\n    * Download Spinnaker SDK from [here](https://www.flir.com/support-center/iis/machine-vision/downloads/spinnaker-sdk-and-firmware-download/).\n* OpenCV\n\n## Installation\n```sh\npip install EasyPySpin\n```\nAfter installation, connect the camera and try [examples/video.py](examples/video.py).\n\n## Usage\n### Capture image from camera\nHere's an example to capture image from camera. \n```python\nimport cv2\nimport EasyPySpin\n\ncap = EasyPySpin.VideoCapture(0)\n\nret, frame = cap.read()\n\ncv2.imwrite(\"frame.png\", frame)\n    \ncap.release()\n```\n\n### Basic property settings\nYou can access properties using `cap.set(propId, value)` or `cap.get(propId)`. See also [supported propId](#Supported-VideoCaptureProperties).\n```python\ncap.set(cv2.CAP_PROP_EXPOSURE, 100000) # us\ncap.set(cv2.CAP_PROP_GAIN, 10) # dB\n\nwidth  = cap.get(cv2.CAP_PROP_FRAME_WIDTH)\nheight = cap.get(cv2.CAP_PROP_FRAME_HEIGHT)\n```\n\n### Advanced property settings\n`cap.set()` and `cap.get()` can only access basic properties. To access advanced properties, you can use QuickSpin API, which PySpin supports.\n```python\ncap.cam.AdcBitDepth.SetValue(PySpin.AdcBitDepth_Bit12)\ncap.cam.PixelFormat.SetValue(PySpin.PixelFormat_Mono16)\n```\nThe other way is to use `cap.set_pyspin_value()` or `cap.get_pyspin_value()`, which are supported by EasyPySpin. These methods check whether the variable is writeable or readable and check the type of the variable, etc., at the same time.\n```python\ncap.set_pyspin_value(\"AdcBitDepth\", \"Bit12\")\ncap.set_pyspin_value(\"PixelFormat\", \"Mono16\")\n\ncap.get_pyspin_value(\"GammaEnable\")\ncap.get_pyspin_value(\"DeviceModelName\")\n```\n\n## Supported VideoCaptureProperties\nHere is the list of supported VideoCaptureProperties. \nIn `set(propId, value)` and `get(propId)`, PySpin is used to set and get the camera's settings. The relationship between `propId` and PySpin settings is designed to be as close in meaning as possible. The table below shows the relationship between `propId` and PySpin settings in pseudo-code format.\n\n| propId                     | type  | set(propId, value) | value = get(propId) |\n| ----                       | ----  | ----        | ----        |\n| cv2.CAP_PROP_FRAME_WIDTH   | int   | `Width` = value | value = `Width` |\n| cv2.CAP_PROP_FRAME_HEIGHT  | int   | `Height` = value | value = `Height` |\n| cv2.CAP_PROP_FPS           | float | `AcquisitionFrameRateEnable` = `True` \u003cbr\u003e  `AcquisitionFrameRate` = value | value = `AcquisitionResultingFrameRate`| \n| cv2.CAP_PROP_BRIGHTNESS    | float | `AutoExposureEVCompensation` = value | value = `AutoExposureEVCompensation` |\n| cv2.CAP_PROP_GAIN          | float | if value != -1 \u003cbr\u003e \u0026nbsp; `GainAuto` = `Off` \u003cbr\u003e \u0026nbsp; `Gain` = value \u003cbr\u003e else \u003cbr\u003e \u0026nbsp; `GainAuto` = `Continuous` | value = `Gain` |\n| cv2.CAP_PROP_EXPOSURE      | float | if value != -1 \u003cbr\u003e \u0026nbsp; `ExposureAuto` = `Off` \u003cbr\u003e \u0026nbsp; `ExposureTime` = value \u003cbr\u003e else \u003cbr\u003e \u0026nbsp; `ExposureAuto` = `Continuous` | value = `ExposureTime` |\n| cv2.CAP_PROP_GAMMA         | float | `GammaEnable` = `True` \u003cbr\u003e `Gamma` = value | value = `Gamma` |\n| cv2.CAP_PROP_TEMPERATURE   | float | | value = `DeviceTemperature` |\n| cv2.CAP_PROP_TRIGGER       | bool  | if value == `True` \u003cbr\u003e \u0026nbsp; `TriggerMode` = `On` \u003cbr\u003e else \u003cbr\u003e \u0026nbsp; `TriggerMode` = `Off` | if trigger_mode == `On` \u003cbr\u003e \u0026nbsp; value = `True` \u003cbr\u003e elif trigger_mode == `Off` \u003cbr\u003e \u0026nbsp; value = `False` |\n| cv2.CAP_PROP_TRIGGER_DELAY | float | `TriggerDelay` = value | value = `TriggerDelay` | \n| cv2.CAP_PROP_BACKLIGHT     | bool  | if value == `True` \u003cbr\u003e \u0026nbsp; `DeviceIndicatorMode` = `Active` \u003cbr\u003e else \u003cbr\u003e \u0026nbsp; `DeviceIndicatorMode` = `Inactive` | if device_indicator_mode == `Active` \u003cbr\u003e \u0026nbsp; value = `True` \u003cbr\u003e elif device_indicator_mode == `Inactive` \u003cbr\u003e \u0026nbsp; value = `False` |\n| cv2.CAP_PROP_AUTO_WB       | bool  | if value == `True` \u003cbr\u003e \u0026nbsp; `BalanceWhiteAuto` = `Continuous` \u003cbr\u003e else \u003cbr\u003e \u0026nbsp; `BalanceWhiteAuto` = `Off` | if balance_white_auto == `Continuous` \u003cbr\u003e \u0026nbsp; value = `True` \u003cbr\u003e elif balance_white_auto == `Off` \u003cbr\u003e \u0026nbsp; value = `False` |\n\n## Command-Line Tool\nEasyPySpin provides a command-line tool. Connect the camera and execute the following commands, as shown below, then you can view the captured images.\n```sh\nEasyPySpin [-h] [-i INDEX] [-e EXPOSURE] [-g GAIN] [-G GAMMA]\n           [-b BRIGHTNESS] [-f FPS] [-s SCALE]\n```\n\n## External Links\nHere are some external links that are useful for using Spinnaker SDK.\n* [Spinnaker® SDK Programmer's Guide and API Reference (C++)](http://softwareservices.ptgrey.com/Spinnaker/latest/index.html)\n* [Getting Started with Spinnaker SDK on MacOS Applicable products](https://www.flir.com/support-center/iis/machine-vision/application-note/getting-started-with-spinnaker-sdk-on-macos/)\n* [Spinnaker Nodes](https://www.flir.com/support-center/iis/machine-vision/application-note/spinnaker-nodes/)\n* [Configuring Synchronized Capture with Multiple Cameras](https://www.flir.com/support-center/iis/machine-vision/application-note/configuring-synchronized-capture-with-multiple-cameras)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felerac%2Feasypyspin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felerac%2Feasypyspin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felerac%2Feasypyspin/lists"}