<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->

<refentry xml:id="imagick.segmentimage" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Imagick::segmentImage</refname>
  <refpurpose>Segments an image</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <modifier>public</modifier> <type>bool</type><methodname>Imagick::segmentImage</methodname>
   <methodparam><type>int</type><parameter>COLORSPACE</parameter></methodparam>
   <methodparam><type>float</type><parameter>cluster_threshold</parameter></methodparam>
   <methodparam><type>float</type><parameter>smooth_threshold</parameter></methodparam>
   <methodparam choice="opt"><type>bool</type><parameter>verbose</parameter><initializer>&false;</initializer></methodparam>
  </methodsynopsis>
  <para>
   Analyses the image and identifies units that are similar. &imagick.method.available.0x645;
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>COLORSPACE</parameter></term>
     <listitem>
      <para>
       One of the <link linkend="imagick.constants.colorspace">COLORSPACE constants</link>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>cluster_threshold</parameter></term>
     <listitem>
      <para>
       A percentage describing minimum number of pixels 
       contained in hexedra before it is considered valid.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>smooth_threshold</parameter></term>
     <listitem>
      <para>
       Eliminates noise from the histogram.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>verbose</parameter></term>
     <listitem>
      <para>
       Whether to output detailed information about recognised classes.
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>

  </para>
 </refsect1>




 <refsect1 role="examples">
  &reftitle.examples;
  <para>
    <example>
      <title> <function>Imagick::segmentImage</function></title>
      <programlisting role="php">
      <![CDATA[
<?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);

?>
]]>
      </programlisting>
    </example>
  </para>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
