Usage



You need include only fCompare class and create object:

<?php

include "fCompare.php";
$fc = new fCompare();

Basic usage:

// make a "fingerprint" pattern
$pattern_1 = $fc->pattern('upload/foto-1.jpg'); // array
$pattern_2 = $fc->pattern('upload/foto-2.png'); // array

// check if images are similar. read more about parametrs
$similar_result = $fc->compare($pattern_1, $pattern_2, 5, 100, 100); // bool



Save pattern to database:

// make a "fingerprint" pattern
$pattern = $fc->pattern('upload/foto-1.jpg'); // array

$db = new Database('image_pattern');

... // details avaible in documentation with full script package



Check new uploaded image with all patterns from database (example database model):

// make a "fingerprint" pattern
$pattern = $fc->pattern('upload/foto-1.jpg'); // array

$db = new Database('image_pattern');

... // details avaible in documentation with full script package


Database model:

// This is recommended MySQL database model.

... // details avaible in documentation with full script package


Compare all patterns with themselvs from database.
Result is list of all similar images:

IMAGE_1: SIMILAR1, SIMILAR2, ...

IMAGE_2: SIMILAR1, SIMILAR2, ...

IMAGE_3: SIMILAR1, SIMILAR2, ...

/*
 * ATTENTION. This code is not optimal with a large quantity of images.
 * Remember to increase the script execution time.
 * The production version of the script should not * be executed!
*/
$fc = new fCompare();

$db = new Database('image_pattern'); // patterns table
$model = new Database('my_picture_gallery'); // pictures table

... // details avaible in documentation with full script package