next up previous
Next: Locating the Flippers Up: Initial Design Previous: Initial Design

Image Subtraction

An image subtraction algorithm is used in this project to recognize a moving object. The major reason for using this algorithm is that it is simple and can be implemented by the limited real-time processing capabilities of the image processing board. It turned out to work acceptably well. This method is used for recognizing the pinball and flippers. It simply compares the previous frame image with the current one. The result of the subtraction is visible from the monitor, which shows the same data as is ``seen'' by the computer, i.e. if something is moving, then a white pixel shows up on the screen in that position.

The two most recently acquired frames are subtracted in real time (continuous subtraction) using the FG-100-V image processing module. In the operating mode shown in Figure 5 ([1]), the MUX (multiplexer) control bits are set to Mode 6; specifying that it is to input LUT select bits in the LUT six most significant memory bit-planes and the six most significant bits of data from the A/D (the analog-to-digital) converter to the Feedback/Input LUT (Look-Up Table).

Figure 5: Real-Time Subtraction Using Mode 6

In order to do this real-time operation, the LUT is programmed to update each pixel in the frame memory as follows ([1]):

  1. Subtract the six most significant bits of A/D data (A/D [7-2]) from that currently in the six most significant bits of frame memory (MEM [11-6]).
  2. Store the resulting six bits in the least significant bits of frame memory.
  3. Move the six bits from the A/D to the top of the pixel (making them the six most significant bits).

These operations are done in parallel, using the input data (frame memory pixel and video input) to index the new pixel.

A simplified example in Figure 6 illustrates how real-time subtraction is implemented. This example has 4 bit planes instead of 12: 2 bits for A/D and 2 bits for memory. For example, the values 10 (binary) for A/D and 11 (binary) for MEM go to the LUT. The programmable input LUT maps the concatenation of the old and new A/D values into the concatenation of the new A/D and output value. This output value is the function THRESHOLD( ABS(OLD-NEW) ), where THRESHOLD(X) is ``If X is greater than or equal to the threshold value, the output will be 11, otherwise the output will be 00.'' In other words, if the result of subtraction is greater than equal to the threshold value, 10, then the output value will be 11 , otherwise it will be 00.

Now the value 11 is displayed as a white pixel, which represents a part of a moving object and the value 00 is displayed as a black pixel which is the normal background of the screen. Two bits from A/D (10 in the example) and the result of subtraction (01 in the example) go to the frame memory. The top two bits from A/D will be taken as memory bits for the next frame processing and the bottom two bits from THRESHOLD(MEM-A/D) will be displayed. However, what is stored in the LUT is the output value, 1000 as circled in Figure 6 , not A/D with the result of subtraction, which is 1001.

Figure 6: Example of 4-bit LUT ( d = TRESHOLD(MEM-A/D) )

next up previous
Next: Locating the Flippers Up: Initial Design Previous: Initial Design

Ted &
Wed Feb 5 10:50:20 EST 1997