ImageVision case study

ImageVision is a library for image processing which uses the Streams pattern. Image sources and image operations are independent, reusable components connected in a dataflow network.

This network zooms and smoothes an image from disk, displaying and storing the result:

(The arrows denote dependencies, not the flow of data.)

Every node supports the getTile method. For sources, this simply returns a rectangular portion of the image. For operators, this causes them to read a portion of their input image, process it, and output the corresponding portion of the output image. The input to an operator could be another operator; this is transparent because of the getTile protocol.

Node types

There are three types of image source nodes:

Image operators include:


Since processing is demand-driven, simple requests are handled quickly even if the source image or the network is huge. Requests can be made to any node in the network and only the required amount of work will be done.

ImageVision speeds requests by caching the output of each node. Pieces of the requested region which are already in the cache will not be recomputed. This is especially useful for fan-out. When the parameters of an operator node change, the nodes which follow in the network must have their caches invalidated.

Nodes can compute in parallel. For example, a so-called eager node can fill its cache with data that it expects will be needed later. An operator can also break a request into smaller chunks: it requests the next few chunks while processing the current chunk.

Thomas Minka
Last modified: Fri Sep 02 17:20:40 GMT 2005