https://github.com/zivid/zivid-csharp-samples
Code samples for the usage of a Zivid 3D camera in C#
https://github.com/zivid/zivid-csharp-samples
csharp samples zivid
Last synced: 2 months ago
JSON representation
Code samples for the usage of a Zivid 3D camera in C#
- Host: GitHub
- URL: https://github.com/zivid/zivid-csharp-samples
- Owner: zivid
- License: bsd-3-clause
- Created: 2019-06-04T06:54:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-11-28T15:06:12.000Z (4 months ago)
- Last Synced: 2025-11-30T21:08:42.802Z (4 months ago)
- Topics: csharp, samples, zivid
- Language: C#
- Homepage:
- Size: 23.8 MB
- Stars: 6
- Watchers: 8
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# C\# samples
This repository contains csharp code samples for Zivid SDK v2.17.2. For
tested compatibility with earlier SDK versions, please check out
[accompanying
releases](https://github.com/zivid/zivid-csharp-samples/tree/master/../../releases).

---
*Contents:*
[**Tutorials**](#Tutorials-list) |
[**Samples**](#Samples-list) |
[**Installation**](#Installation) |
[**Support**](#Support) |
[**License**](#License)
---
## Tutorials list
- [QuickCaptureTutorial](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/QuickCaptureTutorial.md)
- [CaptureTutorial](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/CaptureTutorial.md)
- [PointCloudTutorial](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/PointCloudTutorial.md)
## Samples list
There are two main categories of samples: **Camera** and
**Applications**. The samples in the **Camera** category focus only on
how to use the camera. The samples in the **Applications** category use
the output generated by the camera, such as the 3D point cloud, a 2D
image or other data from the camera. These samples shows how the data
from the camera can be used.
- **Camera**
- **Basic**
- [Capture](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/Capture/Capture.cs) - Capture colored point cloud, save 2D image, save 3D ZDF,
and export PLY, using the Zivid camera.
- [CaptureFromFileCamera](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/CaptureFromFileCamera/CaptureFromFileCamera.cs) - Capture point clouds, with color, with the Zivid file
camera.
- [CaptureHDRCompleteSettings](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/CaptureHDRCompleteSettings/CaptureHDRCompleteSettings.cs) - Capture point clouds, with color, from the Zivid camera
with fully configured settings.
- [CaptureWithSettingsFromYML](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Basic/CaptureWithSettingsFromYML/CaptureWithSettingsFromYML.cs) - Capture images and point clouds, with and without color,
from the Zivid camera with settings from YML file.
- **Advanced**
- [CaptureAndPrintNormals](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Advanced/CaptureAndPrintNormals/CaptureAndPrintNormals.cs) - Capture Zivid point clouds, compute normals and print a
subset.
- [CaptureHalconViaGenICam](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Advanced/CaptureHalconViaGenICam/CaptureHalconViaGenICam.cs) - Capture and save a point cloud, with colors, using GenICam
interface and Halcon C++ SDK.
- [CaptureHalconViaZivid](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Advanced/CaptureHalconViaZivid/CaptureHalconViaZivid.cs) - Capture a point cloud, with colors, using Zivid SDK,
transform it to a Halcon point cloud and save it using
Halcon C++ SDK.
- **InfoUtilOther**
- [AutomaticNetworkConfigurationForCameras](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/AutomaticNetworkConfigurationForCameras/AutomaticNetworkConfigurationForCameras.cs) - \* Automatically configure the IP addresses of connected
cameras to match the network of the user's PC.
- [CameraInfo](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/CameraInfo/CameraInfo.cs) - List connected cameras and print camera version and state
information for each connected camera.
- [CameraUserData](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/CameraUserData/CameraUserData.cs) - Store user data on the Zivid camera.
- [CaptureWithDiagnostics](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/CaptureWithDiagnostics/CaptureWithDiagnostics.cs) - Capture point clouds, with color, from the Zivid camera,
with settings from YML file and diagnostics enabled.
- [FirmwareUpdater](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/FirmwareUpdater/FirmwareUpdater.cs) - Update firmware on the Zivid camera.
- [FrameInfo](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/FrameInfo/FrameInfo.cs) - Read frame info from the Zivid camera.
- [GetCameraIntrinsics](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/GetCameraIntrinsics/GetCameraIntrinsics.cs) - Read intrinsic parameters from the Zivid camera (OpenCV
model) or estimate them from the point cloud.
- [MeasureSceneConditions](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/MeasureSceneConditions/MeasureSceneConditions.cs) - Measure ambient light conditions in the scene and output
the measured flickering frequency of the ambient light if
flickering is detected.
- [NetworkConfiguration](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/NetworkConfiguration/NetworkConfiguration.cs) - Uses Zivid API to change the IP address of the Zivid
camera.
- [Warmup](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/InfoUtilOther/Warmup/Warmup.cs) - Short example of a basic way to warm up the camera with
specified time and capture cycle.
- **Maintenance**
- [CorrectCameraInField](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Maintenance/CorrectCameraInField/CorrectCameraInField.cs) - Correct the dimension trueness of a Zivid camera.
- [ResetCameraInField](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Maintenance/ResetCameraInField/ResetCameraInField.cs) - Reset infield correction on a camera.
- [VerifyCameraInField](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Maintenance/VerifyCameraInField/VerifyCameraInField.cs) - Check the dimension trueness of a Zivid camera.
- [VerifyCameraInFieldFromZDF](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Camera/Maintenance/VerifyCameraInFieldFromZDF/VerifyCameraInFieldFromZDF.cs) - Check the dimension trueness of a Zivid camera from a ZDF
file.
- **Applications**
- **Basic**
- **Visualization**
- [CaptureFromFileCameraVis3D](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Basic/Visualization/CaptureFromFileCameraVis3D/CaptureFromFileCameraVis3D.cs) - Capture point clouds, with color, with the Zivid file
camera and visualize them.
- [CaptureVis3D](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Basic/Visualization/CaptureVis3D/CaptureVis3D.cs) - Capture point clouds, with color, from the Zivid
camera, and visualize them.
- [ProjectImageStartAndStop](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Basic/Visualization/ProjectImageStartAndStop/ProjectImageStartAndStop.cs) - Start the Image Projection and Stop it.
- **FileFormats**
- [ReadIterateZDF](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Basic/FileFormats/ReadIterateZDF/ReadIterateZDF.cs) - Read point cloud data from a ZDF file, iterate through
it, and extract individual points.
- [ZDF2PLY](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Basic/FileFormats/ZDF2PLY/ZDF2PLY.cs) - Convert point cloud from a ZDF file to a PLY file.
- **Advanced**
- [Downsample](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/Downsample/Downsample.cs) - Downsample point cloud from a ZDF file.
- [HandEyeCalibration](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/HandEyeCalibration/HandEyeCalibration/HandEyeCalibration.cs) - Perform Hand-Eye calibration.
- [MultiCameraCalibration](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/MultiCameraCalibration/MultiCameraCalibration.cs) - Use captures of a calibration object to generate
transformation matrices to a single coordinate frame.
- [ReadProjectAndCaptureImage](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/ReadProjectAndCaptureImage/ReadProjectAndCaptureImage.cs) - Read a 2D image from file and project it using the camera
projector.
- [ROIBoxViaArucoMarker](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/ROIBoxViaArucoMarker/ROIBoxViaArucoMarker.cs) - Filter the point cloud based on a ROI box given relative
to the ArUco marker on a Zivid Calibration Board.
- [ROIBoxViaCheckerboard](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/ROIBoxViaCheckerboard/ROIBoxViaCheckerboard.cs) - Filter the point cloud based on a ROI box given relative
to the Zivid Calibration Board.
- [StitchContinuouslyRotatingObject](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/StitchContinuouslyRotatingObject/StitchContinuouslyRotatingObject.cs) - Stitch point clouds from a continuously rotating object
without pre-alignment using Local Point Cloud Registration
and apply Voxel Downsample.
- [StitchUsingRobotMountedCamera](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/StitchUsingRobotMountedCamera/StitchUsingRobotMountedCamera.cs) - Stitch multiple point clouds captured with a robot mounted
camera.
- [StitchViaLocalPointCloudRegistration](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/StitchViaLocalPointCloudRegistration/StitchViaLocalPointCloudRegistration.cs) - Stitch two point clouds using a transformation estimated
by Local Point Cloud Registration and apply Voxel
Downsample.
- [TransformPointCloudFromMillimetersToMeters](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/TransformPointCloudFromMillimetersToMeters/TransformPointCloudFromMillimetersToMeters.cs) - Transform point cloud data from millimeters to meters.
- [TransformPointCloudViaArucoMarker](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/TransformPointCloudViaArucoMarker/TransformPointCloudViaArucoMarker.cs) - Transform a point cloud from camera to ArUco marker
coordinate frame by estimating the marker's pose from the
point cloud.
- [TransformPointCloudViaCheckerboard](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/TransformPointCloudViaCheckerboard/TransformPointCloudViaCheckerboard.cs) - Transform a point cloud from camera to checkerboard (Zivid
Calibration Board) coordinate frame by getting checkerboard
pose from the API.
- **HandEyeCalibration**
- [PoseConversions](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/HandEyeCalibration/PoseConversions/PoseConversions.cs) - Convert to/from Transformation Matrix (Rotation Matrix
+ Translation Vector)
- [UtilizeHandEyeCalibration](https://github.com/zivid/zivid-csharp-samples/tree/master/source/Applications/Advanced/HandEyeCalibration/UtilizeHandEyeCalibration/UtilizeHandEyeCalibration.cs) - Transform single data point or entire point cloud from
camera to robot base reference frame using Hand-Eye
calibration
## Installation
1. [Install Zivid
Software](https://support.zivid.com/latest//getting-started/software-installation.html)
2. [Download Zivid Sample
Data](https://support.zivid.com/latest//api-reference/samples/sample-data.html)
Launch the Command Prompt by pressing `Win` + `R` keys on the keyboard,
then type `cmd` and press `Enter`.
Navigate to a location where you want to clone the repository, then run
to following command:
``` sourceCode bat
git clone https://github.com/zivid/zivid-csharp-samples
```
Open ZividNETSamples.sln in Visual Studio, build it and run it. If you
are uncertain about doing this, check out [Build C\# Samples using
Visual
Studio](https://support.zivid.com/latest/api-reference/samples/csharp/build-c-sharp-samples-using-visual-studio.html).
Some of the samples depend on external libraries, in particular
`MathNet.Numerics` and `System.ValueTuple`. These libraries will be
installed automatically through NuGet when building the sample.
## Support
For more information about the Zivid cameras, please visit our
[Knowledge Base](https://support.zivid.com/latest). If you run into any
issues please check out
[Troubleshooting](https://support.zivid.com/latest/support/troubleshooting.html).
## License
Zivid Samples are distributed under the [BSD
license](https://github.com/zivid/zivid-csharp-samples/tree/master/LICENSE).