Load Object-Based Calibration Model

This code snippet shows how to load and use an object-based calibration model.

C++

#include <eVision/Easy3D/Easy3DLaserLine/EObjectBasedCalibrationModel.h>
#include <eVision/Easy3D/Easy3DLaserLine/EObjectBasedCalibrationGenerator.h>
#include <eVision/Easy3D/EDepthMapToPointCloudConverter.h>
using namespace eVision;
using namespace eVision::Easy3D;

// Load the calibration model
EObjectBasedCalibrationModel calib_model;
calib_model.Load("calib.model");

// Load a depth map (captured in the same context)
EDepthMap16 depth_map;
depth_map.LoadImage("ctx1 shapes.png");
depth_map.SetZResolution(1.f / (1 << 5));

// Initialize a converter, use the loaded model
EDepthMapToPointCloudConverter converter;
converter.SetCalibrationModel(calib_model);

// Convert the depth map to a metric point cloud and save it
EPointCloud point_cloud;
converter.Convert(depth_map, point_cloud);
point_cloud.SavePCD("point_cloud.pcd");

C#

using eVision;
using eVision.Easy3D;
// Load the calibration model
EObjectBasedCalibrationModel calib_model = new EObjectBasedCalibrationModel();
calib_model.Load("calib.model");

// Load a depth map (captured in the same context)
EDepthMap16 depth_map = new EDepthMap16();
depth_map.LoadImage("ctx1 shapes.png");
depth_map.ZResolution = 1.0F / 32.0F;

// Initialize a converter, use the loaded model
EDepthMapToPointCloudConverter converter = new EDepthMapToPointCloudConverter();
converter.CalibrationModel = calib_model;

// Convert the depth map to a metric point cloud and save it
EPointCloud point_cloud = new EPointCloud();
converter.Convert(depth_map, point_cloud);
point_cloud.SavePCD("point_cloud.pcd");

Python

from eVision import Easy3D

# Load the calibration model
calib_model = Easy3D.EObjectBasedCalibrationModel()
calib_model.Load("calib.model")

# Load a depth map (captured in the same context)
depth_map = Easy3D.EDepthMap16()
depth_map.LoadImage("ctx1 shapes.png")
depth_map.ZResolution = 1.0 / 32.0

# Initialize a converter, use the loaded model
converter = Easy3D.EDepthMapToPointCloudConverter()
converter.CalibrationModel = calib_model

# Convert the depth map to a metric point cloud and save it
point_cloud = Easy3D.EPointCloud()
converter.Convert(depth_map, point_cloud)
point_cloud.SavePCD("point_cloud.pcd")