CSEP 576 Computer Vision Winter 2008

Course Software


Downloading packages

Package descriptions

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 diameter
  • makeelement ring diameter

    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


    canny_edge Produces an edge image in PGM format where graylevel 0 represents edge pixels and graylevel 255 represents background. Note that there is no default setting for the parameters and also the name of the output file is determined automatically (see the example below).

    Required parameters:
    image
    An image to process. Must be in PGM format.
    sigma
    Standard deviation of the gaussian smoothing filter.
    tlow
    Specifies the low value to use in hysteresis. This is a fraction (0.0-1.0) of the computed high threshold edge strength value.
    thigh
    Specifies the high value to use in hysteresis. This fraction (0.0-1.0) specifies the percentage point in a histogram of the gradient of the magnitude. Magnitude values of zero are not counted in the histogram.
    Optional parameters:
    writedirim
    Optional argument to output a floating point direction image.

    Implements the following Canny edge detector steps:
    1) Convolve the image with a separable gaussian filter.
    2) Take the dx and dy the first derivatives using [-1,0,1] and [1,0,-1]'.
    3) Compute the magnitude: sqrt(dx*dx+dy*dy).
    4) Perform non-maximal suppression.
    5) Perform hysteresis.
    Also optionally outputs a floating point RAW headerless file of the edge gradient "up the edge" where the angle is defined in radians counterclockwise from the x direction.

    Example:

    canny blocks.pgm 0.60 0.50 0.90

    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


    Last updated on  .