Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 73.0.0.0
Parameters
- segmentA
- Type: Cognex.VisionPro CogLineSegment
The first line segment.
- segmentB
- Type: Cognex.VisionPro CogLineSegment
The second line segment.
- image
- Type: Cognex.VisionPro ICogImage
An image that specifies the coordinate space to use.
Return Value
Type: CogLineSegmentThe new line segment.
| Exception | Condition |
|---|---|
| ArgumentException | segmentA or segmentB is NULL. |
| CogSpaceTreeInvalidNameSyntaxException | At least one shape's selected space names is not a legal space name. |
| CogSpaceTreeNotUniqueException | At least one shape's selected space names is a nonqualified space name and more than one instance of it exists in image's coordinate space tree. |
| CogSpaceTreeNotInTreeException | At least one shape does not exist in image's coordinate space tree. |
| CogImageNoTreeException | The coordinate space tree is missing from image. |
Creates a new CogLineSegment by averaging segmentA and segmentB.
The start point of the new segment is the average of the start points of segmentA and segmentB, and the end point of the new segment is the is the average of the end points of segmentA and segmentB. The new segment is initialized with as many of segmentA's properties (such as Color) as possible.
You would typically use this function when segmentA and segmentB are parallel to each other and you wish to find a center line between them.
If you supply a value for the image parameter, then segmentA and segmentB are mapped to the selected space of image before the returned segment is computed. The returned segment has its selected space set to the selected space of image.
If you do not supply a value for image, then segmentA and segmentB are presumed to be in the same coordinate space and the returned line has its selected space set to ".".