Cog3DCylinderFitterUsing2DPoints Execute Method Cognex VisionPro 9.20
Fits a 3D cylinder from 2D point sets and a set of camera calibrations. It is not required that the 2D points of the different cameras/views correspond.

Notes:

  • The result's IsFound property will be set to false if no cylinder can be fit to the given points.
  • This operation determines the 3D cylinder which minimizes the sum squared error in image pixels.
  • This operation can compute the cylinder's radius and height if the input data includes image points from more than one camera.

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

public Cog3DCylinderFitterUsing2DPointsResult Execute(
	List<Cog3DCameraCalibration> raw2DFromPhys3Ds,
	List<Cog3DVect2Collection> pointsRaw2DOnOccludingEdge0,
	List<Cog3DVect2Collection> pointsRaw2DOnOccludingEdge1,
	List<Cog3DVect2Collection> pointsRaw2DOnCircularEdge0,
	List<Cog3DVect2Collection> pointsRaw2DOnCircularEdge1
)

Parameters

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

Notes:

  • It only requires that all points in one collection correspond to the same occluding edge from that camera, i.e., all points in pointsRaw2DOnOccludingEdge0[camIndex_i] must correspond to one occluding edge, and points in pointsRaw2DOnOccludingEdge0[camIndex_j] must correspond to one occluding edge (but diffent from the one for pointsRaw2DOnOccludingEdge0[camIndex_i] if camIndex_j != camIndex_i).
  • This function can tolerate the situation where some or all items of pointsRaw2DOnOccludingEdge0 are empty (i.e., pointsRaw2DOnOccludingEdge0[camIndex_i].Count==0);
  • It is NOT required that pointsRaw2DOnOccludingEdge0[camIndex_i].Count == pointsRaw2DOnOccludingEdge0[camIndex_j].Count (camIndex_i != camIndex_j);
  • It is NOT required that pointsRaw2DOnOccludingEdge0[camIndex_i][k] corresponds to pointsRaw2DOnOccludingEdge0[camIndex_j][k] (camIndex_i != camIndex_j).

pointsRaw2DOnOccludingEdge1
Type: System.Collections.Generic List Cog3DVect2Collection 
A List of 2D point collections for occluding edges, one collection per camera/view. The size of the list must be equal to the number of cameras. May not be null. Note that pointsRaw2DOnOccludingEdge1[camIndex_i] and pointsRaw2DOnOccludingEdge0[camIndex_i] must correspond to two different occluding edges of the same cylinder observed from the same camera. For detailed specification, see the notes of pointsRaw2DOnOccludingEdge0 for more information.
pointsRaw2DOnCircularEdge0
Type: System.Collections.Generic List Cog3DVect2Collection 
A List of 2D point collections for circular edges, one collection per camera/view. The size of the List must be equal to the number of cameras. May not be null.

Notes:

  • It only requires that all points in one collection correspond to the same circular edge (i.e., all points in pointsRaw2DOnCircularEdge0[camIndex_i] must correspond to one circular edge on the cylinder, and points in pointsRaw2DOnCircularEdge0[camIndex_j] must correspond to one circular edge on the cylinder (which might be different from the one for pointsRaw2DOnCircularEdge0[camIndex_i)).
  • This function can tolerate the situation where some or all items of pointsRaw2DOnCircularEdge0 are empty (i.e., pointsRaw2DOnCircularEdge0[camIndex_i].Count==0);
  • It is NOT required that pointsRaw2DOnCircularEdge0[camIndex_i].Count == pointsRaw2DOnCircularEdge0[camIndex_j].Count (camIndex_i != camIndex_j);
  • It is NOT required that pointsRaw2DOnCircularEdge0[camIndex_i][k] corresponds to pointsRaw2DOnCircularEdge0[camIndex_j][k] (camIndex_i != camIndex_j).

pointsRaw2DOnCircularEdge1
Type: System.Collections.Generic List Cog3DVect2Collection 
A List of 2D point collections for circular edges, one collection per camera/view. The size of the List must be equal to the number of cameras. May not be null. Note that pointsRaw2DOnCircularEdge1[camIndex_i] pointsRaw2DOnCircularEdge0[camIndex_i] must correspond to different circular edges of the same cylinder. For detailed specification, see the notes of pointsRaw2DOnCircularEdge0 for more information.

Return Value

Type: Cog3DCylinderFitterUsing2DPointsResult
A Cog3DCylinderFitterUsing2DPointsResult containing the fitted cylinder and 2D and 3D residuals.
Exceptions

ExceptionCondition
ArgumentNullException If any of the input arguments is null or any argument includes null item.
ArgumentException
  • If raw2DFromPhys3Ds.Count is less than 1.
  • If raw2DFromPhys3Ds is not the same size as pointsRaw2DOnOccludingEdge0, pointsRaw2DOnOccludingEdge1, pointsRaw2DOnCircularEdge0, or pointsRaw2DOnCircularEdge1
  • If Radius == 0 or Height == 0, and FitMode is Cog3DCylinderFitterUsing2DPointsFitModeConstants.LeastSquaresUseSpecifiedRadiusAndHeight.
  • If FitMode is Cog3DCylinderFitterUsing2DPointsFitModeConstants.LeastSquaresComputeRadiusAndHeight and raw2DFromPhys3Ds.Count is 1.
  • If none or only one of collections in pointsRaw2DOnOccludingEdge0 and pointsRaw2DOnOccludingEdge1 contains two or more points, AND none of the collections in pointsRaw2DOnCircularEdge0 and pointsRaw2DOnCircularEdge1 contains five or more points.
  • if raw2DFromPhys3Ds.Count is 1, and raw2DFromPhys3Ds[0].IsTelecentric is true .
Remarks

The minimum 2D information required when fitting with FitMode of Cog3DCylinderFitterUsing2DPointsFitModeConstants.LeastSquaresUseSpecifiedRadiusAndHeight is:

At least two 2D points along each occluding edge for one camera;

or at least five 2D points along one of the circular edge for one camera.

The minimum 2D information required when fitting with FitMode of Cog3DCylinderFitterUsing2DPointsFitModeConstants.LeastSquaresComputeRadiusAndHeight is:

At least two 2D points (from each camera) along each occluding edge for two cameras;

Or at least five 2D points (from each camera) along the same circular edge for two cameras.

See Also