PHP Image match is php ported version of image-match
Based on the paper An image signature for any kind of image, Wong et al.
git clone [email protected]:ravich11/php-image-match.git
cd php-image-match
composer install
<?php
require './vendor/autoload.php';
use Elasticsearch\ClientBuilder;
use ImageMatch\Database\ElasticSearchDatabase;
$builder = ClientBuilder::create();
// You have a elasticsearch instance with hostname `elasticsearch` and port 9000
$builder->setHosts(['elasticsearch']);
$client = $builder->build();
$signature_db = new ElasticSearchDatabase($client);
$response = $signature_db->addImage(PATH_TO_THE_IMAGE_FILE);
<?php
require './vendor/autoload.php';
use Elasticsearch\ClientBuilder;
use ImageMatch\Database\ElasticSearchDatabase;
$builder = ClientBuilder::create();
// You have a elasticsearch instance with hostname `elasticsearch` and port 9000
$builder->setHosts(['elasticsearch']);
$client = $builder->build();
$signature_db = new ElasticSearchDatabase($client);
$response = $signature_db->searchImage(PATH_TO_THE_IMAGE_FILE);