# LinkProcessResults

Compares the results of two separate process actions and returns pairs of UUIDs (one from each session) that represent the same object class or vehicle.

A process action accepts input from only one camera. However, you might have two cameras that view the same scene from different perspectives. You can use this action to link object classes and vehicles that were recognized in separate processing sessions.

This action requires an XML file from each processing session. There are several requirements that must be observed:

- The files must contain results from cameras that view the same scene.
- The files must be generated using the XML output engine .
- Timestamps must be synchronized between the two processing sessions (for example by processing both streams on the same Media Server).
- Each file must include the `Proxy` track from whichever ingest engine was used.
- Each file must include an object class recognition data track, vehicle model recognition data track, or both.

By default, the action also returns a projection matrix that can be used to transform image coordinates from the second camera into coordinates on the first camera. However, if you use the `config` action parameter to specify additional perspective information, the action returns two projection matrices (one for each camera). You can use these to transform coordinates from the corresponding scene image into common real-world coordinates on a flat ground plane.

Type: asynchronous

Parameter | Description | Required
--- | --- | ---
`config` | An optional configuration file to configure the action. For information about the parameters you can set, see the table below. You can specify a file path, the file content (base-64 encoded), or upload the file as multipart form data. | No
`results0` | An XML file that contains results from the first camera. Specify a file path, the file content (base-64 encoded), or upload the file as multipart form data. | Yes
`results1` | An XML file that contains results from the second camera. Specify a file path, the file content (base-64 encoded), or upload the file as multipart form data. | Yes

## Configuration File

You can provide an optional configuration file containing one or more of the following sections.

Section / Parameters | Description
--- | ---
`[Link] ScreenPoints0 ScreenPoints1` | You can include this section if you know how the cameras are positioned. This information helps Media Server link the results. These parameters each specify a comma-separated list of at least four points, made up of the x- and y-coordinates of pixels in the scene image. The coordinates `0,0` represent the top-left corner of the scene image. If you include the `[Link]` section you must set both parameters (one for each camera). Choose four physical locations that are visible from both cameras, and provide the coordinates for those locations. Ensure you specify the points in the same order in both parameters. As an example, you might set: `[Link] ScreenPoints0=90,313,212,345,434,416,604,315 ScreenPoints1=706,327,497,293,236,225,312,349`
`[Perspective] FieldOfView WorldDimensions WorldDimensionsMetadata` | When you set these parameters (`FieldOfView` and either `WorldDimensions` or `WorldDimensionsMetadata`), Media Server returns two projection matrices, one for each camera. Each projection can be used to convert from screen points to common real-world coordinates on a flat ground plane. `FieldOfView` specifies the horizontal angle of view of the first camera (that captured `results0`), in degrees. `WorldDimensions` specifies a list of dimensions that describe the actual size of object classes or vehicles. This is similar to the WorldDimensions parameter in the perspective engine. `WorldDimensionsMetadata` specifies the name of a metadata field, in your training database, that describes the actual size of an object class or vehicle. This is similar to the WorldDimensionsMetadata parameter in the perspective engine. As an example, you might set: `[Perspective] FieldOfView=60 WorldDimensionsMetadata=dimensions(m)`

## Example

The following example uses cURL to send a request to Media Server.

`curl http://localhost:14000/action=LinkProcessResults -F results0=@ResultsFromCamera1.xml -F results1=@ResultsFromCamera2.xml`

## Response

This action is asynchronous, so Media Server always returns success accompanied by a token. You can use this token with the QueueInfo action to retrieve the status of your request.

An example response appears below. The action returns pairs of UUIDs (one from each session) that represent the same object class or vehicle.

    <autnresponse>
      <action>LINKPROCESSRESULTS</action>
      <response>SUCCESS</response>
      <responsedata>
        <links>
          <link>
            <confidence>93</confidence>
            <id0>708095fb-37d2-dcba-1234-a12aa345d67</id0>
            <id1>2857dc12-12ce-abcd-4321-4867319dac1</id1>
          </link>
          ...
        </links>
        <projection1>...</projection1>
      </responsedata>
    </autnresponse>

_FT_HTML5_bannerTitle.htm