# Lines To Lines Centering Block

The block computes the transform that centers the GroupB line segments to their corresponding GroupA line segments.

## General Information

Class name: LinesToLinesCenteringBlock

Namespace: Cognex.Designer.AlignPlus.Alignment

Assembly: Cognex.Designer.AlignPlus.Alignment.dll

## Inputs

Name | Type | Description
--- | --- | ---
GroupA Line Segments | List<CogAlpsLineFeature> | Line features representing GroupA
GroupB Line Segments | List<CogAlpsLineFeature> | Line features representing GroupB

## Outputs

Name | Type | Description
--- | --- | ---
Distances between GroupA and Transformed GroupB Line Segments | CogDictionary | The gap distances between Transformed GroupB Line Segments and GroupA Line Segments. For mode CenterGroupALineSegEndPointsToGroupBLines, distance for each line segment is computed by averaging the point-line distance of its two end points. For mode CenterGroupAPointPairsToGroupBLinePairs, distance for each line segment is exactly the distance computed by the CogCenterPointsToLines tool.
GroupA from GroupB Transform | CogTransform2DLinear | The transform that centers the line segments of GroupB to line segments of GroupA
Transformed GroupB Line Segments | List<CogAlpsLineFeature> | GroupB's line features after applying transform, theoretically it should be very close to Group A line features

## Properties

Name | Type | Description
--- | --- | ---
Maximum Search Angle | double | This parameter sets the upper limit the rotation angle of the result transform. The value is specified in degrees
Minimum Search Angle | double | This parameter sets the lower limit the rotation angle of the result transform. The value is specified in degrees
Normal Direction Inference Method | Constant | Property specifies how the line segment normal direction is inferred InferFromConvexity Automatically infer the line segment normal direction for each input line segment. It requires the input line segments to form a convex shape. It selects the normal direction for each line segment such that the line normal points outwards. UseLineSegmentNormalDirection Use the direction of the given line segments to determine the normal direction for each line segment. The direction of a line segment is implied by the ordering of its start and end points (end - start). The normal direction is defined to be +90 degrees from the line segment direction.
Pose Computation Method | Constant | There are two options: CenterGroupALineSegEndPointsToGroupBLines For point to line fitting. The feature correspondences are between GroupA line segment end points(two end points for each line segment) and GrouB lines. This block will minimize the variance in the point to line signed distance across all point to line correspondences, as a result, it tries to make all of the point to line distances the same. CenterGroupAPointsPairsToGroupBLinePairs For point pair to line pair fitting. The feature correspondences are between GroupA line segment middle points(one middle point for each line segment) and GrouB lines. This block will minimize the variation in the point to line signed distance differences, across all point pair line pair correspondences. The point to line distance difference for a given point pair line pair correspondence is the difference between the point to line distance for the first point and the point to line distance for the second point in the point pair. The class tries to make the two point to line signed distances in each point pair line pair correspondence the same. Signed distances are measured in the direction of the normal to the line. For more information, please refer to AlignPlus Concpet\Pose Compute\Part Pose Change Computation.
Timeout Enabled | Boolean | If true, the tool will time out after the time specified by the TimeoutValue property has elapsed
Timeout Value | Double | If TimeoutEnabled property is true, the tool will time out after the value of this property. The value is in milliseconds.