Add and Configure a VisionPro Tool Block

After images are available, they can be processed by vision tools and their algorithms. In this sample application, a simple Affine Transform tool will be used to illustrate the process.

Note: For more information about adding and configuring VisionPro Tool Blocks, see the VisionPro Tool Blocks topics.
  1. From the Toolbox, expand the Vision > VisionPro node and drag and drop a Tool Block onto the CopyRegion Task. By default, this toolblock is created with an input pin that waits for a VisionPro iCogImage.
  2. Right-click on this input pin and assign it to the imageBuffer tag.
  3. Press the Run button to execute the Task and pass an image to the Tool Block.
  4. Double-click the VisionPro Tool Block to open the Tool Block in a new tab, where it can be configured.
  5. From the Toolbox, expand the Image Processing folder and drag and drop a CogAffineTransformTool between the [Inputs] and [Outputs] in the Tools tab.
  6. Link the [Inputs] Image to the CogAffineTransformTool InputImage parameter, and press the Run Tools button to force the tool to execute.
  7. Go to the Inputs/Outputs tab, select Browse and add a new input: Cognex.VisionPro.CogRectangleAffine. Name it "Region."
    Note: You can find this input under VisionPro | Cognex.VisionPro.Core.dll | Cognex.VisionPro | CogRectangleAffine.
  8. Add a new Output: Cognex.VisionPro.ICogImage. Name it "OuputImage."

  9. Go back to the Tools tab, right-click the CogAffineTransformTool and select Add Terminals from the menu.
  10. Select Region and press the Add Input button, and then the Close button.
  11. Link the [Inputs] Region to the CogAffineTransformTool Region parameter, and the CogAffineTranformTool OutputImage parameter to the [Outputs] OutputImage output.

  12. Press the Run Tools button to force the tool to execute again and ensure that the tool still passes.
  13. Go to the Task tab, and the Tool Block should appear with two input pins and one output pin.

  14. Right-click the unlinked input pin, and select Assign to Tag.
  15. Check the Show All Types checkbox, and select the myRect tag, which was created in the Connect Through Tags step, and press the Accept button.
  16. Right-click the unlinked output pin, and select Assign to Tag.
  17. Select the outputImage tag and press the Accept button.

  18. Press the Run button to execute the blocks and ensure the images are being passed through.