Cog3DLineFitterUsing2DPoints Execute Method Cognex VisionPro 9.20
Fits a 3D line from 2D point sets and a set of camera calibrations. The 2D points must be extracted from different cameras or views. It is not required that the 2D points of the different cameras/views correspond, but all the 2D points must lie on the same 3D line.

The stability and precision of the fitted line segment can be determined by setting Perturbation to a value greater than 0. This will estimate the precision of the found line segment by trying slight perturbations of the fitted line segment and comparing the residuals (induced by the perturbed line segment) with the residuals corresponding to the fitted line segment. The difference between the residuals induced by the perturbed line segment and the residuals of the fitted line segment are stored in the Cog3DLineFitterUsing2DPointsResult.MinDeltaResidualsPhys3D and Cog3DLineFitterUsing2DPointsResult.MinDeltaResidualsRaw2D properties.

Notes:

  • The result's IsFound property will be set to false if no line can be fit to the given points (such as when the line formed by the image points is exactly parallel to the baseline between two cameras).
  • This operation determines the 3D line segment which minimizes the sum squared error in image pixels.
  • The endpoints of the fitted line segment are determined by inferring 3D rays from all the pointsRaw2D, determining the nearest point on the fitted line segment to each 3D ray, determining the 2 outermost points with respect to all the nearest points on the fitted line segment.

Namespace: Cognex.VisionPro3D
Assembly: Cognex.VisionPro3D (in Cognex.VisionPro3D.dll) Version: 80.0.0.0
Syntax

public Cog3DLineFitterUsing2DPointsResult Execute(
	List<Cog3DCameraCalibration> raw2DFromPhys3Ds,
	List<Cog3DVect2Collection> pointsRaw2D
)

Parameters

raw2DFromPhys3Ds
Type: System.Collections.Generic List Cog3DCameraCalibration 
The camera calibrations of the cameras used to extract the 2D points. The size of the list defines the number of cameras/views used.
pointsRaw2D
Type: System.Collections.Generic List Cog3DVect2Collection 
A list of 2D point collections, one collection per camera/view. The size of the list must be equal to the number of cameras.

Notes:

  • This function can tolerate the situation where some items of pointsRaw2D are empty (i.e., pointsRaw2D[i].Count==0);
  • It is NOT required that pointsRaw2D[camIndex_i].Count == pointsRaw2D[camIndex_j].Count (camIndex_i != camIndex_j);
  • It is NOT required that pointsRaw2D[camIndex_i][k] corresponds to pointsRaw2D[camIndex_j][k] (camIndex_i != camIndex_j).

Return Value

Type: Cog3DLineFitterUsing2DPointsResult
A Cog3DLineFitterUsing2DPointsResult containing the fitted line segment and 2D and 3D residuals.
Exceptions

ExceptionCondition
ArgumentNullException If any of the input arguments is null.
ArgumentException
  • If raw2DFromPhys3Ds.Count is less than 2.
  • If raw2DFromPhys3Ds.Count != pointsRaw2D.Count.
  • If fewer than two of the individual items in pointsRaw2D contain two or more points.
See Also