Professional Documents
Culture Documents
VISION,
GRAPHICS,
AND
IMAGE
PROCESSING
NOTE
Implementation of Cellular-Logic Operators Using 3 * 3
Convolution and Table Lookup Hardware
FRANS A. GERRITSEN
Informatics
Division,
National Aerospace
Laboratory
NLR,
1059 CM Amsterdam,
The Netherlands
Anthony
Fokkerweg
2,
AND
PIET W. VERBEEK
Pattern
Recognition
of Technology,
$3.00
116
GERRITSEN
AND VERBEEK
12S systems) do not include hardware specialized in cellular-logic operations. Instead, configuration options which may be incorporated into the processing loops of
such systems include lookup tables for pixel-by-pixel table lookup and also multiplication and addition hardware for (almost) real-time convolution of the image array
with a 3 * 3 filter-coefficient convolution kernel.
The purpose of this paper is to show that such commercially available image
processing systems may be programmed in a straightforward way to execute nonlinear cellular-logic operations with the same speed (and using the same hardware) as
the 3 * 3 linear filter convolutions.
As a result, the applicability of these hardware options (until now limited to
enhancement and other preprocessing) is extended into the fields of processing and
measurement of objects in the segmented image.
2. IMPLEMENTATIONS
OF THE CELLULAR-LOGIC
OPERATORS
As far as the authors are aware, the literature shows that the cellular-logic
operators may be implemented by using special-purpose hardware in one of three
(major) different ways: the neighborhood table lookup approach, the processor-array
approach, and the run-list processing approaches. These approaches will be discussed in the following sections.
2.1. The Neighborhood
The neighborhood table lookup approach (which is used in, e.g., GLOPR, diII3,
PICAP-1, TAS, Cytocomputer, and DIP-l) is illustrated in Fig. 1. In binary images,
512 possible 3*3 neighborhood configurations exist. By using shift registers, the
9-bit binary data of every 3 * 3 neighborhood are assembled and used as address for
table lookup in a 512-entry table memory. The contents of the table memory
determine the nature of the operation applied. Preferably, this table memory should
be writable (e.g., from a host computer).
This method of implementation is ideally suited for raster-scan-oriented applications, because (after an initial delay) results are produced at the same rate in which
operands are entered: every time a new binary pixel is shifted into the shift register,
the 3 * 3 neighborhood is translated by one position in the direction of the scan and
a new result becomes available at the output of the table memory.
Variations on this method include: hexagonal raster scanning (using 128 distinct
configurations, or 14 if only quasi-rotation-invariant
operators are allowed; originally proposed by Golay and used in GLOPR, diII3, and TAS); pipelining of
multiple stages of lookup tables (used in Cytocomputer, among other reasons, to
emulate neighborhoods larger than 3*3); the use of concurrent multiple table
lookup (illustrated in Fig. 1 and used in DIP-l), for instance to transform a binary
image into a 4-bit image, of which 1 bit indicates the presence of a binary contour
and the remaining 3 bits of each resulting pixel give the Freeman chain code of the
contour; the combination of nonrecursive table lookup as described with recursive
table lookup (proposed by Rosenfeld and Pfaltz [17]), e.g., for topology-preserving
thinning (Hilditchs method [18], used in modified form in DIP-l).
In general-purpose computers the shift registers may be circumvented by assembling the 9-bit address by sequentially OR-ing versions of the binary operand image
that have been shifted, both in position and in bitplane.
IMPLEMENTATION
OF CELLULAR-LOGIC
OPERATORS
117
SERIAL OUTPUT OF
RESULTING PIXELS
( K BIT/PIXEL L
CELLULAR - LOGIC
LOOK - UP TABLE
TAPSP*,.
., P.
from shift re&er
SHIFT REGISTER
SHIFT REGISTER
CURRENT
BINARY
NEIGHBORHOOD
SERIAL INPUT
OF BINARY PIXELS
OF SEGMENTED
IMAGE
( 1 BIT/PIXEL,
N PIXELSPER LINE )
FIG. 1. In the neighborhood table lookup approach, shift registers are used to assemble and update
the 9 bits of the current 3 * 3 binary neighborhood. These 9 bits are used as address for table lookup in a
512-entry lookup table.
Also the method proposed in this paper is a variation on this method, (ab) using
3 * 3 convolution hardware for the 9-bit address assembly.
2.2. The Processor-Array Approach
In the processor-array approach (which is used in CLIP 4, for instance) the
interconnection pattern of the processor array assures rapid access to neighboring
pixels. Each processing element receives the binary values of its neighbors and
applies the cellular-logic operation by directly computing the appropriate logical
combination of the nine neighbors. The simple logical combination needed for a
dilation may, e.g., be performed by CLIP 4 in a single (array) instruction step.
In general-purpose computers, the sequential analog of this direct computation
approach (computing the appropriate logical combination of the binary operand
118
GERRITSEN
AND VERBEEK
image and versions shifted in eight directions) may be seen as an alternative for the
neighborhood table lookup approach.
2.3. The Run-List
Processing Approaches
f:zP,.
k=O
Comparing
this to the calculation of the new gray value B of the central pixel by a
IMPLEMENTATION
OF CELLULAR-LOGIC
119
OPERATORS
A = 508,0
5 x 5 part
,mage
of bmary
bit string
of tnner product
of current
neighborhood
and filter-coefficient
COnYOlUtlOn
and cwrenf
filter
3 x 3 nelghborhood
used
caefflcientr
as address
A for
table
array
look-up
wK=zK
linear convolution
which is written as
8
B = c
W,P,
k=O
we find that the addresses A can be calculated through linear convolution (instead of
concatenation) when W, = 2k is chosen for the coefficient scheme (see Fig. 2). More
explicitly, the coefficient scheme is
8
16
32
4
256
64
2
1.
128
120
GERRITSEN
AND VERBEEK
than S-connectivity some dont cares may be defined through insertion of zeros in
the coefficient scheme. For 4-connectivity, the scheme is
0
4
0
2
16
8
0
1.
0
Hexagonal grids can be nicely mapped onto square grids when each line is shifted
by one-half grid-unit with respect to the previous line. For such a representation the
hexagonal 6-connectivity is mapped into Pavlidis 6-connectivity [24]. The corresponding coefficient scheme in our method is
4
8
0
2
64
16
0
1.
32
For quatemary images (where pixel values may be 0, 1, 2, or 3) the method may
be used in 4-connectivity operations. The powers of 2 must then be replaced by
powers of 4, as follows:
A = 2 4kP,k
k=O
with scheme
0
16
0
4
256
64
0
1.
0
In this case the table contents should also have double width in order to yield a
quaternary output image. One might argue that this version lies outside the field of
cellular logic.
3.3. Examples and Practical Considerations
Examples of the lookup tables used for binary pepper-and-salt noise removal,
8-connected dilation, and S-connected erosion are given in Tables 1 through 3.
As many image-processing systems have S-bit gray-value representation, their
lookup tables are possibly restricted to 256 entries. In such a case the method is
Cellular-Logic
TABLE 1
Lookup Table for Removing Binary Pepper-and-Salt Noise
Center
Center
Center
Center
Address A
0
0
1
1
257
to 254
Content
255
256
0
1
0
to 511
Note. Pixels which are totally surrounded by inverse-valued pixels are set to
the value of their neighbors.
IMPLEMENTATION
Cellular-Logic
OF CELLULAR-LOGIC
OPERATORS
TABLE 2
Lookup Table for &Connected Dilation
Address A
Content
All neighbors 0
Not all neighbors 0
Neighbors dont care
0
1 to 255
256 to 511
Cellular-Logic
121
Center 0
Center 0
Center 1
TABLE 3
Lookup Table for S-Connected Erosion
Address A
256
Center 0
Center 1
Center 1
0 to 255
to 510
511
Content
0
0
1
TABLE 4
Cellular-Logic Lookup Table for Removing Binary Pepper-and-Salt Noise
That May Be Used when the Maximum Length of the Lookup
Table is 256
Situation in current neighborhood
All neighbors 0
Not all neighbors 0
and not all neighbors 1
All neighbors 1
Address A
Content
00
1 to 254
10
255
11
4
0
64
2
1
128
is chosen, which implies that the value of the central pixel in the original image is
not yet taken into account. This central pixel would have determined if the first or
the second half of the 512-entry table should have been addressed. We store these
halves in two separate 256-entry tables, that can readily be combined into one
256-entry 2-bit table. The central value Ps is then used to determine if the left or the
right bit in the content found at the address A with
A = i
2kPk
k=O
is to be chosen as the new value (an example is given in Table 4). This may be
122
GERRITSEN
AND VERBEEK
achieved through a simple &entry table. Note that the number of possible parallel
operations is halved.
4. GENERAL
REMARKS
AND
CONCLUSIONS
We thank J. J. Gerbrands and R. J. van Munster for trying out the method on a
VICOM system and an FPS AP-120B array processor, respectively,
REFERENCES
1. G. Matheron, Random Sets and Integral Geometry, Wiley, New York, 1975.
2. J. Serra, Applied Mathematical
Morphology,
SIAM, Washington, D.C., 1975.
3. T. Hersant, D. Jeulin, and P. Pamiere, Basic Notions of Mathematical
Morphology
used in Quantitative
Metallography,
Vols. 1-5, Institut de Recherches de la Siderurgie Francaise, St. Germain en Laye,
1976.
4. L. A. Lyusternik, Convex Figures and Polyhedra,
D. C. Heath, Boston, Mass., 1966.
5. F. C. A. Groen, Local transformations, in Course on Pattern Recognition and Image Processing 1978
(C. .J. D. M. Verhagen, Ed.), Pattern Recognition Group, Applied Physics Department, Delft
University of Technology, Delft, 1978.
6. M. J. E. Golay, Apparatus
for Counting
Bi-Nucleate
Lymphocytes
in Blood, U.S. Patent 3,214,574,
1965 (filed 1959).
7. M. J. E. Golay, Hexagonal parallel pattern transformations, IEEE Trans. Comput. C-18, 1969,
733-740.
8. D. Graham and P. E. Norgren, The difD analyzer: A parallel/serial Golay image processor, in
Real-Time
Medical
Image Processing
(M. Onoe, K. Preston, Jr., and A. Rosenfeld, Eds.), pp.
163-182, Plenum, London/New York, 1980.
9. B. Kruse, Design and Implementation
of a Picture Processor,
Science and Technology Dissertations,
No. 13, University of Linkoeping, Linkoeping, 1977.
10. J. C. Klein and J. Serra, The texture analyzer, J. Microsc. 95, 1977, 349-356.
IMPLEMENTATION
OF CELLULAR-LOGIC
OPERATORS
123
11. M. J. B. Duff, Parallel processors for digital image processing, in Advances in Digital Image Processing
(P. Stucki, Ed.), pp. 265-279, Plenum, New York, 1979.
12. S. R. Stemberg, Language and architecture for parallel image processing, in Proceedings,
Conference
on Pattern Recognition
in Practice,
May 21-31, 1980, pp. 35-44, North-Holland,
Amsterdam.
13. F. A. Genitsen and L. G. Aardema, Design and use of DIP-l: A fast, flexible and dynamically
microprogrammable image processor, Pattern Recognition
14, 1981, 319-330.
14. F. A. Gerritsen, Design and Implementation
of the Delft Image Processor
DIP-l,
Ph.D. dissertation,
Applied Physics Department, Delft University of Technology, Delft, 1982.
15. K. Preston, Jr., M. .I. B. Duff, S. Levialdi, P. E. Norgren, and J. I. Toriwaki, Basics of cellular logic
with some applications in biomedical image processing, Proc. IEEE 67, 1979, 826-856.
16. P. E. Danielsson and S. Levialdi, Computer architectures for pictorial information systems, Computer
14 (11) 1981, 53-67.
17. A. Rosenfeld and J. L. Pfaltz, Sequential operations in digital picture processing, J. Assoc. Comput.
Much. 13, 1966, 471-494.
18. C. J. Hilditch, Linear skeletons from square cupboards, in Machine Intelligence 4 (B. Meltzer and D.
Michie, Eds.), pp. 403-420, University Press, Edinburgh, 1969.
19. I. T. Young, R. L. Peverini, P. W. Verbeek, and P. J. van Otterloo, A new implementation for the
binary and Minkowski operators, Computer Graphics and Image Processing 17, 1981, 189-210.
20. P. W. Verbeek and I. T. Young, Binary operations on run-coded images, in Proceedings,
4th European
Murch
25-27, 1981, MRC, Western General
Chromosome
Analysis
Workshop,
Edinburgh,
Hospital, Edinburgh.
21. R. L. T. Cederberg, Shrinking of RC-coded binary patterns, in Proceedings 5th ICPR, Miami Beach
(Florida),
Dec. l-4, 1980, pp. 1019-1022.
22. R. L. T. Cederberg, Thinning of run-length coded binary images, in Proceedings,
2nd Scandinavian
Conference
on Image Analysis,
Helsinki
(Finland),
June 15-l 7, 1981, pp. 24-28.
23. A. V. Oppenheim, R. W. Schaefer, and T. G. Stockham, Non-linear filtering of multiplied and
convolved signals, Proc. IEEE 56, 1968, 1264-1291.
24. T. Pavlidis, Structural
Pattern Recognition,
pp. 57-63, Springer-Verlag, Berlin/New York, 1977.
25. C. Arcelli, L. Cordella, and S. Levialdi, Parallel thinning of binary pictures, Electronics Lett. 11, 1975,
148-149.
26. P. W. Verbeek and F. A. Gerritsen, Cellular logic on 3 X 3 convolution hardware, in Proceedings,
SPIE Conference,
Geneua (Switzerland),
April 18-22,
1983, paper 397-76.