Page 237 - Introduction to AI Robotics
P. 237
220
6 Common Sensing Techniques for Reactive Robots
light, so the camera device can either have many frame buffers, which create
a pipeline of images (but is expensive), or have a low frame rate.
FRAMEGRABBER A framegrabber is a card which fits inside a computer, accepts analog cam-
era signals and outputs the digitized results. The card has a software driver
which allows the robot software to communicate with the board. Framegrab-
bers can produce a grayscale or a color digital image. In the early part of
the 1990’s, color-capable framegrabbers were prohibitively expensive, cost-
ing around $3,000 USD. Now color framegrabbers can be purchased from
$300 to $500 USD, and TV tuners which can capture a single frame are avail-
able for $50 USD.
6.6.2 Grayscale and color representation
The framegrabber usually expresses the grayscale value of a pixel as an 8 bit
number (1 byte of computer memory). This leads to 256 discrete values of
gray, with 0 representing black and 255 representing white. (Remember, 256
values means 0...255.)
Color is represented differently. First, there are many different methods of
expressing color. Home PC printers use a subtractive method, where cyan
plus yellow make green. Most commercial devices in the U.S. use a NTSC
(television) standard. Color is expressed as the sum of three measurements:
RGB red, green, and blue. This is simply abbreviated as RGB.
COLOR PLANES RGB is usually represented as three color planes, or axes of a 3D cube as
shown in Fig. 6.11. The cubic represents all possible colors. A specific color
is represented by a tuple of three values to be summed: (R, G, B). Black is
(0,0,0) or 0+0+0, or no measurements on any of the three color planes. White
is (255, 255, 255). The pure colors of red, green, and blue are represented
by (255,0,0), (0,255,0), and (0,0,255) respectively. This is the same as in color
graphics.
Notice that the cube dimensions in the figure are 256 by 256 by 256, where
256 is the range of integers that can be expressed with 8 bits. Since there
are three color dimensions, a manufacturer may refer to this as 24-bit color
(3 x 8), to distinguish their framegrabber from ones which map color onto a
linear grayscale. The 8-bit color model is what is used to colorize old black
and white movies. There are only 256 values of color, which is quite limited,
and the gray values are often ambiguous. The pixel values of a person’s red
lips might be 185, while their dark blue dress is also 185. A person may
have to indicate which regions in each frame of the film where 185=red and
185=dark blue. 8-bit color is not often used for robots, unless the robot will