(PECL imagick 2 >= 2.3.0, PECL imagick 3)
Imagick::segmentImage — Segments an image
$COLORSPACE,$cluster_threshold,$smooth_threshold,$verbose = falseAnalyses the image and identifies units that are similar. Bu yöntem, derleme sırasında ImageMagick kütüphanesinin 6.4.5 veya sonraki bir sürümü kuruluysa kullanılabilir.
COLORSPACEOne of the COLORSPACE constants.
cluster_thresholdA percentage describing minimum number of pixels contained in hexedra before it is considered valid.
smooth_thresholdEliminates noise from the histogram.
verboseWhether to output detailed information about recognised classes.
Örnek 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);
?>