Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 22847 программистов и 1242 робота. Сейчас ищут 775 программистов ...
Приступая к работе

Imagick::subImageMatch - Description

Вернуться к: Imagick

Imagick::subImageMatch

(Информация о версии неизвестна, возможно, только в SVN)

Imagick::subImageMatchDescription

Описание

public Imagick Imagick::subImageMatch ( Imagick $Imagick [, array &$offset [, float &$similarity ]] )

Searches for a subimage in the current image and returns a similarity image such that an exact match location is completely white and if none of the pixels match, black, otherwise some gray level in-between. You can also pass in the optional parameters bestMatch and similarity. After calling the function similarity will be set to the 'score' of the similarity between the subimage and the matching position in the larger image, bestMatch will contain an associative array with elements x, y, width, height that describe the matching region.

Список параметров

Imagick

offset

similarity

A new image that displays the amount of similarity at each pixel.

Возвращаемые значения

Примеры

Пример #1 Imagick::subImageMatch()

<?php
function subImageMatch($imagePath) {
    
$imagick = new \Imagick(realpath($imagePath));
    
$imagick2 = clone $imagick;
    
$imagick2->cropimage(4040250110);
    
$imagick2->vignetteimage(0133);

    
$similarity null;
    
$bestMatch null;
    
$comparison $imagick->subImageMatch($imagick2$bestMatch$similarity);

    
$comparison->setImageFormat('png');
    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

?>



Вернуться к: Imagick

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware