ObjectRecognition

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

The processor can handle video files.

The processor can handle the following image formats:

  • TIFF
  • JPEG
  • JPEG 2000
  • PNG
  • 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.
Database File   The path of a file that contains an object recognition database. Set this property to use a database that you exported from Media Server, using the action ExportObjectDatabase.
Shared Database   The name of the object recognition database to use to recognize objects. Set this property to use a database that is stored in the external database specified by the Media Service (see the "Media Service" property).
Match Geometries 2D rotations only Specifies the types of transformations you expect to see, when comparing objects in the training database to objects that appear in the media source.
Image Output Format   When set, the processor saves the full image or best video frame for each recognized object, in the specified format (BMP, GIF, JPEG, PDF, PNG, PPM, TIFF or WEBP).
Video Clip Quality   When set to "low", "medium", or "high", the processor saves a video clip of the recognized object at the specified quality level.
Video Clip Height   The height of the video clip that is generated when you set Video Clip Quality, in pixels.

Relationships

Name Description
success Processing was successful.
failure Processing failed.

Example Output

The following example shows the metadata that is added to an IDOL document by object recognition.

<idol_media>
  <objects>
    <object page="1">
      <database>objects</database>
      <identifier>object3</identifier>
      <bestRegion>
        <region height="84" left="454" page="1" top="44" width="167">
          <point x="454" y="44"/>
          <point x="620" y="45"/>
          <point x="620" y="127"/>
          <point x="454" y="127"/>
        </region>
        <imagefile>/opt/nifi/idol_repository/Files/ObjectRecognition_234d2bd2-0180-1000-3e2a-8285372714b9/cedb4e00-dfe6-41e5-a123-b33e993f6031.bmp</imagefile>
      </bestRegion>
      <region height="84" left="454" page="1" top="44" width="167">
        <point x="454" y="44"/>
        <point x="620" y="45"/>
        <point x="620" y="127"/>
        <point x="454" y="127"/>
      </region>
    </object>
  </objects>
</idol_media>

The XML contains an object element for each recognized object.

  • The database and identifier elements describe the identity of the recognized object.
  • The region element describes the position of the recognized object in the image or video frame.

    The left, top, width, and height attributes provide the position and size of the region in pixels (left specifies the distance from the left side of the image to the left side of the region, and top specifies the distance from the top of the image to the top of the region).

    When you analyze an image or document the page attribute specifies the page on which the object was recognized. When you analyze a video and an object is tracked across multiple frames, there can be multiple region elements with start and duration attributes that provide video timestamps, in seconds.

    The region element contains point elements that describe a bounding polygon around the recognized object.

  • The bestRegion element represents the best video frame in which the object was visible. It includes the region element for that frame, but can also include:

    • imageFile - The path of the image that was generated when you set the property Image Output Format.
  • The videoFile element contains the path of the video file that is generated when you set the property Video Clip Quality.