PHP.mk документација

Imagick::subImageMatch

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

imagick.subimagematch.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека imagick.subimagematch.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Imagick::subImageMatch

Референца за `imagick.subimagematch.php` со подобрена типографија и навигација.

imagick.subimagematch.php

Imagick::subImageMatch

(PECL imagick 3 >= 3.3.0)

Imagick::subImageMatchSearches for a subimage in the current image and returns a similarity image

= NULL

public Imagick::subImageMatch((PECL imagick 2, PECL imagick 3) $Imagick, array &$offset = ?, float &$similarity = ?): (PECL imagick 2, PECL imagick 3)

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(40, 40, 250, 110);
$imagick2->vignetteimage(0, 1, 3, 3);

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

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

?>

Белешки од корисници 1 белешка

inipel at ya dot ru
пред 4 години
After $ im->cropImage method, $ im->subImageMatch doesn't work, before using $ im->subImageMatch, use $ im->setImagePage(0, 0, 0, 0);

The sequence is as follows:
$ im->cropImage();
$ im->setImagePage (0, 0, 0, 0);
$ im->subImageMatch()
Навигација

Прелистувај сродни теми и функции.

На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.