CSE 576: Image Understanding

Autumn 1998

Instructor: Linda Shapiro
TA: Doug Zongker


Course Software

Download packages

The source and binary archives were last updated on 23 October 1998. The archives now include the fixed version of ppmview, and have the updated version of conrgn needed for Assignment 2, and the fixed canedg.

Package descriptions

Viewing images

ppmview Shows a PPM or PGM image on the screen. Run with one or more image filenames as arguments. ppmview will only read images in the raw version of the format, not the ASCII version.

You can read more about the PPM/PGM image file formats.

Example:

ppmview blocks.pgm

Basic manipulation

thresh Thresholds a gray scale PGM image to a binary PGM image.

Use as:

  • thresh lo hi inputfile

    If "-" (a single hyphen) is given as inputfile, input is read from stdin. This program produces a new image (on stdout) of the same size as the input image. Every gray pixel between lo and hi (inclusive) becomes white (255); all others become black (0).

    Example:

    thresh 100 150 blocks.pgm > blocks_thresh.pgm
  • conrgn Labels 4-connected components in a binary PGM image.

    Use as:

  • conrgn [g|c] inputfile

    If "-" (a single hyphen) is given as inputfile, input is read from stdin. The output image (on stdout) will be black where the input image is black. Each nonblack pixel in the input image will be given a new grayscale output value that labels its connected component. If the image has fewer than 256 connected components, the program will output a grayscale PGM image, with each gray level (except 0) representing a component. If there are more than 255 connected components, the program will output a color PPM image, with each unique color representing a component. Giving a "g" or "c" argument before the input filename forces the output to be either grayscale or color. Forcing grayscale output when there are more than 255 regions will cause some labels to be reused.

    Example:

    conrgn c blocks_thresh.pgm > blocks_reg.ppm
  • autocolor Recolors a grayscale PGM image to make a color PPM image.

    Use as:

  • autocolor inputfile

    If "-" (a single hyphen) is given as inputfile, input is read from stdin. This program takes a grayscale image as input and produces on stdout a color PPM image of the same size as output. Each unique gray level in the input (except black) is mapped into a unique color. Black pixels are left alone. This program is most useful for viewing the output of conrgn.

    Example:

    autocolor blocks_reg.pgm > blocks_reg.ppm
  • makeelement Creates various simple binary PGM images.

    Use as:

  • makeelement box width height
  • makeelement disk radius
  • makeelement ring radius

    This produces (on stdout) various simple binary PGMs of various shapes. You may find these useful as structuring elements for binary morphology operations (which you'll have to code for assignment 1).

    Example:

    makeelement disk 9 > disk9.pgm
  • Edge detection

    canedg Produces an edge pixel list from a grayscale image.

    Required parameters:
    -i input PGM format image
    -o output edge pixel description file
    Optional parameters:
    -s float sigma value for convolution (default 0.4)
    -m int size of convolution mask (default sigma*4)
    -lt float low threshold value (default 1.4)
    -ht float high threshold value (default 2.0)
    -sp print sub-pixel localized values (default false)

    The subroutine only looks at those pixels which gradients are greater than the low threshold. If the gradient is greater than the high threshold, then the pixel is placed into a linked list for later processing (join edges). So the low threshold is used to reduce the processing time while high threshold controls the number of edges possibly extracted.

    Example:

    canedg -i blocks.pgm -o block_edgelist.txt
    edge_filter Converts an edge pixel list into a binary image.

    Required parameters:
    -i input edge pixel description file
    -o output PGM format binary image
    -r int number of rows in output image
    -c int number of columns in output image
    Optional parameters:
    -l int minimum length of edges (default 5)

    Example:

    edge_filter -i block_edgelist.txt -o block_edges.pgm -r 256 -c 256

    Object Recognition Toolkit

    chainpix Produces a chained pixel list from a PGM binary image.

    Takes input from stdin and writes output to stdout. See the output format here.

    Example:

    chainpix < blocks.canny.pgm > blocks.cpx
    fex Segments chained pixel lists produced by chainpix into straight-line segments and circular arcs.

    Takes input from stdin and writes output to stdout. See the output format here.

    Example:

    fex < blocks.cpx > blocks.fex
    lpeg Low-level straight-line grouping. Groups straight-line segments produced by fex into parallel line pairs and various kinds of line junctions.

    Takes input from stdin and writes output to stdout. See the output format here.

    Optional parameters:
    -r int minimum line length
    -t int max angle between two "parallel" lines
    -q float minimum acceptable quality level

    Example:

    lpeg < blocks.fex > blocks.lpg
    ipeg Intermediate-level grouping. Groups the sets produced by lpeg into triplets, corners, and polygons.

    Takes input from stdin and writes output to stdout. See the output format here.

    Optional parameters:
    -t triplets only
    -c corners only
    -p closed polygons only

    Example:

    ipeg < blocks.lpg > blocks.ipg
    ort2image Takes the output of fex, lpeg, or ipeg, and draws the straight-line and circular arc segments, producing a PGM image. Takes input from stdin and writes output to stdout.

    Optional parameters:
    -r int # of rows
    -c int # of columns
    -b int background intensity
    -l int int int intensity, line thickness, endpoint intensity (for lines?)
    -i int int int intensity, line thickness, endpoint intensity (for curves?)
    -m int minimum length
    -L line segments only
    -C curved segments only

    Example:

    ort2image < blocks.ipg > blocks_drawn.pgm