Using a PMAlign Tool to Process Multiple Part Instances in a Single Image with a ViDi Red Analyze Tool
In order to handle multiple part instances in a single image, a separate View must be created for each instance. Each View requires a transform to fixture to its part; for each PMAlignResult produced by a PMAlign tool, the procedure above can be repeated to create multiple fixtured Views:
For each result from a PMAlignTool:
- Get the Pose from a CogPMAlignResult.
- Convert the Pose from CogTransform2DLinear to System.Windows.Media.Matrix using the provided extension method.
- Get the RegionOfInterest from the ViDi tool and cast it to IManualRegionOfInterest.
- Call the AddView method on the IManualRegionOfInterest to create the fixtured View, passing in a size and the Pose matrix.
- Process the image once all the Views are added.