reconstruction of patterns by block-projection

10
INFORMATION SCIENCES 4, 357-366 (1972) 357 Reconstruction of Patterns by Block-Projection C. K. WONG AND P. C. YUE IBM Thomas J. Watson Research Center P.O. Box 218 Yorktown Heights, New York 10598, U.S.A. Communicated by L. A. Zadeh ABSTRACT This paper proposes a family of new methods for the storage and reconstruction of binary patterns by means of block-projections. More flexibility and less ambiguity is thus achieved. A complete analysis is presented in terms of(i) storage requirements, (ii) computa- tion, and (iii) unambiguity ratio. Furthermore, applications to general patterns are described. 1. INTRODUCTION In a recent paper by S. K. Chang [I], the reconstruction of binary patterns from their projections is discussed. Using his method (which will be referred to as the direct projection method throughout this paper), only 2m log2 m bits rather than m 2 bits are required to store an m × m binary pattern. The process of projection, however, may create ambiguities for reconstruction. If no ambiguity is incurred, then m 2 steps of computation will suffice to reconstruct the pattern. Otherwise, only a similar pattern will be obtained (the amount of computation being m 2 also). Therefore, three factors must be taken into consideration, namely, storage, computation and the ambiguities incurred in the method. In the present paper, the notion of unambiguity ratio is introduced and a family of block-projection methods is proposed, which includes the direct projection method as a special case. The storage requirement is then pro- portional to mlog2m as well as the block-size. The amount of computation remains the same as in the direct projection method, but the ambiguities are reduced dramatically. For example, for m × m patterns with block-size (r, r), the improvement is m c(r-l)m, where c is some number between (1/2) and 2. Copyright © 1972 by American Elsevier Publishing Company, Inc.

Upload: ck-wong

Post on 02-Jul-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Reconstruction of patterns by block-projection

INFORMATION SCIENCES 4, 357-366 (1972) 357

Reconstruction of Patterns by Block-Projection

C. K. WONG AND P. C. YUE I B M Thomas J. Watson Research Center P.O. Box 218 Yorktown Heights, New York 10598, U.S.A.

Communicated by L. A. Zadeh

ABSTRACT

This paper proposes a family of new methods for the storage and reconstruction of binary patterns by means of block-projections. More flexibility and less ambiguity is thus achieved. A complete analysis is presented in terms of(i) storage requirements, (ii) computa- tion, and (iii) unambiguity ratio. Furthermore, applications to general patterns are described.

1. INTRODUCTION

In a recent paper by S. K. Chang [I], the reconstruction of binary patterns from their projections is discussed. Using his method (which will be referred to as the direct projection method throughout this paper), only 2m log2 m bits rather than m 2 bits are required to store an m × m binary pattern. The process of projection, however, may create ambiguities for reconstruction. If no ambiguity is incurred, then m 2 steps of computation will suffice to reconstruct the pattern. Otherwise, only a similar pattern will be obtained (the amount of computation being m 2 also). Therefore, three factors must be taken into consideration, namely, storage, computation and the ambiguities incurred in the method.

In the present paper, the notion of unambiguity ratio is introduced and a family of block-projection methods is proposed, which includes the direct projection method as a special case. The storage requirement is then pro- portional to mlog2m as well as the block-size. The amount of computation remains the same as in the direct projection method, but the ambiguities are reduced dramatically. For example, for m × m patterns with block-size (r, r), the improvement is m c(r-l)m, where c is some number between (1/2) and 2.

Copyright © 1972 by American Elsevier Publishing Company, Inc.

Page 2: Reconstruction of patterns by block-projection

358 C . K . WONG AND P. C. YUE

2. DEFINITIONS AND PRELIMINARY RESULTS

Some basic definitions and results are presented here for later application. A binary pattern is an m x n matrix of 0's and l's. We shall use the terms

pattern and matrix interchangeably. Throughout Secs. II-IV, the term pattern is used for binary pattern. The x-projection of a pattern is an n-vector, whose ith component is the sum of entries in the ith column. The y-projection of a pattern is similarly defined as the row-sum. A pattern is said to be (1,1)-ambiguous if there exists another pattern with the same projections. Under such circumstances, they are said to be (1,1)-similar. A pattern is said to be (1,1)-unambiguous if it is not (l,1)-ambiguous.

A basic result on binary patterns can be stated as follows.

THEOREM 1. A pattern is (1,1)-ambiguous if and only if it contains a 2 x 2 submatrix of the form

or 10) (i.e. there exists two rows and two columns such that the four intersection entries form one of ~hese patterns).

Proof. See Theorem 1 in Ref. 1 or [4], Ch. 6. We now interpret the results of Chang [1] in terms of a canonical trans-

formation which forms the basis of our discussion on ambiguities.

I I 0

I I 0

0 0 0

FIGuI~ 1. A 3 x 4 Canonica l Pat tern.

A pattern is called canonical if (i) in each row all l's are on the left side, and all O's are on the right, (ii) the number of l's in the ith row is not less than that in the i + 1st row. Figure 1 shows an example of a 3 x 4 canonical pattern. The heavy solid line with three horizontal segments is the boundary separating the l 's from the O's.

Page 3: Reconstruction of patterns by block-projection

RECONSTRUCTION OF PATTERNS BY BLOCK-PROJECTION 359

THEOREM 2. A pattern is (1,1)-unambiguous i f and only i f it can be trans- formed into a canonical pattern by a finite number of row and~or column permutations.

Proof. It follows f rom Theorem 2 in Ref. 1.

THEOREM 3. By the direct projection method, an m × n (l,1)-unambiguous pattern can be reconstructed from its projections in mn steps of computation. An m x n (1,1)-ambiguous pattern can be reconstructed up to similarity in mn steps of computation. In both cases, the storage required is n log2 m + m log2 n bits.

Proof. See Ref. 1.

3. BLOCK-PROJECTION METHODS

L e t f b e an m x n pattern. Suppose m = m'r, n = n's, where m', n', r, and s are positive integers. Pa r t i t ion ingf in to m'n' patterns, each of size r × s, we obtain an m' × n' matrix f * with each entry being itself an r × s matrix. Let f * , 1 < p ~< m', 1 < q ~< n', be the entry in the pth row and qth column o f f * . Letf*~(i,j), 1 <~i<<.r, 1 <j<~s, denote the entry in the ith row and the j th column o f f * . The x-projection o f f * is an n ' -vec to r f* whose qth component

f * is the matrix sum of all the matrices in the qth column o f f * . Let f*( i , j ) , 1 ~< i ~< r, I < j < s, denote the entry in the ith row and the j th column o f f * . The y-projection o f f * is similarly defined. They are also called the x- and y-block-projections of f respectively.

f is said to be (r,s)-ambiguous if there exists another pattern with the same x- and y-block-projections. In this case they are said to be (r,s)-similar. f i s said to be (r, s)-unambiguous if it is not (r, s)-ambiguous.

For each pair (i,j), the matrix f * ( i , j )= * " " [fpq(l,J)]l -<~ ~,,', l ~< ~ n' forms an m' x n' subpattern. Thus, the vectors [f~(i,j)]z ~q~n. and [fy*(i,j)]z ~p~<,~, are exactly its x- and y-projections as defined in Sec. II. One can then discuss the reconstruction off*(i, j) from its own projections as in Sec. II. F rom Theorem 1, one also has the following result:

LEMMA 1. f is (r,s)-unambiguous i f and only i f [f~(i , j)] 1 ~<p~<m', I ~< ~< ~' is (l,1)-unambiguous for all pairs of indices (i,j).

Finally, for a given pattern f , the following procedure, called the block- projection method, is proposed:

(i) choose an appropriate block-size (r,s); (ii) store the x- and y-block-projections o f f ;

(iii) for each pair o f indices (i,j), 1 <<. i<~ r, 1 <<.j<~s, reconstruct the patternf*(i, j) by the direct projection method.

Note that for r = s = I, all the definitions reduce to the case in Sec. I I and the block-projection method becomes the direct projection method.

Page 4: Reconstruction of patterns by block-projection

360 C. K. WONG AND P. C. YUE

4. ANALYSIS

TrmO~M 4. Let f be an m x n pattern. For any chosen block size (r,s), the number o f steps o f computation to reconstruct f by the block-projection method is mn.

Proof. For each fixed (i,j), one needs m'n' steps of computation to reconstructf*(i, j) , (Theorem 3). Therefore the total amount of computation is rsm'n' = roB.

THEOREM 5. Let f be an m × n pattern, l f the block-size chosen is (r,s), then the storage required in the block-projection method is rn log2 (m/r ) + sm log2 (n/s) bits.

Proof. By the same reasoning as in Theorem 3.

THEOR~ 6. Let f be an m x n pattern. Let the block-size (r,s) be fixed. I f f is (1,1)-unambiguous, then f is (r, s)-unambiguous.

Proof. Suppose f is (r,s)-ambiguous, then by Lemma 1, f* ( i , j ) must be (1,1)-ambiguous for some (i,j). It follows from Theorem 1 that f must be (1,1)-ambiguous, implying a contradiction.

COROLLARY 1. I f f is (r',s')-unambiguous, then f is (r, s)-unambiguous, where r', s' divide r,s respectively.

The converse of the theorem, however, is not true, i.e. i ff is (1,1)-ambiguous, it may still be (r, s)-unambiguous. In fact, many patterns fall in this category as we shall see next.

Consider the set S of all m x n patterns with entries 0 or 1. Then the cardinality of S is 2 ran. Let G(m, n; r, s) be the total number of (r, s)-unambigu- ous patterns. Then p(m,n; r , s )= [G(m,n; r,s)/2 m"] is called the (r,s)-un- ambiguity ratio. [When all m x n patterns are equally likely, this ratio is exactly the probability that any pattern is (r,s)-unambiguous.]

COROLLARY 2. I f r ', S' divide r, s respectively, then p(m, n; r' s') <~ p(m, n; r, s). In particular, i f y is defined as y = p(m,n; r,s)/p(m,n; 1,1), then ), >1 1.

Therefore, the parameter ~, is a measure of the reduction of ambiguities by using block-projection with block-size (r, s). We shall now compute the exact value of y in terms of m, n, r, s. As a consequence, any two block-projection schemes can be compared using this parameter.

LEMMA 2. G(m,n; r,s) = {G[(m/r), (n/s); 1,1]} '~.

Proof. It follows from Lemma 1.

Consequently, if G(m,n; 1,1) is known for all m,n the value of y is also known for any r and s. To obtain G(m, n; 1,1), we need a lemma.

Page 5: Reconstruction of patterns by block-projection

R E C O N S T R U C T I O N OF P A T T E R N S BY B L O C K - P R O J E C T I O N 361

LEMMA 3. Let m, k be positive integers. Let

E m k = r l+ r l ] r 2 [ ' " r k [ ' • ,,>o:i-,AT.'..k

0, Then

E,~.~= 2 ( -0 J ( k - j ) m. J=O

Proof. It is well-known that

C m , k =

r l + . . , +rk=ra r l>~O, i= l ,2 , . . . k

for all m, k > O.

m! rl!r2!. . .rk!

f o r k < m

f o r k > m.

k m

G(m,n; 1,1) = ~ f,. ,E~. ~, k=l

fro, k= Y (--1)' ( k + 1 - i ) ' . 1=0

Proof. By Theorem 2, any (1,1)-unambiguous pattern can be transformed into a canonical pattern by row and/or column permutations. Therefore, it suffices to enumerate all the canonical patterns and count the number of patterns in S transformable into canonical form.

where

THEOREM 7.

Cm, k corresponds to partitioning the integer m into k parts with each part greater than or equal to zero. fit has meaning for all m, k >_- 0.) E,,,k corresponds to partitioning m into k nonzero parts. It has meaning for k < m only. From this point of view, it can easily be shown that

k--I

l=O

for k < m. Assigning Em.k = 0 for k > m, the equation (*) can be shown to hold for all m, k > 0.

Solving (*), one readily obtains

E,,,k = Y, (--1) J Cm,~_j J=0

= y. ( - l y k _ / ) m . J=O

Page 6: Reconstruction of patterns by block-projection

362 C. K. WONG AND P. C. YUE

r2 [

B~NDARy

FIGURE 2. A Canonical Pattern with k Horizontal Segments in the Boundary.

Consider canonical patterns with exactly k horizontal segments (see Figure 2) of lengths r~ > 0, i = 1, 2 . . . . . k, in the boundary between the l 's and O's. Fix a coordinate system as shown in the figure. Let the extensions of the horizontal segments meet the y-axis at y~, Y2 . . . . . Yk and let the corresponding intervals be -r 0, -r~, ..., "r k. Then

where

and

M

G(m,n ; I, 1 )= ~ ~ _n! k= 1 r, +. . .+rk=n r l ! r2 ! " " "rk !

r l > O

M = min (m + 1, i1),

g(rl, F 2 . . . . . r k ) =

7"0+ +~"k m ~'0 ~> 0 . 7k>~0

T / > 0 , l f f i l . 2 . . . . . k - I

g(rl , r2, . . . , rk),

m!

T0!TII ' ' '~k!

(ii) Yl = 0, Yk < m.

The corresponding terms sum up to

~ m!

r l + . . . + 1 " k f f i r a

> 0 , 1=1o2 . . . . , k

(iii) Yl > O, Yk = m .

E..k-,.

= E I n , k"

r l ! ¢ 2 ! . - . r k - l ! g l =

"rl + , . . + ' r k _ i ~ m r l > 0 , / = 1 , 2 . . . . . k - I

rn!

To compute g(rl , r2 . . . . , rk), consider the following four cases:

( i ) Y l = O, Yk = m .

The corresponding terms in g(ri , r2 . . . . , rk) sum up to

Page 7: Reconstruction of patterns by block-projection

RECONSTRUCTION OF PATTERNS BY BLOCK-PROJECTION 363

The corresponding terms sum up to g3 = g2.

(iv) Y l > 0, Yk < m.

The corresponding terms sum up to

g4 = 7"0]'rl ! - . . 7 -k ! TO-I-.. .q-7"k~m

~'1> O. 1=0,1 ..... k

Therefore,

M

G(m, n; 1, 1) = k=l

M = y

k= l

E m , k + l .

r l ! r 2 ! . . . r ~ ! {g! - l -g2 -b g3 + g 4 } r I dr • • • -}-rk~n

ri>O

(g, + g2 + g~ + g4} "~ n! z.., rl!r2!. . .rk!

r l q - . . . - I - r k = n rt>O

M = ~ (Em, k_~ +2Em, k+Em,~+3E.,~.

k=l

Recall that Em,~ = 0 for m < k. I f n < m + 1, then summation over k is from 1 to n. I fn > m + 1, then summing from k = I to k = n or~rn + 1 does not make any difference. Therefore, we have

G(m,n; 1, I) = ~ (E,..k-z + 2E,.,k + Ern, k+t)E.,k. k=l

By the results of Lemma 3 and straightforward algebra,

Em, k-I + 2E,..~ + Era.k+, =fro.k,

and the theorem is proved. Consequently, combining Lemma 2 and Theorem 7, we obtain a closed

form expression for ~/.

COROLLARY 3.

/ . / s ) / , ~ , " _ . :o : . . , .

The block-proJection method is essentially a method which provides flexi= bility in arriving at trade=offs between memory requirement and ambiguity reduction. Therefore, the choice of block=size depends on the memory available and the amount of ambiguities which could he tolerated.

When the size of patterns is variable rather than fixed, a dynamic way of determining block=size may be desirable. For example, if m = n, the following schemes can be adopted: (i) r = s = Hog2mq and (ii) r = s = Fml/2q. The corresponding memory requirement becomes approximately 2mlog22m in

Page 8: Reconstruction of patterns by block-projection

3 6 4 c . K . W O N G AND P. C. YUE

the first case and m3121og2 m in the second. In both cases, it is still much smaller than m 2 while the ambiguity reduction is drastically magnified.

The order of magnitude of this reduction is best appreciated by examining Figure 3 where log~07 is plotted as a function of m for m × m patterns using four different schemes: (i) r = s = 2, (ii) r = s = 4, (iii) r = s = rlog2m7 and

4 0 0 0 0

r - -

9 (.9

[LOG

r=4

r=2

0 m""-~---------'t'-'~ I I I I I I00 200 300 400 500 600 700

m

FIGURE 3. L o g a r i t h m o f R e d u c t i o n o f A m b i g u i t y Ve r sus P a t t e r n Size.

(iv) r = s = Frail2]. Only those values o f m such that r is an integer are plotted (this accounts for the smoothness of the curves). These curves can be described by the expression logi07 = c ( r - 1)mlogl0 m, where (1/2) < c < 2.

As a final remark of this section, it should be pointed out that in case r ,s do not exactly divide m,n, one can always augment the original pattern by adding some rows or columns of O's and then choose some convenient block-size.

Page 9: Reconstruction of patterns by block-projection

RECONSTRUCTION OF PATTERNS BY BLOCK-PROJECTION 365

5. GENERAL PATTERNS

So far, we have considered only binary patterns. Actually, the block- projection method can be applied to the storage and reconstruction of general patterns.

Supposef i s an m × n pattern with integer entriesftj, 0 ~<f~j ~< 2 p - 1, for all i,j, where p is a positive integer. Then

p--I f i j = ~. ai(i , j) 21,

1=0

where al(i,j) is 0 or 1. Therefore, eachft j can be represented as a p-vector of O's and l's. Let p be factorized as p = rs, where r, s are positive integers. Then each f~j can be represented by an r × s matrix. We have in effect an mr × ns binary pattern f . The block-projection method can then be applied with the natural block-size (r, s). The computation, storage and the unambiguity ratio are all independent of the factorization as long as p = rs. This is expressed in the following result.

THEOREM 8. Let f be an m x n integer-valued pattern, 0 <<.ftj <~ 2 p - 1. Then fo r any choice o f (r,s) such that p = rs,

(i) the computation required by the block-projection method is mnp steps, (ii) the storage required is p(n log2 m + mlog2 n) bits, and

(iii) the unambiguity ratio is given by

p = .~E,.k • ,k=l ,/

Proof.

(i) follows from Theorem 4. (ii) follows from Theorem 5.

(iii) by Lemma 2,

p = G(mr, ns; r, s)/2 ""p

= [G(m,n; 1, 1)/2m"] ".

Hence the result follows from Theorem 7. Note here that all three expressions depend only on re, n, and p but not

explicitly on r or s. By choosing block-size (r,s) such that p = rs, we are essentially regarding each f~j as a single block. Clearly, if more storage is available, one may also want to take several f~j's together as a block, i.e. to have a larger block-size, and the consideration in the previous section will apply. On the other hand, choosing a block-size other than multiples o f r and s (p = rs) might not be advisable since one would then have to cut up somef~fs

Page 10: Reconstruction of patterns by block-projection

366 C. K. WONG AND P. C. YUE

and put them into different blocks, thus involving much programming as well as storage overheads.

6. CONCLUSIONS

In this paper we have presented a family of methods called the block- projection methods for storage and reconstruction of binary patterns. Different block-sizes result in different degrees of reduction of ambiguities. Closed form expressions have been obtained to assess this improvement.

These methods are further applied to general patterns as well.

REFERENCES

1 S. K. Chang, Commun. ACM14, 21 (1971). 2 S. K. Chang and G. L. Shelton, in Proc. o fM. J. Kelly Commun. Conf., Rolla, Missouri

(October 1970), p. 20. 3 K. Jordan, Calculus of Finite Differences, Chelsea, New York (1947), Chap. 4. 4 H. J. Ryser, Combinatorial Mathematics, Wiley~ New York (1963), Chap. 6.

Received April 21, 1971.