Пример #1
0
 /// <summary>
 /// Release the unmanaged resources associated with the ICP
 /// </summary>
 protected override void DisposeObject()
 {
     if (IntPtr.Zero != _ptr)
     {
         PpfMatch3dInvoke.cveICPRelease(ref _ptr);
     }
 }
Пример #2
0
 /// <summary>
 /// Constructor to a very efficient and robust variant of the iterative closest point (ICP) algorithm.
 /// </summary>
 /// <param name="iterations">number of iterations</param>
 /// <param name="tolerence">Controls the accuracy of registration at each iteration of ICP.</param>
 /// <param name="rejectionScale">Robust outlier rejection is applied for robustness. This value actually corresponds to the standard deviation coefficient. Points with rejectionScale * sigma are ignored during registration.</param>
 /// <param name="numLevels">Number of pyramid levels to proceed. Deep pyramids increase speed but decrease accuracy. Too coarse pyramids might have computational overhead on top of the inaccurate registrtaion. This parameter should be chosen to optimize a balance. Typical values range from 4 to 10.</param>
 /// <param name="sampleType">Currently this parameter is ignored and only uniform sampling is applied. </param>
 /// <param name="numMaxCorr">Currently this parameter is ignored and only PickyICP is applied. Leave it as 1.</param>
 public ICP(
     int iterations,
     float tolerence         = 0.05f,
     float rejectionScale    = 2.5f,
     int numLevels           = 6,
     SamplingType sampleType = SamplingType.Uniform,
     int numMaxCorr          = 1)
 {
     _ptr = PpfMatch3dInvoke.cveICPCreate(
         iterations,
         tolerence,
         rejectionScale,
         numLevels,
         sampleType,
         numMaxCorr);
 }
Пример #3
0
 /// <summary>
 /// Perform registration.
 /// </summary>
 /// <param name="srcPC">The input point cloud for the model. Expected to have the normals (Nx6). Currently, CV_32F is the only supported data type.</param>
 /// <param name="dstPC">The input point cloud for the scene. It is assumed that the model is registered on the scene. Scene remains static. Expected to have the normals (Nx6). Currently, CV_32F is the only supported data type.</param>
 /// <param name="residual">The output registration error.</param>
 /// <param name="pose">Transformation between srcPC and dstPC.</param>
 /// <returns>On successful termination, the function returns 0.</returns>
 public int RegisterModelToScene(Mat srcPC, Mat dstPC, ref double residual, Mat pose)
 {
     return(PpfMatch3dInvoke.cveICPRegisterModelToScene(_ptr, srcPC, dstPC, ref residual, pose));
 }