Playing With Electricity: QL Digitizer

See all articles from CATS v6 n3
Author(s): Harvey Taylor
Publication: CATS Newsletter
Pub Details: CATS v6 n3 (Volume 6, Issue 3)
Date: July 1988
Pages: 5

In May/June/87 Byte magazine, Steve Ciarcia described a video digitizer project. After a good deal of hesitation, I decided to go with this system on my QL. The deciding factor in my mind was that I could use this system with any computer with a serial port. The digitizer itself is well described in those articles so I will only discuss the software I have written to drive the board.

Getting the Circuit Cellar Inc. digitizer to use with the QL meant that I had to write a software driver to control the board & display the information received. To begin at the beginning, this turns out to be another case where one runs afoul of the cheap SERial ports on the QL. Specifically, the board transmits data at the North American norm of 8 data bits, no parity, 1 stop bit.

The problem which arises is that at high speed (read 9600 baud), the QL wants at least 1 1/2 stop bits. This means that until I am able to modify the initialization sequence of the CCI board to use 2 stop bits, I must transfer data from the CCI board to the QL at a mere 2400 baud. A video field is digitized to 62464 bytes. At 2400 baud, it takes about 4 or 5 minutes to transmit the whole field. It only seems like forever.

The CCI board digitizes to 6 bits [0-63], while the QL displays at most 3 bits [0-7]. One of the first requirements then, was to define a method of Mapping the 0-63 CCI range into the QL 0-7 range. I wrote a function which takes either preset values (Linear, Square & Exponential) or User defined values and uses them as Limits to define the Mapping process. The colours which are used can be simply 0-7 or set up any way one wishes.

Once you have the information in the computer, it is useful to be able to analyze it. One of the primary methods which is used in the Image Processing world is with a special graph called a Histogram. This is a plotting of Pixel values [ 0-63 in this case ] versus number of pixels. A quick look at this graph will tell you where the values of your screen are bunched.

The fun starts when once you have the information in the computer you can begin to modify it. There are a variety of mathematical filters described in the literature. (See the bibiography below.) Among these are Low & High Pass, Laplace edge enhancement and median value filters. One might also wish to spread the Histogram out so that the full range of shades is used. This might look like a similar operation to choosing a narrow mapping, however once you have modified the data you can apply the other filters to the data in a way which only changing the mapping does not allow.

In all of these processes it is all too easy to generate garbage. One must try different techniques to see comes out. If the Black/White settings on the CCI board are set too closely together, it is difficult to do much of anything with the narrow range of values produced.

The File SpStLogo.pic contains the raw data of the Space Station Logo, a spacesuited figure in the Leonardo universal man pose. This is a 244 X 256 array of data points 0-63. There is a bit of garbage in the bottom couple lines.

Bibliography:

Steve Ciarcia – Byte Magazine, May/June/87
Image Processing – Byte Magazine Theme, March/87
Gregory Baxes – Digital Image Processing, Prentice-Hall, 1984
William Green – Digital Image Processing, Van Nostrand Reinhold, 1983