How to get a Zivid Pointcloud into CVB

This topic will show you how to work with a pointcloud acquired by a ZividOne+ sensor in CVB in C#.
To do this I created a DLL containing functions to directly convert a Zivid-pointcloud to a CVB-pointcloud.

CVBZividLib.zip (479.9 KB)

To use the functionality of the DLL you need also need to add ZividCoreNet.dll and ZividVis3DNET.dll as well Stemmer.Cvb.dll to your references.

Get a Zivid.NET.Frame by acquiring a snapshot with your Zivid sensor or load a saved *.zdf-file frome your harddisc. Information on how to use the ZividSDK can be found here.

After you received you Zivid.NET.Frame you have multiple options with the CVBZividLib.dll. There are multiple functions to get a color image, intensity image and of course a Stemmer.Cvb.Pointcloud from the Zivid.NET.Frame.

An example code on basic functionalitiy on the DLL will be added soon.

3 Likes

A short example on how to get a CVB Pointcloud after capturing a Frame with the ZividOne+ in C#:

static void Main()
  {
    //Intialize Components
    var zivid = new Zivid.NET.Application();
    Zivid.NET.Frame zividFrame = new Zivid.NET.Frame();
    Stemmer.Cvb.PointCloud cvbPointCloud = null;

    //Connect to Zivid sensor
    var camera = zivid.ConnectCamera();

    //Capture Frame
    zividFrame = camera.Capture();

    //Convert Zivid Pointcloud to CVB Pointcloud
    cvbPointCloud = zividFrame.ToCVBPointCloud();

    //Save CVB Pointcloud
    Stemmer.Cvb.PointCloudExtensions.Save(cvbPointCloud, "cvbPointCloud.ply");
  }
2 Likes

Note that the CVBZividLib is only compatible with Zivid SDK 1.8.1 and lower.

Using CVB 13.04.000 and Zivid SDK 2.4.0 will allow you to acquire pointclouds over the multipart acquisition interface of CVB using the Zivid GenTL.
Use the following lines of code to acquire a Zivid multipart composite in CVB:

The following references are required:

using Stemmer.Cvb;
using Stemmer.Cvb.Driver;

Use the DeviceFactory discver to access and open the Zivid over the GenTL.

DiscoveryInformationList discovList = DeviceFactory.Discover(DiscoverFlags.IgnoreVins);
Device device = DeviceFactory.Open(discovList[1], AcquisitionStack.GenTL);

Note that using a Zivid One+ the discovery will return two devices. One is the Zivid 3D-Camera and one will be the build in camera ofthe Zivid that should not be used. Zivid Two will be detected as one single device.
To acquire an image create and start a composite stream:

var stream = device.GetStream<CompositeStream>(0);
stream.Start();
Composite imgComposite = stream.Wait(); 
stream.Stop();