# ObjectClassRecognition

Runs object class recognition on the file(s) associated with an IDOL document FlowFile, and adds information about any recognized objects to the IDOL document.

To run object class recognition you must have a recognizer. Micro Focus provides some pre-trained recognizers, and you can create your own. For more information about object class recognition, including how to train a recognizer, refer to the Media Server Administration Guide.

Supported file formats

The processor can handle video files.

The processor can handle the following image formats:

- TIFF
- JPEG
- JPEG 2000
- PNG
- GIF (only the first frame of an animated GIF)
- BMP (compressed BMP files are not supported) and ICO
- PBM, PGM, and PPM
- WebP

Additionally, if you configure your MediaServiceImpl controller service to use a KeyView Export Service, the processor can handle document formats, including:

- Adobe PDF
- Microsoft Word Document (.DOC and .DOCX)
- Microsoft Excel Sheet (.XLS and .XLSX)
- Microsoft PowerPoint Presentation (.PPT and .PPTX)
- OpenDocument Text (.ODT)
- OpenDocument Spreadsheet (.ODS)
- OpenDocument Presentation (.ODP)
- Rich Text (RTF)

## Properties

Name | Default Value | Description
--- | --- | ---
IDOL License Service |  | An IdolLicenseServiceImpl that provides a way to communicate with an IDOL License Server.
Media Service |  | A MediaServiceImpl that manages media analysis resources.
Video Sample Interval | 100 | The interval between video frames that are selected to be analyzed, in milliseconds.
Recognizer File |  | The path of a file that contains the recognizer to use. Set this property to use a recognizer that you exported from Media Server, using the action `ExportObjectClassRecognizer`.
Shared Recognizer |  | The name of the recognizer to use for object class recognition. Set this property to use a recognizer that is stored in the external database specified by the Media Service (see the "Media Service" property).

## Relationships

Name | Description
--- | ---
success | Processing was successful.
failure | Processing failed.

## Example Output

The following example shows the metadata that can be added to an IDOL document, when object class recognition runs on an image:

    <idol_media>
        <objectclasses>
            <objectclass page="1">
                <recognizer>ObjectClassRecognizer_Gen2_Surveillance</recognizer>
                <class>car</class>
                <region height="130" left="11" page="1" top="22" width="264"/>
            </objectclass>
            ...
        </objectclasses>
    </idol_media>

The XML contains an `objectclass` element for each object that is recognized.

- The `recognizer` element provides the name of the recognizer that was used to recognize the object.
- The `class` element provides the name of the object class.
- The `region` element provides the position of the recognized object within the image. The `left` and `top` attributes provide the position of the top-left corner of the bounding box around the object, where `0,0` is the top-left corner of the image. The `width` and `height` elements provide the width and height of the bounding box. These values are measured in pixels.

When you run object class recognition on a video, there can be multiple `region` elements because the object can be tracked across multiple video frames. The `page` attributes are replaced with `start` and `duration` attributes that provide video timestamps, in seconds. For example:

    <idol_media>
        <objectclasses>
            <objectclass duration="2.335666" start="5.972633">
                <recognizer>ObjectClassRecognizer_Gen2_Surveillance</recognizer>
                <class>car</class>
                <region duration="0.033366" height="26" left="1058" start="5.972633" top="62" width="36"/>
                <region duration="0.033366" height="30" left="1060" start="6.072733" top="64" width="40"/>
                <region duration="0.033366" height="33" left="1063" start="6.172833" top="69" width="44"/>
                <region duration="0.033366" height="37" left="1066" start="6.272933" top="74" width="48"/>
                <region duration="0.033366" height="40" left="1069" start="6.373033" top="79" width="51"/>
                ...
            </objectclass>
            ....
        </objectclasses>
    </idol_media>

In this example you can see that the car's `height` and `width` are increasing as the `start` time increases. This indicates that the car is moving towards the camera.

_FT_HTML5_bannerTitle.htm