# imageSimilarityTest

## Description

Search in to our image similarity database for similar images.

## Parameters

| Parameter  | Type   | Description    |
| ---------- | ------ | -------------- |
| `imageUrl` | string | test image URL |

## Response

| Parameter  | Type   | Description                                                                                                                                                                                                                                                                                                       |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `message`  | string | message about the response                                                                                                                                                                                                                                                                                        |
| `status`   | int    | <p>0 for no image found</p><p>1 for images found</p><p>-1 for any error occurs during the execution of the request</p>                                                                                                                                                                                            |
|            |        |                                                                                                                                                                                                                                                                                                                   |
| `metadata` | list   | list of object of the metadata associated with the found images                                                                                                                                                                                                                                                   |
| `img`      | object | <p>this object will contain four properties, they can be None<br>keyPoint1 and keyPoint2 will be the points matched between two images, the test image and the found image<br>matchedImg will be the comparative image of the two images in base64 format<br>score will be the similarity score of the search</p> |

## Example Request and Response

### Prerequisites

Before making requests with NO.AI SDK, you must have it installed.

You can install NO.AI SDK using either `npm` or `yarn`. Use the following commands to install NO.AI SDK:

```sh
npm install @nest25/ai-core-sdk
OR
yarn add @nest25/ai-core-sdk
```

## Request

Here is an example of how to make a `imageSimilarityTest` request using the NO.AI SDK:

```javascript
// import the ai-core-sdk
import {AIServices} from '@nest25/ai-core-sdk';

// create a new instance of the sdk
const aiServices = new AIServices();

async function main() {
  // get the result of the test
  const result = await aiServices.imageSimilarityTest('https://ik.imagekit.io/BIOSPHERE/1678716455079_PTj9bkO9d.jpeg');
  console.log(result);
}

main();
```

## Response

```json
{
    "img": {
        "keyPoint1": "None",
        "keyPoint2": "None",
        "matchedImg": "None",
        "score": 2.0
    },
    "message": "Similar image found.",
    "status": 0
}
```
