Setting Up the VisionPro® Tool Block

Within this application scenario, a VisionPro® Tool Block will be used to find a specific feature in the image, and then output a pose, which is a transform that will be used by a ViDi tool to orient its search area.

Note: For more information about the QuickBuild Job Editor and the VisionPro Vision tools, refer to the Cognex VisionPro® Documentation.
  1. Working within the ViDi Sub Task block, from the Task Toolbox, open the Vision node and select the VisionPro® Tool Block.

  2. Drag and drop the VisionPro® Tool Block into the ViDi Sub Task, and then connect the image pin to the input pin of the VisionPro® Tool Block.

  3. Press the Run All button to pass the image into the VisionPro® Tool Block.

  4. Double-click the VisionPro® Tool Block to open the QuickBuild Job Editor.

  5. Press the Play button to add the image.
  6. From the QuickBuild Job Editor Toolbox, select the CogImageConvertTool and drag it to the Job Editor.

  7. Connect the Inputs Image terminal to the CogImageConvertTool's InputImage terminal.

  8. From the QuickBuild Job Editor Toolbox, select the CogPMAlignTool and drag it to the Job Editor.

  9. Connect the CogImageConvertTool's OutputImage terminal to the CogPMAlignTool's InputImage terminal.

  10. Press the Play button to add the image to the CogPMAlignTool.
  11. Double-click the CogPMAlignTool to open the tool.

  12. Press the Grab Train Image button to have the tool use the current image as the training image.

  13. From the display menu, choose Current.TrainImage.

  14. Click and drag the small training region rectangle to enclose the feature that will be used as the pattern.

  15. With the region configured, press the Train button.

  16. The pattern should now be trained.

  17. Click the Run Params tab, and if the part will exhibit angular rotation, set the Angle parameters to account for the rotation.

  18. Click the Graphics tab, and enable the Show Coarse and Show Fine checkboxes.

  19. The CogPMAlignTool should now be configured.

  20. Close the CogPMAlignTool tool dialog, and return to the Job Editor.
  21. Connect the CogPMAlignTool's Results.Item[0].GetPose() terminal to the Outputs terminal.

    Note:

    If the CogPMAlignTool will be finding more than one pattern, you can configure the tool to report all of the pattern results.

    1. Right-click the CogPMAlignTool and select Add Terminals.
    2. Select the Results object.
    3. Drag the Results to the Outputs terminal.
  22. Close the ViDiSubTask.VisionProToolBlock tab to return to the ViDi Sub Task.
  23. Press the Run All button again to ensure the VisionPro® Tool Block is functioning correctly and the output pin is outputting a CogTransform2DLinear result.