Image Generation and Shape Recognition Toolkit

Mike Schauf and Selim Aksoy
Intelligent Systems Laboratory
Department of Electrical Engineering
University of Washington
Seattle, WA 98195-2500
{mschauf, aksoy}@ isl.ee.washington.edu

Version: 1.00



This package is intended to provide a test data set with known groundtruth to evaluate binary shape recognition algorithms. It includes code for generation of primitives and shape prototypes as the groundtruth model set, and perturbed images containing translated and scaled prototypes as the test data set.

The program starts with the generation of shape models. A shape model is composed of a set of primitives. Each primitive is mildly constrained so that its digital image bears a reasonable resemblance to the ideal continuous primitive. The primitives for this data set are lines, circles, triangles, sectors, and quadrilaterals. Each primitive has some restriction on its free parameters in order to retain its general properties. These restrictions and some example primitives are given below.

Table: Primitive constraints.
TYPE PARAMETER
Triangle Angles > 30 degrees
  Side Lengths > 30 pixels
Quadrilateral Angles > 30 degrees
  Side Lengths > 30 pixels
Circle Radii > 30 pixels
Sector Radii > 30 pixels
  Angles > 30 degrees
Lines Lengths > 30 pixels
  Widths > 3 pixels

Example primitives
Figure: Example primitives.

The different primitives are randomly selected, generated and combined to form the different shape models. Each shape model is constrained so that each primitive slightly overlaps another. Once the shape models have been generated, they are randomly selected to be placed in an image. Each selected shape model is placed in the image at a random location with a random scale with the only constraint that its bounding box does not overlap with any other shape model's bounding box that is already in the image. Since we know the locations and scales of the models in all images, we have the complete groundtruth.

Testing the robustness of recognition algorithms also requires the design of images containing varying levels of noise. For the addition of noise, the Document Degradation Model (DDM) Package by Tapas Kanungo at UW ISL is used. This package adds pepper noise in such a way that pixels around the borders of the shape models have a higher probability of switching to opposite values than those pixels farther away from the border. Additional noise is added by generating non-relevant shape models and scaling them smaller than the smallest scale of the relevant models. Some example noisy images are given below. Model and image sizes, overlap between primitives in a model, range for the number of primitives in a model, range for the number of models in an image, range for the scales of models in an image, and noise level are some of the parameters that are allowed to be changed in the code.

Noisy images
Figure: Noisy images.

The package also includes a program for performance evaluation. The output of the program is a confusion matrix and a success score for the recognition algorithm. The program reads the groundtruth information for each image and compares it with the recognition results. The success value is a linear combination of the correct detection rate, incorrect detection rate, misdetection rate, false alarm rate, and the accuracy of the detected location and scale. The definitions for these evaluation criteria are given in the user's manual included in the package. You can use this evaluation code with any recognition algorithm provided that the output of the recognition algorithm is a text file with the format described in the user's manual.

We also included the code for the binary shape recognition algorithm that we presented in ICPR'98. The paper introduces a size invariant method to recognize complex two-dimensional shapes using multiple generalized recursive erosion transforms. The method accomplishes the same kind of recognition that templates of each shape at multiple scales would do, but the method takes constant time per pixel regardless of the scale of the prototype. The method also works on noisy images without requiring noise removal as preprocessing.

Details of the algorithms for both image generation and shape recognition can be found in Mike Schauf's thesis.

This software is written in C and developed under Unix environment. A Unix makefile is provided to facilitate the compilation process. The following files are available for download:


Copyright 1999, Intelligent Systems Laboratory,
University of Washington.
Last updated on February 2, 1999 by Selim Aksoy.
Please send your comments to aksoy@isl.ee.washington.edu.
This page has been visited times.