Skip to main content

Zivid Python

Zivid Python is the official Python package for Zivid 3D cameras. Read more about Zivid at zivid.com.

Build Status PyPI Package Zivid Image


Contents: Installation | Quick Start | Examples | Versioning | License | Support | Test Matrix


Installation

Dependencies

Ubuntu users must install Python headers (apt install python3-dev) in addition to the regular python3 package.

Windows users also needs to make sure that the Zivid SDK installation folder is in system PATH before using the package, not only the terminal PATH variable. The default install location that should be added to system PATH is C:\Program Files\Zivid\bin.

Installing official version from PyPI using PIP

After having installed the latest Zivid SDK, the easiest way to install Zivid Python is to use PIP to fetch the latest official version from PyPI:

pip install zivid

Note:

If you don't use the latest Zivid SDK version you need to manually specify the version. See Versioning.

Installation may take some time since the setup.py script will download additional dependencies and compile C++ source code in the background.

On some systems Python 3 pip is called pip3. In this guide we assume it is called pip. When using PIP version 19 or higher build dependencies are handled automatically.

Old PIP

If you are using a version of PIP older than version 19 please manually install the dependencies listed in pyproject.toml before installing zivid.

pip install <packages listed in pyproject.toml>
pip install zivid

Installing from source

git clone <zivid-python clone URL>
cd zivid-python
pip install .

The above pip install . command may give permission issues on some Windows machines. If so, try the following instead:

python continuous-integration/windows/create_binary_distribution.py
pip install ./dist/*.whl

You may want to build Zivid Python against a different (but compatible) version of Zivid SDK. An example would be if Zivid SDK 2.1 was released but the official Zivid Python still formally only supports SDK 2.0. Since all the features of the 2.0 API exist in the 2.1 API, Zivid Python can still be built with the new SDK (but without wrapping the latest features). In order to achieve this, edit sdk_version.json to target the new SDK version before doing pip install .. Note that this option is considered experimental/unofficial.

Quick Start

Point cloud capture

To quickly capture a point cloud using default settings, run the following code:

import zivid

app = zivid.Application()
camera = app.connect_camera()
settings = zivid.Settings(
    acquisitions=[zivid.Settings.Acquisition()],
    color=zivid.Settings2D(acquisitions=[zivid.Settings2D.Acquisition()]),
)
frame = camera.capture_2d_3d(settings)
frame.save("result.zdf")

Instead of using the API to define capture settings, it is also possible to load them from YML files that have been exported from Zivid Studio or downloaded from the Zivid Knowledge Base settings library. This can be done by providing the filesystem path to such a file, for example:

settings = Settings.load("ZividTwo_Settings_2xHDR_Normal.yml")
frame = camera.capture_2d_3d(settings)

Point cloud data access

Data can easily be accessed in the form of Numpy arrays:

import zivid

app = zivid.Application()
camera = app.connect_camera()
settings = zivid.Settings(
    acquisitions=[zivid.Settings.Acquisition()],
    color=zivid.Settings2D(acquisitions=[zivid.Settings2D.Acquisition()]),
)
frame = camera.capture_2d_3d(settings)
xyz = frame.point_cloud().copy_data("xyz")  # Get point coordinates as [Height,Width,3] float array
rgba = frame.point_cloud().copy_data("rgba")  # Get point colors as [Height,Width,4] uint8 array
bgra = frame.point_cloud().copy_data("bgra")  # Get point colors as [Height,Width,4] uint8 array

Capture Assistant

Instead of manually adjusting settings, the Capture Assistant may be used to find the optimal settings for your scene:

import zivid

app = zivid.Application()
camera = app.connect_camera()
capture_assistant_params = zivid.capture_assistant.SuggestSettingsParameters()
settings = zivid.capture_assistant.suggest_settings(camera, capture_assistant_params)
frame = camera.capture_2d_3d(settings)
frame.save("result.zdf")

Using camera emulation

If you do not have a camera, you can use the FileCameraZivid2M70.zfc file in the Sample Data to emulate a camera.

import zivid

app = zivid.Application()
camera = app.create_file_camera("path/to/FileCameraZivid2M70.zfc")
settings = zivid.Settings(acquisitions=[zivid.Settings.Acquisition()])
frame = camera.capture_3d(settings)
frame.save("result.zdf")

Examples

Basic example programs can be found in the samples directory. Many more advanced example programs may be found in the separate zivid-python-samples repository.

Versioning

This python module is released with the same version number as the Zivid SDK that it supports. The Zivid SDK is using semantic versioning with major, minor, and patch versions.

If a patch is released to fix an issue with this python module separately from a Zivid SDK patch release, then a fourth number signifying the patch version of the python module will be added to the end:

Version breakdown

                              Zivid SDK version = 2.16.0
                              v vv v
Zivid Python module version = 2.16.0.1
                                     ^
                                     Zivid Python module patch version (omitted if 0)

[!NOTE] Versioning Prior to 2.16.0

Before version 2.16.0, this python module used a similar but different versioning scheme with six numbers. In this scheme, the first three numbers specified the semantic version of the python module while the next three numbers specified the semantic version of the supported Zivid SDK. In some early versions of the python module, these semantic versions could be different, but eventually they were synced up, and from version 2.16.0 the versioning system was simplified as explained above.

PyPI

When installing using PIP it is possible to specify the required version. This can be useful if using an older version of the Zivid SDK.

To see the complete list of released versions of this python module, see zivid-python-releases-url or run pip index versions zivid.

Note that as explained above, the versioning system was simplified starting with version 2.16.0 such that the Zivid Python is the same as the supported Zivid SDK version. Older releases used a different versioning scheme, which is also explained above.

Install latest version of Zivid Python using latest available version of Zivid SDK

pip install zivid

Note: The installation may fail if the latest available version of Zivid SDK is not installed on the system. See Installation.

Install a specific version of Zivid Python

pip install zivid==2.16.0

This requires Zivid SDK version 2.16.0 to be installed on the system.

Using the old versioning scheme, install version 2.6.0 of the Zivid Python wrapper supporting Zivid SDK 2.7.0

pip install zivid==2.6.0.2.7.0

This requires Zivid SDK version 2.7.0 to be installed on the system.

License

This project is licensed, see the LICENSE file for details. The licenses of dependencies are listed license dependencies.

Support

Please visit Zivid Knowledge Base for general information on using Zivid 3D cameras. If you cannot find a solution to your issue, please contact customersuccess@zivid.com.

Test matrix

The test matrix shows which Python versions and operating systems are tested in CI. Check text matrix here to go to the test matrix.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zivid-2.18.0.1.tar.gz (158.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zivid-2.18.0.1-cp314-cp314-win_amd64.whl (985.1 kB view details)

Uploaded CPython 3.14Windows x86-64

zivid-2.18.0.1-cp313-cp313-win_amd64.whl (962.7 kB view details)

Uploaded CPython 3.13Windows x86-64

zivid-2.18.0.1-cp312-cp312-win_amd64.whl (962.8 kB view details)

Uploaded CPython 3.12Windows x86-64

zivid-2.18.0.1-cp311-cp311-win_amd64.whl (950.0 kB view details)

Uploaded CPython 3.11Windows x86-64

zivid-2.18.0.1-cp310-cp310-win_amd64.whl (948.6 kB view details)

Uploaded CPython 3.10Windows x86-64

zivid-2.18.0.1-cp39-cp39-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.9Windows x86-64

zivid-2.18.0.1-cp38-cp38-win_amd64.whl (948.0 kB view details)

Uploaded CPython 3.8Windows x86-64

zivid-2.18.0.1-cp37-cp37m-win_amd64.whl (923.0 kB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file zivid-2.18.0.1.tar.gz.

File metadata

  • Download URL: zivid-2.18.0.1.tar.gz
  • Upload date:
  • Size: 158.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1.tar.gz
Algorithm Hash digest
SHA256 1e1c631a805c074acfdd334418cc64fa04a2cdb35c9b142b251d360c152fbf6d
MD5 fa754aaa10040f06125b01d04dd83622
BLAKE2b-256 fb09d389232d32f4ea8ec1fc052ff4ca4ce5bb38d5d6f7190f0c307880aab8c6

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 985.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 81e245066c7924048c26037d0ea507884658241cd08feecef0fb7f722a1e293f
MD5 9512bfa5938124b7b69bac94eb915133
BLAKE2b-256 121f97eba08279fd60a850e415c8941d278de389cb5ac773464cb3acafd1ac28

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 962.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 31caf59ee742ab7e6b6f1206ff5e7f0c90a3734223759572222f62096dd12dd4
MD5 9579a69c2268850087e5a2545fe624cb
BLAKE2b-256 6e6924b15762ce16ec1c68e0ddec90732dbbd97ab095a5371bbbcc343df24a59

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 962.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9e6eca1212e34498e677e9f504e142ca07e50a3d391714ecbbf51ae386ab9cc8
MD5 1500e2928e2adecd698f64659cb4ab6e
BLAKE2b-256 49655712e7282ecdd95d5d38927d3e1f08f8c77c961ed82991ff654fc7927324

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 950.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 13477df79ef06bc8da3649ba966a6927f7675909ad9a1b70d9a71380b278e7ba
MD5 d92e38782d3186a0983f0ca34065c06c
BLAKE2b-256 e698ea7f37ae44e1e0c9057d0c4166b8e4e36dbc42e11d1f11907141f2674121

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 948.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 a929bb6bc8c6ff9a3166f3a60453befecaedd91e99f20c616dc183a3f6d1dc17
MD5 b0fc89249647a9d3d87978ae9952f5cf
BLAKE2b-256 625f91f15e1ca395c61f4822c498c1894beb81d11bbd39bb8b94aa1dc4f698b7

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 46fffea8a7cddf1a2df8ce38d06836a631ff6f93f4fddfe8834e67eef756b6f7
MD5 ae601085d1fd252d9f5243f03ef80d01
BLAKE2b-256 49016d93af83250094ae5ef31e2f896d65b3db5c884befc6a1f735fdefdd9d18

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 948.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 411067caafccebeffa1ef757d78b6b0e0fb74a03fc2598de075132be765124c2
MD5 0db7276cd77724d905dfef6df720fdad
BLAKE2b-256 daa7406c1bc8c547049d0ff932a93f5af59c6712b60c8548d37f18ad3d214717

See more details on using hashes here.

File details

Details for the file zivid-2.18.0.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: zivid-2.18.0.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 923.0 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for zivid-2.18.0.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7e8acb8d25f66d5d894e72900607f64890741f932418a4e42ef6bfd5e18d8db8
MD5 846ea4175f393a4b2508efcc3c00b98e
BLAKE2b-256 bc5d9e76024b0ed62061ebfd02074176bbe263e763099d1c672d95b48efaeebc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page