Php/docs/imagick.segmentimage

提供:Dev Guides
< Php
移動先:案内検索

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()

<?phpfunction 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);?>