the main_zerowaste.py was used in ZeroWaste, but is probably superceded by the main_IMDO, which was used for Isabel's research. A lot of code was changed when working on Isabel's project.
This only works on windows, since Zivid only works on windows.
PROCESSING PCDs DOES NOT WORK ON MAC, currently if any other packages are installed with open3d we get a seg fault on Mac.
Basically, just use this one Windows machine...
export only explictly downloaded packages:
conda env export --from-history --name ziv281_cfab270 > environment.yml
create new from environment.yml file:
conda env create
make sure .pre-commit-config.yaml file is up to date
language_version: python (use system version of python)
run this: pre-commit install
in .vscode/settings.json make sure formatonsave = TRUE
zivid-python-samples version:
- working with old branch 7090186 (which is from around December 2022)
- link to github
- Major changes to sample_utils after, deleted TransformationMatrix object
- Probably an easy fix using zivid.Matrix4x4 object in save_load_matrix, but that changed too...
- annoying since new save_load_matrix.py needs a running instance of Zivid :: Application
- don't have time to fix it, so keep old code for now...
version: Working for SDK V2.6.1, as of April, 2022
About version 2.7 (need to update still): https://blog.zivid.com/sdk-2.7-preserve-the-details-in-your-point-clouds?utm_campaign=software&utm_medium=email&_hsmi=217086722&_hsenc=p2ANqtz-_ICS7K6EMNJlBN-M5Ul41QWuTe80zmZiisC4dljNtvQbqMnPRfgvocFtiyan01y9MzoD19lY1DPjNzsUy1KsLA2aOfig&utm_content=217087514&utm_source=hs_email
note: when upgrading to SDK V2.7 need to update the capture settings .yml from Settings::Processing::Color::Experimental::ToneMapping::Enabled
to Settings::Processing::Color::Experimental::Mode
as per https://support.zivid.com/latest/reference-articles/settings/processing-settings/tone-mapping.html?hsLang=en
note: when upgrading 50 SKD V2.8.1, the zivid2 no longer works through USB. Works fine through ethernet, but then have to change the network settings from the robot control setup. Works if just using the camera, but how will it work with robot control?
Zivid provides example code from the following repos:
Repo | Folder |
---|---|
https://github.com/zivid/zivid-python | Samples |
https://github.com/zivid/zivid-python-samples | Source |
Note that at the time of writing, the code in zivid-python-samples repo is just a more comprehensive set of code than what is provided in the samples folder in zivid-python repo. So can probably ignore the samples folder provided in the zivid-python repo, but check this to make sure...
WARNING: DO NOT MAKE CHANGES TO ZIVID BASE CODE SAMPLES
The code in this repo extends the functionality of the sample code provided by Zivid. Some functions we use will rely on their code base, which we will keep updated as new versions are released. The idea is to keep their code as a "template" for our own implementation. If we need to make any changes to their provided code, make a copy, reference where it came from (so can update easier), and save our own version in this repo.
WARNING: DO NOT MAKE CHANGES TO ZIVID BASE CODE SAMPLES
To use the provided Zivid code modules as imports to new code, ensure the source code location is added to the PYTHONPATH environment variable. This will ensure that python module imports work.
Suggest the following steps:
- Clone the https://github.com/zivid/zivid-python-samples repo
- Add the source code folder to the PYTHONPATH
- Read section 3.6 in the following link: https://docs.python.org/3/using/windows.html
- in command line: echo %PYTHONPATH% (will be empty if the variable is not set)
- to add temporarily to current shell: set PYTHONPATH=%PYTHONPATH%;C:\new\path\to\source\code
- to add permanently: go through System Properties, Environment Variables, Edit or Add New (need to restart shell to see changes)
- downside of permanent method is that all versions on python will refer to this folder, so make sure this won't cause any issues
- Test that this works, should now be able to import any of the modules in the source folder. Reference from source as top folder.
- For example: from sample_utils.paths import get_sample_data_path
- for example: import applications.basic.file_formats.convert_zdf
https://github.com/zivid/zivid-python/tree/master/modules/zivid
Class/Name | Description | Members | Summary | Use in Code |
---|---|---|---|---|
Application | manager class for Zivid | create_file_camera, connect_camera, cameras, release | ||
Calibration | calibration features, such as HandEye and MultiCamera | HandEyeInput, HandEyeResidual, HandEyeOutput | ||
Camera | interface to one Zivid camera, but only to access | capture, info, state, connect, disconnect, write_user_data, user_data, release | ||
Camera_Info | contains information about camera hardware and firmware | firmware_version, model_name, serial_number, revision, user_data, firmware_version, | ||
:Revision | major, minor | |||
:UserData | ||||
Camera_State | extract information from internal function of Zivid camera, such as temperature or lens info | available, connected | ||
:Temperature | dmd, general, led, lens, pcb | |||
Capture_Assistant | ambient_light_frequency, max_capture_time, _convert_to_internal, suggest_settings | |||
Frame | contains the point cloud, stored on compute device memory | point_cloud, save, load, release | ||
Frame_2D | contains a 2D image as well as metadata | image_rgba, settings, state, info, release | ||
Frame_Info | core, time_stamp, software_version | |||
Image | A two-dimensional image stored on the host | height, width, save, copy_data, release | ||
PointCloud | Point cloud with x, y, z, RGB and color laid out on a 2D grid | height, width, release | ||
SDK_Version | get the version of the loaded library | |||
Settings | Acquisition, Processing, Color, Balance, Color, Filters, Noise, Smoothing, Gaussian, Experimental, ContrastDistortion, Correction, Removal, Reflection, Settings, Outlier, Brightness, Aperture, ExposureTime, Gain, ContrastDistortion, Enabled, Strength, Threshold, | |||
:Acquisition | ||||
Settings2D | Acquisition, Processing, Color, Balance |
Class/Name | Description | Members | Summary | Source Code |
---|---|---|---|---|
hand_eye.py | implementation of hand-eye calibration functionality | https://github.com/zivid/zivid-python/blob/master/modules/zivid/_calibration/hand_eye.py | ||
detector.py | implementation of feature point detection functionality | https://github.com/zivid/zivid-python/blob/master/modules/zivid/_calibration/detector.py |