(No version information available, might only be in Git)
Imagick::segmentImage — Segments an image
$COLORSPACE
, float $cluster_threshold
, float $smooth_threshold
[, bool $verbose = FALSE
] ) : boolAnalyses the image and identifies units that are similar. Este método está disponível se o PHP foi compilado com o ImageMagick versão 6.4.5 ou superior.
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.
Exemplo #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);
?>