(!()MI~U'PER GRAPHI('S AND IMAGIiI PROCESSING8, 113-120 (1978)
NOTE An Image Acquisition Device for Minicomputers* S. LEVIiLDI, A. PIRRI
Laboratorio Cibernetica, CIVR, Arco FeIice, Naples, Italy AND V. FR.~NCHIhLk
]flute-Bit, s.r.l., Rome, Italy I~ecelved December 14, 1976 A simple and inexpensive system for static image acquisition by means of a standard telecamera using a 16-bi~ word minicomputer is presented. Its hardware is introduced in terms of a block-diagram description and all the times involved in the acquisition, digitalization, buffel" storage, and gray-level sampling are given. At its maximum eapab i l l t y - - w h e n used with an average sized minicomputer memory--the ¥ I P system (Video Input Processor) is capable of acquiring a 256 X 256 image with 32 gray levels in 1280 msec. The reliability of sucli a system has been tested in terms of successive acquisitions of the same image; quan~it~Live]y, 0.5% is the measured ratio of differently digitized points over the toI~al amount of points. The VIP system has been working satisfactorily for over a year and two versions of this machine are ia use. 1. INTI¢ODUCTION
iVf',my image acquisition devices have been designed and built in the past 10 years for specific L~pplica~ions (for instance, in the biomedice~l field [1, 2]). MIore recently, commercial machines, generally m~nufactured by large opticgl coinparties, are available ; for example, the Quantimet [-3] (produced by IS/lANCe in Great Britain), ~vhieh is used for the acquisition of biological and crystallographic information. In more restricted circulation, but with the gim of having a flexible input for g computer, some research groups have built their own acquisition systems, see, e.g., [4], so as to be able to digitize images coming from very different sources, both on transparencies ~nd on printed paper, generally having a wide range of sizes. I n [5] a number of image devices gre considered gnd compared according to their advantages and disadvantages when used for pattern recognition purposes. Apart from sensitivity considerations, the best optoelectronic transducer is the * A preliminary version of this paper was presented at the Conference on Computer Assisted Scanning, Padova, It:aly, April 1976. 113
0146-664X/78/0081-0113502.00/0 Copyrigh~ ~) 1978 by"Academic Press, Ins. All rights of reproduction in any form reserved.
114
LEVIALI)I, PIRR[, AND FR.ANCHINA
imag(, dissoctor, but f~)r a much lower price, as can be seen in [5, Tabh; I-1, the best tube to be used in a telovision camera is the plumbieon. Since tt commercial T V camera is both a v e r y standard device and '~ rather inexpensive one, we have chosen this input means, which, at the same time, by changing its optical lenses according l;o the needs, can provide us with a v e r y genera] purpose input system. 2. THE VIP SYSTEM I n a general image acquisition system the different devices that are used are the folh)wing: a telecamem, an analog to digitM converter, ~md a milfieomputer. Since we require good resolution and a television raster was chosen for the reasons mentioned above, we faced the problem of sampling the video signM every 128 nsee, which correspmlds to a frequency of nearly 8 1VIttz (more precisely 7.8125 kHz). At such a frequency, analog to digital conversion is both v e r y costly and elaborate, apart from the fact t h a t no minicomputer carl, at present, receive d a t a a t this rate. For such reasons, a different approach has been chosen, nalnely, the use of a fast voltage comparator to which two signals were provided : the video signal (after suitable amplification and filtering) and an established de level which constitutes the stepwise variable threshold. By shifting ,such a de level, different intensity levels may be acquired, so t h a t at the end of a number of raster sequences, for every s~m~pled point of the image we obtain a discrete value whieh is a measure of it.s local intensity value. T h e threshold is driven by a digital to analog converter having 10 bits which, in theory, allows one to obtain 1024 different levels. The 10 bits m a y be either set b y means of a hand knob on the front panel of the V I P sysl:em (see photo ill Fig. 1) or directly fi'()lll the minicomputer. T h e real n u m b e r of possible threshold values is limited by the telec a m e r a system (or b e t t e r by its optoeleetronic tube) but m a y be used to con> pensate for response nonlinearities, to implement a uonline~r gray-lew;1 scale, or to normalize the sampling conditions. B y referring to Fig. 2 we eal~ follow the whole processing of the video signal until a number, in correspondence with the gray value of a sampled point of the image, is obtained. An i n t e r r u p t signal can be generated (either by hand or automatieally), so that the minicomputer selects a threshold level and sends it to the digital to analog converter (whieh is operating within the VIP system) as well as an acquisition request,. The rc.'sponse time of the converter is not critical due to the t i m e intervals which are used during all the acquisition phases. T h e logicaI circuitry in the VIP system acknowledges the request, stores it, aud awaits the first line of the odd field (the raster is interlaced so t h a t two fields, m a k i n g one frame, cover the inaage : an even on(; and an odd one). The odd field is d e t e c t e d b y measuring the time interval between the frame synchronizing pulse and the first line synchronizing pulse which differs according to the field parity due to the interlacing requirements. For a correct acquisitiou we must obviously always consider the same field, otherwise different elements o~ the image will be digitized for each new seamliag of the image. Each scanned line is coded Mto 16 words (of 16 bits each), thus obtaining the required 256 bits per line, each sampled point being 128 nsee distant from its predecessor poi*lt along the line. F()r a time die-
DEVICE FOR MINICOMPUTEIIS
115
Fro. 1. Photograpk of the VIP syslem. g r a m of these pulses, see Fig. 3. A shift register is serially lo~tded with 16 bits and using its p a r a l l d o u t p u t is unloaded on the een~r~l m e m o r y unit of the minic o m p u t e r via the D M A channel. In this way e'_mh line is acquired word b y word and a t i m e interval of 64 #see occurs between the starl;ing p<)ints of any two sueeessive lines. For a complete binary image (of 256 X 256 pixels) a eot,al of 256 groups of 16 words are required needing a buffer lll(qnory of 4I( words for storage. I t m a y also be possible to increase the digil;iz,,ttion fineness by acquiring t;wo sueeessive fields (all odd and an even one), so a mass m e m o r y or into ,mother buffet' memory <)f 4K words. In
LEVIALDI, PIRRI, AND FRANCI-IINA
116
5YNq CLOCH
RST•
STC
LINE 5YNC
CK 9bit IELDG~
l
ACQ SYNC
t~
L FIELD
5YNC
VI EW. ~ GATE INVIDEO ..~
NORM
~ ~, ~
F
L
A
G
I
A/O lout T~A~I CONVERTER
SE~_ IN I
16bit sR
16
O-TIPE ~
LATCH
0UT| C0SVERTERI-~o [./~
B~+15 TO CM
Toov
Fie. 2. Block diagrmn of the VIP interface. order to perform this, 20 msec belonging to the even field are available, a p a r t from the to p and b o t t o m parts of the odd field which are not included in the 256 lines chosen for t h e acquisition (the total number of field lines is 312.5), adding up to an available time of 23.6 meet. If the minicomputer is not able to do this task within this time, the following frame is lost and an extra 40 msec have to elapse before a new acquisition m a y be performed. For a typical acquisition of eight gray levels, 300 msec m u s t be employed if no frames are lost, while 620 msec are required if one frame is lost for each new gray level. Two different interfaces between a VIP system and two corresponding minicomputers have been made, having clock cycles of 980 and 1600 nsec, respectively. The first minicomputer could use its direct m e m o r y access during adjacent clock cycles, while the second one had a direct m e m o r y access that could only be used on alternate clock cycles. In the first case, the 16-bit d a t a words generated by the VIP system were directly sent to a general purpose interface where only one 16-bit register was available and used as a buffer. Since t h e VIP system and the central processing uni t of the minicomputer are n o t synchronized, timing differences may occur, so that one cycle m ay be lost; b u t t h e y are readily absorbed, since two memory cycles, which require 1960 nsec, last for a time which is shorter than the time required to produce a data word from t he VIP system. In the second case, the acquisition is too slow to send the generated d a t a words directly to t he minicomputer, so t ha t the V I P system requires a double buffer of 16 words e~ch. While one of the buffers is loaded by the VIP system, the o t h e r one is unloaded b y the central processing unit, which has an available time of 64 ~see~ which means 4 ~sec per word (each line requiring 16 words). The alternate cycle
DEVICL I LINE SYNC FIELD 5YNC
7
LOAD PULSE
7
UNE COUNTER
2
IF"21
U---LI
255
256
U
i f - ...... - 7 1
17-
.... J ~SET
TO 2 5 6 - K
1. FIELD GATE
]
K
LINE SYNC
1
255
L_j'-~-S LOAD PULSE A L S 0 I _ ] - -
LINE COUNTER___J
~
lJqJ
H 1
255 256
II-LFIU..... - l f l F ' - l f l 2 ' " I Y - 1 J -
EL COUNTER ~ S E T
H
25G
L.J
RST RELEASE 1
CLOC.
I
~
--1U'-LI
117
FOR, MINICOMPUTb][/S
TO 2 5 G - H
~
I
I
15
~
....... SET TO 256-H
16
VIEW GATE)
256
EL COUNTER SEQ 16 GEN SR ADV
RST RELEASE ,/'----'----II 1
2"
I
I
UNLOAn T,ME
I
,/"
1G
1
I
I
116
--'I~/A~--
Fro. 3, Ti,ning dir~grmns of pulse sigmdm
acquisidmt hrs a period of 3.2 usec, which is adeqm~te ,,,s lmlg ~,s n) cycle is l:st during tl~(; proeess. This is not the case in minicmnputers th~'t use direct memory ~ce(~ss w o r k i n g o n alterll'~te
cyclos. 3. T H E VIP A~SSEMBLY
After some exlmrimc'nts in t,he use of VII?, a st~mclard module has been built which c~m be adapted to the minicomputer by adding (or not) the two buffers •rod the logic circuitry for driving them. It is obvious t h a t a VIP system can operate with the two buffers connected to a fast minicomputer, but not the o~her way round. Since the introduction of the buffers increases the complexity of the circuitry by 50%, we have decided to consider two separate versions, since the buffers should be avoided when they are not necessary. The VIP system is assembled in a five-unit standard rack, and has a "television monitor" (refer to Fig. 1) on which the working area is superimposed electronically (blanking ~he electron beam when outside the acquisition area). On the television tube all the different gray levels m a y be visualized by moving a front pc,nel switch so ttmt only the light iutensity values above threshold m~y be seen. This facility is used for finding the optimal illumin,.~tion on the smaple pzttern to be digitized. The p s t t e r n m.~y be on a positive print (reflection illumination) or on a transparency (t.rmlsmission illumittation) according to the particular t:,sk. 4. VIP PERFORMANCE
So as to give sm~e figures for the reliability of our system we have digitized an image with one threshold (bim~ry image) mid repeated this acquisition for the
118
LEVIALDI, PIR[~I, AND FRANCHINA
same image and for images having the s~une object with different sizes. We then plotted the percentile variation of black points (1-elements) over the t,ot~d number of 1-elements as we may see on the graph of Fig. 4. 5. VIP IMAGE ACQUISITION So 'as to be able to appreci~te the effectiveness of the VIP system there is no better way than to look at a picture. In Fig. 5 we see a reproduction of Van Gogh's portrait and its digital printout using eight gray levels. The printout uses gray scale which is shown on the bottom of the figure and is made with a convenient set of ASCII (extended) characters. Some experiments oi1 line'~r and logarithmic gr~y scales have been recently performed ~md are reported irl [-6]. 6. VIP DEVELOPMENTS
At present we ~re working toward the expansion of' the possibilities of the system along the following directions : (~) Increasing the resolution toward a 512 >< 512 element image, perhaps with a different optoelectronic device. (b) Color image acquisition, which involves no substantial modifications but only three different and successive acquisitions according to the three primary colors (a color camera has been avoided because of the high cost involved). (c) Choice of solid-staLe photo matrices or other different transducers so ~s to substitute for ~he TV camera a more reliable device, withou~ really increasillg the cost of the system. 7. CONCLUSIONS
We wish to stress t h a t ~he main features of the VIP system (of which there are two operating at present, one at the Gruppo Elaborazione Fornqe, Laboratorio di Ciberl~etic~, CNR, Arco Felice, and the other at Laboratorio Technologic Biomediche CNR, Rome) are low cost (under $3000 U.S.A. including the TV
MAX O~e 0~4 | 0,9 O*8 0.7 C[6 ~5 0.4 O.3
0,1 o o
5~(
lOB(
I~l(
201(
~1(
30K
35~(
40X
4SK
SOK
5~4
6OI4
6SK
POINTS
Fzc~. 4. E×perinmnta[ (bd,~ showing maxhmun error percentile vel'mls number of acquil'ed l-elements.
DEVICE FOIl MINICOMPUTEIIS
GRnY
L E'~EI.~
mmmmm~.~s~...~*..si.*..o.*°* .o..+° m m m m m 1 ~ s . ~ * s s s ~ . . . . . . o . ° . . . * * * * . . ~
.* .............. .*~ ......
+~+**~ **.~...~.*+++
................ ..............
~, :,,,,, - ' ':, .............. ,,, ,1 *,, *,,,:: ..............
c
Fro. 5. (a) Inpul; image, (b) digitized image, (c) 8-gray-level scale.
119
120
LEVIALDI, PIIIRI, AND FRANCHINA
c a m e r a with a vidieon tube) and simplicity (assembly of c o m p o n e n t s can be p e r f o r m e d in less t h a n one m o n t h b y one m a n ) . I t s speed, which is 40 mseo per g r a y level on a 256 X 256 image, is convenient for m o s t applications, and t h e 16-bit word o r g a n i z a t i o n of the d a t a makes it particularly suitable for m o s t minic o m p u t e r s t h a t h a v e words of this length. ACKNOWLEDGMENTS W e are t h a n k f u l to S. Acciarino and F. D i Franco for the writing and testing of software, and to U. Caseini and S. Piantedosi for the careful p r e p a r a t i o n of t h e illustrations. REFERENCES I. R. S. Ledley, L. S. Rotolo, T. J. Gol~b, J. D. Jacobsen, M. D. Ginsberg, and J. B. Wilson, FIDAC : Film Input to Digital Automatic Computer and associated syntax-directed patternrecognition progran'lming system, in Optical and Electro-Optical Information Processing (J. T.
Tippett, Ed.), pp. 591-613, MIT Press, Mass., 1965. 2. K. Preston, Jr., The CELLSCAN system, a leucocyte pattern analyzer, in Procee:lings of the Western Joint Computer Conference, [961, pp. 173-183. 3. C. Fisher, The New Quantimet 720, The Microscope 19, 1971, 1-20. 4. J. Dernalowicz, NI. Chielewski, W. Jarosinski, and A. Dernalowicz, System cyfrowego przetawazania obrazow CPO-2/K-202, Institute of Bieeybernetics mid Biomedical Engineering Reports, Warsaw, 1976. 5. G. Palmieri~ Image devices for pattern recognition, Pattern Recognition 3, 1971, 157-168. 6. F. Di Franco, S. Levialdi, A. Pirri, and G. Sanniti di Baja, Un sistema per I'acquisizione di immagini a pifl livelli di grigio, in Proceedings of the Fourth National Congress on Cybernetics and Biophysics, ~ien% October 1976, in press.