# MagickCore, C API: Segment an Image with Thresholding Fuzzy c-Means @ ImageMagick
ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
Author: ImageMagick Studio LLC
Keywords: magickcore, c, api:, segment, an, image, with, thresholding, fuzzy, c-means, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert

SegmentImage

## SegmentImage

SegmentImage() segment an image by analyzing the histograms of the color components and identifying units that are homogeneous with the fuzzy C-means technique.

The format of the SegmentImage method is:

    MagickBooleanType SegmentImage(Image *image,
      const ColorspaceType colorspace,const MagickBooleanType verbose,
      const double cluster_threshold,const double smooth_threshold,
      ExceptionInfo *exception)

A description of each parameter follows.

image

the image.

colorspace

Indicate the colorspace.

verbose

Set to MagickTrue to print detailed information about the identified classes.

cluster_threshold

This represents the minimum number of pixels contained in a hexahedra before it can be considered valid (expressed as a percentage).

smooth_threshold

the smoothing threshold eliminates noise in the second derivative of the histogram. As the value is increased, you can expect a smoother second derivative.

exception

return any errors or warnings in this structure.