3ImageMagick Image Segmenting utility,


Segment




Contents










Synopsis

U
segment [ options ... ] input_file output_file


*Back to Contents






Description

A
segment segments an image by analyzing the histogramsBof the color components and identifying units that are homogeneous9with the fuzzy c-means technique. The scale-space filter<analyzes the histograms of the three color components of the;image and identifies a set of classes. The extents of each0class is used to coarsely segment the image with6thresholding. The color associated with each class is5determined by the mean color of all pixels within the9extents of a particular class. Finally, any unclassifiedJpixels are assigned to the closest class with the fuzzy c-means technique.

9The fuzzy c-Means algorithm can be summarized as follows:





>

The fuzzy c-Means technique attempts to cluster a pixel by<finding the local minima of the generalized within group sum<of squared error objective function. A pixel is assigned to5the closest class of which the fuzzy membership has amaximum value.

For additional information see:

; Young Won Lim, Sang Uk Lee, "On The Color Image6 Segmentation Algorithm Based on the Thresholding and9 the Fuzzy c-Means Techniques", Pattern Recognition,+ Volume 23, Number 9, pages 935-952, 1990.



*Back to Contents






Examples

+
To segment an image of a cockatoo, use:
?  segment cockatoo.miff cockatoo.segmented
*
To segment a raw grayscale image, use:
N  segment -size 768x512 gray:raw image.miff



*Back to Contents






Options 


,
-cluster_threshold value.
eliminate clusters that are insignificant.

8

The number of pixels in each cluster must exceed the2the cluster threshold to be considered valid. Thedefault is 1%.

%

-colorspace valueM
the type of colorspace: GRAY, OHTA, RGB, XYZ,6YCbCr, YIQ, YPbPr, or YUV.

7

Color reduction, by default, takes place in the RGB.color space. Empirical evidence suggests that7distances in color spaces such as YUV or YIQ correspond4to perceptual color differences more closely than do4distances in RGB space. These color spaces may give6better results when color reducing an image. Refer to.quantizefor more details.

#

-comment string%
annotate an image with a comment.

;

By default, each image is commented with its file name.3Use this option to assign a specific comment to the6image. Optionally you can include the image filename,1type, width, height, or scene number by embeddingCspecial format characters. Embed %f for filename, %mJfor magick, %w for width, %h for height, %s for scene/number, or \n for newline. For example,
   -comment "%m:%f %wx%h"
I
produces an image comment of MIFF:bird.miff 512x480 for;an image titled bird.miff and whose width is 512 andheight is 480.

D

If the first character of string is @, the image3comment is read from a file titled by the remainingcharacters in the string.

-compress type3

the type of image compression: Zlib orRunlengthEncoded.

<

Specify +compress to store the binary image in an4uncompressed format. The default is the compression!type of the specified image file.

I

-density <width>x<height>>
vertical and horizontal resolution in pixels of the image.

:

This option specifies an image density when decoding a5Postscript or Portable Document page. The default is172 pixels per inch in the horizontal and vertical direction.

D

-display host:display[.screen]7
specifies the X server to contact; see X(1).

-font name2

This option specifies the font to be used for5displaying normal text. The default is fixed.

#

-interlace typeN
the type of interlacing scheme: NONE, LINE, or PLANE.

:

This option is used to specify the type of interlacingKscheme for raw image formats such as RGB or YUV. NONE;means do not interlace (RGBRGBRGBRGBRGBRGB...), LINEuses scanline interlacing=(RRR...GGG...BBB...RRR...GGG...BBB...), and PLANE uses0plane interlacing (RRRRRR...GGGGGG...BBBBBB...).

H

Use LINE, or PLANE to create an interlaced GIF !or progressive JPEG image.



-label name!
assign a label to an image.

5

Use this option to assign a specific label to the6image. Optionally you can include the image filename,4type, width, height, or scene number in the label by:embedding special format characters. Embed %f for>filename, %m for magick, %w for width, %hDfor height, or %s for scene number, or \n for newline. For example,
   -label "%m:%f %wx%h"
G
produces an image label of MIFF:bird.miff 512x480 for;an image titled bird.miff and whose width is 512 andheight is 480.

J

If the first character of string is @, the image label6is read from a file titled by the remaining charactersin the string.

5

When converting to Postscript, use this option to1specify a header string to print above the image.



-matte-
store matte channel if the image has one.

Ž

-page <width>x<height>{+-}<x offset>{+-}<y offset>7
preferred size and location of the Postscript page.

4

Use this option to specify the dimensions of the4Postscript page in pixels per inch or a TEXT page in7pixels. The default for a Postscript page is to center1the image on a letter page 612 by 792 pixels. The5margins are 1/2" (i.e. 723x935+42+42). Other common sizes are:
   Letter      612x 792   Tabloid     792x1224   Ledger     1224x 792   Legal       612x1008   Statement   396x 612   Executive   540x 720   A3          842x1190   A4          595x 842   A5          420x 595   B4          729x1032   B5          516x 729   Folio       612x 936   Quarto      610x 780   10x14       720x1008
:
For convenience you can specify the page size by media(e.g. A4, Ledger, etc.).

5

The page geometry is relative to the vertical and/horizontal density of the Postscript page. See-density for details.

<

The default page dimensions for a TEXT image is 723x935.

"

-quality value
JPEG quality setting.

:

Quality is 0 (worst) to 100 (best). The default is 72.

-scene value
image scene number.

a

-size <width>{%}x<height>{%}{+offset}{!}"
width and height of the image.

:

Use this option to specify the width and height of rawDimages whose dimensions are unknown such as GRAY, RGB,Cor CMYK. In addition to width and height, use -size Eto skip any header information in the image tell the number of colors6in a MAP image file, (e.g. -size 640x512+256).

.

-smoothing_threshold value>
eliminate noise in the second derivative of the histogram.

8

As the value is increased, you can expect a smoother'second derivative. The default is 1.5.



-verbose/
print detailed information about the image.

;

This information is printed: image scene number; image4name; converted image name; image size; the imageGclass (DirectClass or PseudoClass); the total number4of unique colors; and the number of seconds to readand convert the image.



@
Options are processed in command line order. Any option you9specify on the command line remains in effect until it is8explicitly changed by specifying the option again with adifferent effect.

@

Change '-' to '+' in any option above to reverse its effect.:For example, specify +matte to store the image without itsmatte channel.

;

By default, the image format is determined by its magic9number. To specify a particular image format, precede the4filename with an image format name and a colon (i.e.:ps:image) or specify the image type as the filename suffixA(i.e. image.ps). See convert(1) for a list of valid imageformats.

B

When you specify X as your image type, the filename has:special meaning. It specifies an X window by id, name, orAroot. If no filename is specified, the window is selected,by clicking the mouse in the desired window.

8

Specify input_file as - for standard input,output_file as -Kfor standard output. If input_file has the extension .Z orL.gz, the file is uncompressed with uncompress or gunzipErespectively. If output_file has the extension .Z or .gz,Ethe file size is compressed using with compress or gzip:respectively. Finally, precede the image file name with |$to pipe to or from a system command.

@

Use an optional index enclosed in brackets after a file name9to specify a desired subimage of a multi-resolution imageEformat like Photo CD (e.g. img0001.pcd[4]) or a range for MPEG images(e.g. video.mpg[50-75]).

F

If output_file already exists, you will be prompted as to!whether it should be overwritten.





*Back to Contents






Environment 



DISPLAY8
To get the default host, display number, and screen.



*Back to Contents






Copyright

7
Copyright 1995 E. I. du Pont de Nemours and Company:Permission to use, copy, modify, distribute, and sell this8software and its documentation for any purpose is hereby6granted without fee, provided that the above copyright8notice appear in all copies and that both that copyright6notice and this permission notice appear in supporting4documentation, and that the name of E. I. du Pont de1Nemours and Company not be used in advertising or4publicity pertaining to distribution of the software:without specific, written prior permission. E. I. du Pont9de Nemours and Company makes no representations about the4suitability of this software for any purpose. It is5provided "as is" without express or implied warranty.

9

E. I. du Pont de Nemours and Company disclaims all 8warranties with regard to this software, including all 8implied warranties of merchantability and fitness, in no:event shall E. I. du Pont de Nemours and Company be liable9for any special, indirect or consequential damages or any6damages whatsoever resulting from loss of use, data or8profits, whether in an action of contract, negligence or6other tortuous action, arising out of or in connection-with the use or performance of this software.


*Back to Contents






Acknowledgements

G
Andy Gallo, University of Delaware. This software is&strongly based on software Andy wrote.


#Back to Contents






Authors

;
John Cristy, D cristy@dupont.com E.I. du Pont de Nemours and CompanyIncorporated.


#Back to Contents


4[home page]