Working with 3D-Cameras of Automation Technology in CVB

POINT CLOUD RECONSTRUCTION

It is important to understand that all 3D Sensors from AT output uncalibrated 2D range maps with no relation to real world units. However, it is possible to easily get calibrated metric 3D points by applying a number of calibration parameters to this range map.

Getting the calibration parameters

When using an AT Compact Sensor (CS) these calibration parameters are previously calculated by the manufacturer and provided together with the camera. They are stored on the sensor’s memory and can be downloaded in a calibration file (.dat, .xml) with the manufacturer’s cxExplorer software (DeviceLoad/Save Calibration Metric… ).

Alternatively, it is possible to download the parameters in the .dat format programmatically from the camera using CVB:

Load Calibration File from AT camera (cvb.NET)
      // load driver
      Device camera = DeviceFactory.Open("GenICam.vin");
      NodeMap cameraNodeMap = camera.NodeMaps[NodeMapNames.Device];

      // get calibration file from camera
      var files = cameraNodeMap.GetAvailableFiles();
      if (files.Contains("UserData"))
        cameraNodeMap.DownloadFile("CalibrationFile.dat", "UserData");

When using a modular AT camera setup a user has to manually perform a calibration in order to get these parameters. In this case the CVB Metric Tool (part of the Foundation package) can be used. Please refer to the specific calibration post or the CVB documentary for further information.

Reconstructing Point Cloud

With the acquired rangemap and the matching calibration parameters it is possible to reconstruct the metrically correct 3D points. This can be done either with one of the existing GUI tutorials from CVB (e.g. VBCore3D) or programmatically in CVB:

Sample Code: Classic API (C#)
// load calibration file
Cvb.SharedCalibrator calibrator = null;
if (Cvb.Core3D.LoadCalibrator(fileName, out calibrator) < 0)
    MessageBox.Show("Error loading calibration file");
else
{
    // reconstruct point cloud
    Cvb.SharedComposite pointCloud = null;
    Cvb.Core3D.CreateCalibratedPointCloudFromRangeMap(rangeMap, calibrator, out pointCloud);
}
Sample Code: ObjectOriented Wrapper (CVBPy)
// load calibration file
calibrator = cvb.Calibrator3D(fileName)

// reconstruct point cloud
pointCloud = cvb.PointCloudFactory.create(rangeMap,calibrator, cvb.PointCloudFlags.Float)
3 Likes