{"id":14978044,"url":"https://github.com/pieye/nimbus-python","last_synced_at":"2025-10-30T23:22:08.679Z","repository":{"id":46899558,"uuid":"202147591","full_name":"pieye/nimbus-python","owner":"pieye","description":"nimbus python bindings","archived":false,"fork":false,"pushed_at":"2021-09-21T20:43:05.000Z","size":83,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T12:45:27.774Z","etag":null,"topics":["python","raspberry-pi","tof-camera"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pieye.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}},"created_at":"2019-08-13T13:11:29.000Z","updated_at":"2024-07-24T13:42:05.000Z","dependencies_parsed_at":"2022-08-27T00:40:32.341Z","dependency_job_id":null,"html_url":"https://github.com/pieye/nimbus-python","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieye%2Fnimbus-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieye%2Fnimbus-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieye%2Fnimbus-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pieye%2Fnimbus-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pieye","download_url":"https://codeload.github.com/pieye/nimbus-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238614444,"owners_count":19501458,"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":["python","raspberry-pi","tof-camera"],"created_at":"2024-09-24T13:56:46.290Z","updated_at":"2025-10-28T07:31:14.923Z","avatar_url":"https://github.com/pieye.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./assets/PIEYE_Logo_RGB_POS.png\" align=\"right\"\n     title=\"pieye logo\" width=\"184\" height=\"55\"\u003e\n\n# nimbus-python\nPython bindings for nimbus. These bindings are ment for a remote connection (raspberry to a desktop machine).\n\n# Quick start\n\nThe following snippet connects to the raspberry and gets image data.\n\n```python\nfrom nimbusPython import NimbusClient\ncli = NimbusClient.NimbusClient(\"192.168.0.69\")\nheader, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)\n```\n\n# Installation\n\nnimbus-python uses websockets, which requires python 3.6 or higher!\n```\npip install nimbus-python\n```\n\n# Prerequisites\nDownload the current image from https://cloud.pieye.org/index.php/s/c2QSa6P4wBtSJ4K which contains nimbus-userland and all necessary linux drivers.\n\n# Getting image data\n\nThe following snippet connects to the raspberry and gets the image data.\n\n```python\nfrom nimbusPython import NimbusClient\ncli = NimbusClient.NimbusClient(\"192.168.0.69\")\nheader, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)\n```\n\nThe matrices x,y,z represent a point cloud. Those can be visualized by:\n- mayavi (https://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html#mayavi.mlab.points3d),\n- matplotlib (https://matplotlib.org/mpl_toolkits/mplot3d/tutorial.html#scatter-plots)\n- any other plotting library\n\nThe matrices have the following meaning\n\n| Matrix  |  Explanation  |\n| ------- | ------------- |\n| ampl    | signal strength of each pixel |\n| radial  | radial distance of each pixel to the camera center |\n| x,y,z   | 3D Point cloud |\n| conf    | confidence information of each pixel (valid, underexposured, saturated, asymmetric) |\n\nYou can change the exposure of the Nimbus 3D. By default,  auto exposure with HDR is activated. If there is a lot of movement, it may be necessary to disable HDR and use the normal auto exposure. However, it is also possible to set the exposure time manually with and without HDR.The following snippet contains the possible configurations.\n\n```python\n# automatic exposure \ncli.setExposureMode(NimbusClient.AUTO_HDR)\ncli.setExposureMode(NimbusClient.AUTO)\ncli.setAmplitude(1000)  #\u003c-- to change the desired amplitude (0 - ~5000)\n\n# manual exposure \ncli.setExposureMode(NimbusClient.MANUAL_HDR)\ncli.setExposureMode(NimbusClient.MANUAL)\ncli.setExposure(5000)  #\u003c-- to change the exposure time (0 - 65535)\n```\n\nIf you are interested in the amount of valid, under exposured etc. pixels, you can use the following snippet as an example.\n\n```python\nheader, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)\nnumUnderExposured = len(conf[conf==NimbusClient.ConfUnderExposured])\nnumOverExposured = len(conf[conf==NimbusClient.ConfOverExposured])\nnumAsymmetric = len(conf[conf==NimbusClient.ConfAsymmetric])\nnumValid = len(conf[conf==NimbusClient.ConfValid])\n```\n\nBased on this information you probably want to change the illumination time (increase the illumination in case of many underexposured pixels):\n\n```python\nrv, data = cli.getExposure()\nif rv == 0:\n    # increase illumination time by 10%\n    newExposure = int(data[\"exposure\"] + data[\"exposure\"]*0.1)\n    rv = cli.setExposure(newExposure)\n    assert rv==0\n```\n\nThe illumination time can have any value between 0 and 65535.\n\nSimilarily if you want to decrease the number of frames taken by the camera, you can set a framerate value (0 means no pause at end of frame, 65535 means maximum pause at end of frame)\n```python\n# fast acquisition\nrv = cli.setFramerate(0)\nassert rv==0\n# slow acquisition\nrv = cli.setFramerate(65535)\nassert rv==0\n```\n\n# Enable raw data\n\nTo enable raw data streaming, you can use the following code snippet.\n```python\nfrom nimbusPython import NimbusClient\nimport time\ncli = NimbusClient.NimbusClient(\"192.168.0.69\")\ncli.setExposureMode(NimbusClient.MANUAL)\ncli.setExposure(5000)  #\u003c-- to change the exposure time (0 - 65535)\ncli.enaRawMode(True)\ntime.sleep(1) #\u003c-- there might be still some 3D images in the pipeline\nheader, img = cli.getImage()\nimgType = int(header[NimbusClient.HeaderImgType])\nif imgType == NimbusClient.NimbusImageRaw:\n    print (\"raw images received\")\nelse:\n    print (\"something went wrong...\")\n    #-\u003e repeat image readout (cli.getImage())\n```\n\n\n# Authors\nMarkus Proeller\n\nSee also the list of contributors who participated in this project.\n\n# License\nThis project is licensed under the GPLv3 License - see the LICENSE file for details\n\n# 3rd party libraries\nWe use the following 3rd party libraries:\n \n- websockets (BSD 3-Clause \"New\" or \"Revised\" License), see https://github.com/aaugustin/websockets\n- requests (Apache V2.0 License), see https://github.com/psf/requests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpieye%2Fnimbus-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpieye%2Fnimbus-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpieye%2Fnimbus-python/lists"}