GoLang Imagick::segmentImage

request it (206)
GoLang replacement for PHP's Imagick::segmentImage [edit | history]



Do you know a GoLang replacement for PHP's Imagick::segmentImage? Write it!

PHP Imagick::segmentImage

PHP original manual for Imagick::segmentImage [ show | php.net ]

Imagick::segmentImage

(No version information available, might only be in Git)

Imagick::segmentImageSegments an image

Description

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

Analyses the image and identifies units that are similar. This method is available if Imagick has been compiled against ImageMagick version 6.4.5 or newer.

Parameters

COLORSPACE

One of the COLORSPACE constants.

cluster_threshold

A percentage describing minimum number of pixels contained in hexedra before it is considered valid.

smooth_threshold

Eliminates noise from the histogram.

verbose

Whether to output detailed information about recognised classes.

Return Values

Examples

Example #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_RGB55);

?>