Skip to content

Commit

Permalink
Update C# samples for SDK 2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
csu-bot-zivid authored and chrisasc committed Jun 17, 2022
1 parent bf50ecb commit ec22591
Show file tree
Hide file tree
Showing 42 changed files with 817 additions and 234 deletions.
4 changes: 0 additions & 4 deletions .gitignore

This file was deleted.

27 changes: 16 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ image or other data from the camera. These samples shows how the data
from the camera can be used.

- **Camera**
- **Basic** ([quick tutorial](source/Camera/Basic/QuickCaptureTutorial.md) / [complete tutorial](source/Camera/Basic/CaptureTutorial.md))
- **Basic**
- [Capture](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/Capture/Capture.cs) - Capture point clouds, with color, from the Zivid camera.
- [Capture2D](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/Capture2D/Capture2D.cs) - Capture 2D images from the Zivid camera.
- [CaptureFromFileCamera](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/CaptureFromFileCamera/CaptureFromFileCamera.cs) - Capture point clouds, with color, from the Zivid file
camera.
- [CaptureAssistant](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/CaptureAssistant/CaptureAssistant.cs) - Use Capture Assistant to capture point clouds, with color,
from the Zivid camera.
- [CaptureFromFileCamera](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/CaptureFromFileCamera/CaptureFromFileCamera.cs) - Capture point clouds, with color, from the Zivid file
camera.
- [CaptureHDR](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Basic/CaptureHDR/CaptureHDR.cs) - Capture point clouds, with color, from the Zivid 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.
Expand All @@ -49,13 +49,18 @@ from the camera can be used.
find a compromise.
- [CaptureHDRPrintNormals](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/Advanced/CaptureHDRPrintNormals/CaptureHDRPrintNormals.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**
- [PrintVersionInfo](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/InfoUtilOther/PrintVersionInfo/PrintVersionInfo.cs) - List connected cameras and print version information.
- [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).
- [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.
- [CameraUserData](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/InfoUtilOther/CameraUserData/CameraUserData.cs) - Store user data on 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).
- [PrintVersionInfo](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/InfoUtilOther/PrintVersionInfo/PrintVersionInfo.cs) - List connected cameras and print version information.
- [Warmup](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Camera/InfoUtilOther/Warmup/Warmup.cs) - A basic warm-up method for a Zivid camera with specified
time and capture cycle.
- **Applications**
Expand All @@ -68,17 +73,17 @@ from the camera can be used.
- **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 a file to a PLY file.
- [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.
- [TransformPointCloudFromMillimetersToMeters](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Applications/Advanced/TransformPointCloudFromMillimetersToMeters/TransformPointCloudFromMillimetersToMeters.cs) - Transform point cloud data from millimeters to meters.
- **HandEyeCalibration**
- [HandEyeCalibration](https://github.com/zivid/zivid-csharp-samples/tree/master//source/Applications/Advanced/HandEyeCalibration/HandEyeCalibration/HandEyeCalibration.cs) - Perform Hand-Eye calibration.
- [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 frame to robot base frame using 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.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion source/Applications/Advanced/Downsample/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ static void Main()
Console.WriteLine("Connecting to camera");
var camera = zivid.ConnectCamera();

var inputs = readHandEyeInputs(camera);
var handEyeInput = readHandEyeInputs(camera);

var calibrationResult = performCalibration(inputs);
var calibrationResult = performCalibration(handEyeInput);

if(calibrationResult.Valid())
{
Console.WriteLine("{0}\n{1}\n{2}", "Hand-eye calibration OK", "Result:", calibrationResult);
Console.WriteLine("{0}\n{1}\n{2}", "Hand-Eye calibration OK", "Result:", calibrationResult);
}
else
{
Console.WriteLine("Hand-eye calibration FAILED");
Console.WriteLine("Hand-Eye calibration FAILED");
Environment.ExitCode = 1;
}
}
Expand Down Expand Up @@ -61,12 +61,12 @@ static List<HandEyeInput> readHandEyeInputs(Zivid.NET.Camera camera)
using(var frame = Interaction.AssistedCapture(camera))
{
Console.Write("Detecting checkerboard in point cloud: ");
var result = Detector.DetectFeaturePoints(frame.PointCloud);
var detectionResult = Detector.DetectFeaturePoints(frame.PointCloud);

if(result)
if(detectionResult)
{
Console.WriteLine("OK");
handEyeInput.Add(new HandEyeInput(robotPose, result));
handEyeInput.Add(new HandEyeInput(robotPose, detectionResult));
++currentPoseId;
}
else
Expand Down Expand Up @@ -129,7 +129,7 @@ public static void ExtendInputBuffer(int size)

public static CommandType EnterCommand()
{
Console.Write("Enter command, p (to add robot pose) or c (to perform calibration): ");
Console.Write("Enter command, p (to add robot pose) or c (to perform calibration):");
var command = Console.ReadLine().ToLower();

switch(command)
Expand Down
7 changes: 4 additions & 3 deletions source/Applications/Advanced/HandEyeCalibration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following applications creates a **Transformation Matrix** from data provide

[ZividHandEyeCalibration][ZividHandEyeCalibration-url]

* CLI application which takes a collection of pose pairs (e.g. output of steps i.-iii. in [HandEyeCalibration][HandEyeCalibration-url]) and returns a **Transformation Matrix**. This application comes with the Windows installer and is part of tool deb for Ubuntu.
* [CLI application][CLI application-url] which takes a collection of pose pairs (e.g. output of steps i.-iii. in [HandEyeCalibration][HandEyeCalibration-url]) and returns a **Transformation Matrix**. This application comes with the Windows installer and is part of the tools deb for Ubuntu.

-----------------
The following applications assume that a **Transformation Matrix** has been found
Expand All @@ -31,5 +31,6 @@ The following applications assume that a **Transformation Matrix** has been foun

[HandEyeCalibration-url]: HandEyeCalibration/HandEyeCalibration.cs
[UtilizeHandEyeCalibration-url]: UtilizeHandEyeCalibration/UtilizeHandEyeCalibration.cs
[ZividHandEyeCalibration-url]: https://support.zivid.com/academy/applications/hand-eye/zivid_CLI_tool_for_hand_eye_calibration.html
[Tutorial-url]: https://support.zivid.com/academy/applications/hand-eye.html
[ZividHandEyeCalibration-url]: https://support.zivid.com/latest/academy/applications/hand-eye/hand-eye-calibration-process.html
[Tutorial-url]: https://support.zivid.com/academy/applications/hand-eye.html
[CLI application-url]: https://support.zivid.com/latest/academy/applications/hand-eye/zivid_CLI_tool_for_hand_eye_calibration.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
2 changes: 1 addition & 1 deletion source/Applications/Basic/FileFormats/ZDF2PLY/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,4 @@ echo Unsupported config
exit /B 1
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,4 @@ echo Unsupported config
exit /B 1
</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit ec22591

Please sign in to comment.