PHP 8.3.4 Released!

Imagick::segmentImage

(PECL imagick 2 >= 2.3.0, PECL imagick 3)

Imagick::segmentImage画像を分割する

説明

public Imagick::segmentImage(
    int $COLORSPACE,
    float $cluster_threshold,
    float $smooth_threshold,
    bool $verbose = false
): bool

画像を解析し、似ている部分を特定します。このメソッドは、ImageMagick バージョン 6.4.5 以降で Imagick をコンパイルした場合に使用可能です。

パラメータ

COLORSPACE

COLORSPACE 定数 のいずれか。

cluster_threshold

有効と見なされるために必要な、 hexedra 内の最小ピクセル数を表すパーセンテージ。

smooth_threshold

ヒストグラムからノイズを除去する。

verbose

識別した区分についての詳細情報を出力するか否か。

戻り値

例1 Imagick::segmentImage()

<?php
function segmentImage($imagePath, $colorSpace, $clusterThreshold, $smoothThreshold) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->segmentImage($colorSpace, $clusterThreshold, $smoothThreshold);
header("Content-Type: image/jpg");
echo
$imagick->getImageBlob();
}

segmentImage($imagePath, \Imagick::COLORSPACE_RGB, 5, 5);

?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top