# Working with VisionPro Deep Learning Markings in Cognex VisionPro Coordinates

Working with VisionPro Deep Learning tools involves working with three Deep Learning coordinate spaces:

- Image coordinates
- View Coordinates
- Match Coordinates

This topic describes how to translate these different coordinate systems into a coordinate system understood by VisionPro.

## Image Coordinates

For an image processed by a Deep Learning tool, image coordinates are coordinates relative to the upper-left corner of the upper-left pixel of the image. This space corresponds to Pixel space in VisionPro. Therefore, it is possible to draw results from Deep Learning Markings directly on the correct locations in the original image by converting the results into Image coordinates. When adding these results to a VisionPro image as VisionPro graphics, the SelectedSpaceName property must be set to "#" for Pixel space, since each result is defined in pixel coordinates.

## View Coordinates

For an image processed by a Deep Learning tool, the tool will operate on 1 to N rectangular regions of interest (or Views) in that image. Deep Learning results, such as the center point of a Blue Tool feature marker, are given in coordinates relative to the View that yielded the result – not relative to the input image. The origin of this coordinate system is the upper-left corner of the View's rectangle.

To make these results compatible with VisionPro, they must first be converted into Image coordinates. A transform from View coordinates to Image coordinates is provided by the Pose property of each View object:

Therefore, to transform a Deep Learning result into VisionPro's Pixel coordinate space, each point in the result must be transformed by its View's Pose.

Note: An extension method (ToOriginalFromView) is provided to simplify this conversion, by taking a Point and a View and returning the corresponding Point in Image coordinates.

## Match Coordinates

When finding a Match (a geometric arrangement of features) in the Blue Locate or Blue Read tools, the Match also defines its own coordinate space. Each point in the Match is given in coordinates relative to the Match – not relative to the View that yielded the Match.

To make a Match compatible with VisionPro, its points must first be converted into View coordinates, and then converted into Image coordinates. A transform from Match to View coordinates is provided by the Pose property of each Match:

The results held within a Deep Learning Marking can be made compatible with VisionPro by transforming them into Image coordinates. The results can then be drawn in the image's Pixel space.

Note: Implementations of the ICreateToolGraphics interface are provided to simplify converting Deep Learning results from each tool into VisionPro graphics in the Pixel space.