CSE 576: Image UnderstandingAutumn 1998Instructor: Linda Shapiro |
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: 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: 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: 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: 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.
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.
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.
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.
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.
Example: ort2image < blocks.ipg > blocks_drawn.pgm |