Media Server 12.12

# Add an Image Hash to a Database

To add a new image hash and train Media Server to identify duplicate images, follow these steps.

To add an image hash to a database

- Add the image hash using the action `TrainImageHash`, with the following parameters:

  `database` | The name of the database to add the image hash to. The database must already exist.
  `identifier` | (Optional) A unique identifier for the image hash (maximum 254 bytes). If you do not set this parameter, Media Server generates an identifier automatically.
  `imagedata` | (Set this or `imagepath`, but not both). The training image to add. The file must be uploaded as multipart/form-data. For more information about sending data to Media Server, see Send Data by Using a POST Method.
  `imagepath` | (Set this or `imagedata`, but not both). The path of the training image to add. The path must be absolute or relative to the Media Server executable file.
  `imagelabel` | (Optional) A label to identify the image that you are adding (maximum 254 bytes). If you do not set this parameter, Media Server generates a label automatically.

  For example:

      curl http://localhost:14000 -F action=TrainImageHash
                                  -F database=ImageHashes
                                  -F imagedata=@image1.png

  Alternatively, provide the path of the training image:

      curl http://localhost:14000 -F action=TrainImageHash
                                  -F database=ImageHashes
                                  -F imagepath=./training/image1.png

  Media Server adds the image hash to the database and returns the identifier.

© Copyright 2022 Micro Focus or one of its affiliates
Version 12.12 | Last updated June 2022

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL Media Server 12.12

Topic Title: Add an Image Hash to a Database