May
2006, Issue 190
Image
Processing for Robots
Renesas
M16C Platform Design Contest 2005
DATA
COMPRESSION
Captured
data is transmitted through the RS-232 cable to the
PC’s COM port. Because of the normal COM port’s limited
bandwidth (115 kbps maximum), more time is needed for
transmission than for picture capturing.
Simple
picture storage won’t work because of the huge RAM requirements.
A possible solution is to compress the incoming pixel
data. It’s important to balance compression and transmission
time (see Photo 3).
|
a)

b)

c)
(Click
here to enlarge)
|
Photo
3—Take a look at the block truncation coding results.
I think the compression rates and image qualities
are acceptable. A JPEG would be better, but the
fixed compression rate of the BTC is easier to implement. |
The
JPEG algorithm is often used for data compression, but
the compression rate depends on the picture and the
calculation isn’t easy. I used block truncation coding
(BTC) to obtain a fixed compressed data stream. It was
much easier than a JPEG algorithm. The BTC is based
on the correlation between the picture (pixel) data
in the i and j coordinates.
A
defined block of pixels (8 × 8 pixels) is calculated
as a macro cell block (MCB). First, the average value
of a MCB is computed. The average value µ is the level
for binary digitalization of all of the pixel values.


This
equation computes the binary values for the MCB. In
the ideal BTC, the so-called standard deviation gives
a value for calculating two intensity values: a and
b. The former is the average dark value. The latter
is the average light value. The standard deviation is:
The
intensity values are:

Instead
of using the exact value of the standard deviation,
the average of the pixel intensities for the MCB’s dark
and light areas is taken.
The
BTC results aren’t as good as a standard JPEG compression.
But it’s easier to implement, and it has an exact timing
behavior. In the example, the compression rate of 6.4:1
is independent from the image content. That’s why it
needs well-defined memory space and computation power.