使用Visual Studio构建C#示例
介绍
本教程展示了如何在Windows的Visual Studio中使用Zivid C++ API构建C#示例项目。
要求
可选要求
一些示例依赖于外部库,特别是:
说明
下面的屏幕截图提供了分步说明。
克隆C#示例
如需克隆我们的GitHub Zivid C# Samples 存储库,请通过按键盘上的 Win + R 键启动命令提示符,然后键 入 cmd
并按 Enter。

导航到要克隆存储库的位置(必须安装 Git):
cd C:\Users\Public\Downloads
然后运行以下命令:
git clone https://github.com/zivid/zivid-csharp-samples
安装额外的依赖项
根据您要运行的示例程序安装所需的依赖项,详见下表。
示例程序 |
MathNet.Numerics |
System.ValueTuple |
UtilizeHandEyeCalibration |
是 |
否 |
位姿转换 |
是 |
否 |
ROIBoxViaCheckerboard |
是 |
否 |
ROIBoxViaArucoMarker |
是 |
否 |
AutomaticNetworkConfigurationForCameras |
否 |
是 |
可以使用 Visual Studio 中的 NuGet 包管理器安装 MathNet.Numerics 和 System.ValueTuple 库。如果您允许 NuGet 下载缺失的包,则这些包将自动安装。
或者,您可以使用命令行界面通过在包管理器控制台中键入以下内容来安装它们:
MathNet.Numerics:
Install-Package MathNet.Numerics
System.ValueTuple:
Install-Package System.ValueTuple
构建解决方案
在Visual Studio中打开ZividNETSamples.sln。
将构建配 置 Debug 更改为 Release。
点击 Ctrl + Shift + B 构建解决方案。

运行示例程序
导航到文件资源管理器中的Release文件夹。

运行一个示例程序,例如CaptureVis3D.exe
