LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAICN 510.84 I-06r no. 171-187 cop Digitized by the Internet Archive in 2013 http://archive.org/details/experimentalresu184yama If&x- Report No. l8U coo-1018-1060 EXPERIMENTAL RESULTS FOR LOCAL FILTERING OF DIGITIZED PICTURES by S. Yamada J. P. Fornanago June 15, 1965 UNIVERSITY OF ILLINOIS AUG i 1H 19bb Report No. l8U EXPERIMENTAL RESULTS FOR LOCAL FILTERING OF DIGITIZED PICTURES* by S . Yamada J. P. Fornanago June 15, 1965 Department of Computer Science University of Illinois Urbana, Illinois * This work was supported in part by the U.S. Atomic Energy Commission under Contract No. AT911-l)-10l8. SIC IS St no. 184 CO p . 3 TABLE OF CONTENTS Page 1. INTRODUCTION 1 2. LABELING 2 2.1 General 2 2.2 Use 2 2.3 Process 3 2.U Results. 3 3. NOISE CLEANING 6 3.1 General 6 3.2 Generation of Random Noise ....... ..... 6 3.3 Noise Cleaning Process .... ....... 7 3.U Results 10 h, RECONNECTION . . .................. 20 k.l General 20 i;.2 Generation of Burst Noise. 20 U.3 Reconnection Process .... ........... 20 k.h Results. 2k 5. EXTRACTION OF FEATURES. ....................... 31 J) • J- \Jt-IlCX d _L o«»*ooooo4ooo9»o**o*oo<»oao0i>* ,D 5.2 Extraction Process ....................... 31 APPENDIX I. 33 APPENDIX II ... . ................... 3^ 1 . INTRODUCTION The purpose of this paper is to investigate a general plan for the local recognition of visual patterns. This local recognition is the basis of a higher level recognition, global recognition [k] . The following subjects are investigated in our local recognition level: 1. A General Labeling Routine, 2. Cleaning of Random Noise, 3. Shaping, including Burst Noise Correction, and k. Preliminary Extraction of Feature Objects (the basis of higher level recognition). The local filtering theory follows lines developed by Yamada [l]. Programs to test the filtering theory were written in PAX [2], a parallel processing language written for the IBM 709^-1^-01 System at the University of Illinois. Portions have been written in SCATRE [3], the assembly language for that system. An additional routine not described in the original PAX report has been used. This routine is described in Appendix I. [l] Yamada, S., "Local Recognition of Pictorial Images," Department of Computer Science, University of Illinois, Urbana, Illinois. Report in preparation. [2] Stein, J. H., "User's Manual for PAX," Department of Computer Science, University of Illinois, Urbana, Illinois. Report No. IU7 (July, 1963). [3] Wolf, W., "SCATRE for the IBM 709U. Library Subroutine: L1-U0I-SCRE-19-BX, " Department of Computer Science, University of Illinois, Urbana, Illinois. [h] Yamada, S., "Global Recognition of Pictorial Images," Department of Computer Science, University of Illinois, Urbana, Illinois. Report in preparation. -1- 2 . LABELING 2.1 General A subroutine which is common to both programs in Parts 3 and ^ is known as LABEL . As the name implies, the routine labels the points of a picture according to the approximate direction of the line through the point The labeling convention is as follows: Actually", the program assigns at least two directions to each point labeled. If all lines were straight lines, only one label would be necessary (i.e., a line running east and west would need only one label (l) rather than two labels (l and 5))« However, a point on a curved portion of a line or on a corner of a line may require two directions which are not diametrically opposed (i.e., the labeling directions may be 1 and k) . 2.2 Use The subroutine is entered at the symbol LABEL using PAX index register 8 as a link. The picture to be labeled is in a plane called INPUT. Upon return to the calling program, INFUT is unchanged, all labeled points are in a plane called NEWVAL (new values), and all unlabeled points are in a plane called NOCON (no connections), and the labels are in eight planes beginning with IODIR (input-output directions). Plane IODIR-1+k contains all points labeled in the k direction. (Note: NOCON = NEWVAL) Two other planes, TEMPI and TEMP2, are used as temporary scratch planes by the subroutine . PAX index registers 1 through h are altered. -2- 2,3 Process The initial labeling is done in a somewhat unconventional manner, Rather than look at immediate neighbors, the program examines points two units away along the primary directions, A point is labeled in directions d and d+k if the point itself and the second neighbors along the d and d+h directions are all black in INPUT, The labeled points are added to NEWAL, After all directions have been examined, NOCON is set to the complement of HEWVAL. After this initial labeling, the IODIR planes should contain enough information about the straight portions of the input picture that the corners and gaps can easily be filled in without referring to INPUT. The filling process is accomplished by examing immediate neighbors, A point is labeled in the d direction if its d neighbor and either its d+3, d+U, or d+5 neighbor has been labeled in the initial labeling. This allows points to be labeled along straight portions, or around curves or corners „ Points which were labeled in the initial labeling are not allowed to pick up additional labels in the filling,, This is done by filling only points in NOCON „ Note that filled points are not subtracted from NOCON until all filling is completed. 2 ,h Results This labeling algorithm has proven to be useful in two cases. The first is where the lines of a picture have a width of from one to three points and are very long compared with their width. When wider lines are used, the interior points are multiply labled, but the border points of the line are labeled according to the direction of the border. Therefore, this routine performs point labeling, rather than line labeling. The second case is where the lines are embedded in random noise (see Section 3), The most prominent fault of this routine is that the lines are ''chopped," Since the labeling depends on the continuity of the line through the point, the end points of the line are not labeled. In the case where noise is not prevalent, it is a simple matter to extend the labels to the ends 1, See program listing in Appendix I and flow chart in Figure 1, of the INPUT lines. This is done in the labeling part of the reconnection routine (Part k) . However, where noise is prevalent, the extension becomes extremely difficult, and therefore was not used in the noise cleaning routine (Part 3). Enter: LABEL I IODIR(d) = Black points in INPUT with second neighbors in d and d+^ directions marked i. NEWVAL = IlODIR(d) d NO CON = NEWVAL t NEWPTS = NOCON • IODIR(d) • [IODIR(-d) + IODIR(-d+l) + IODIR(-d-l)] IODIR(d) = IODIR(d) + NEWPTS NOTE: "-d" = d+U for di+ NEWVAL = IlODIR(d) d NOCON = NEWVAL } r RETURN to Main Program Figure 1. LABEL Subroutine Flow Chart ■■?- 3 . NOISE CLEANING 3.1 General This noise cleaning routine is a simulation of a general algorithm worked out by Yamada [l] for special application to large noise cases. The large noise case was chosen since it is a more general problem. If no a priori information is known about the extent of noise in a picture, the most power- ful cleaning routine must be used. On the other hand, if it is known that the noise is small, a less powerful but more efficient routine may be used. This cleaning algorithm cannot be programmed precisely because it is neither definite enough nor simple enough to be programmed with any degree of efficiency. Also, the algorithm is based on a well-defined noise input. As will be seen in paragraph 3»2, the noise used is not well-defined. However, the original filtering theory has been modified and realized as a programmable and fairly efficient routine.. The label routine described in a previous section uses aspects of the general theory. This section describes the extension of the label routine into a noise cleaning routine, 3 .. 2 Generation of Random Noise A pattern was chosen as a basis of study, and noise was added to this pattern. The noise was to be of a random nature, but of uniform density over the entire plane. In an effort to achieve this, a random number generator was used to generate random coordinates. The random generator routine was entered twice, and the two numbers obtained were used as x- and y- coordinates of a point,. That point was then made "bad" by reversing its value. If the point had previously been reversed, no change was made, The density of noise was controlled by the number of points which were changed. By using a noise level scale from to 9, the entire range of possible degrees of noise was covered, A level of n indicates that, on the average, n points of each 3x3 window are "bad," In other words, in an Q m x m plane, nm /9 points were made bad in order to achieve a noise level of n. -6- The noise obtained by this generation routine is usable, but far from ideal. There are two reasons for this. First, the random number generator did not generate uniformly from to 71, but put a slight emphasis on values from to 5^. Second, it was found that sets of two randomly generated numbers do not define random coordinates in a two-dimensional plane. 3 .3 Noise Cleaning Process The basis of the program is the LABEL routine. But before attempting to label a noisy picture, an initial mapping of the domain to the point is performed. That is, only points (black or white) with greater than or equal to a certain number of black neighbors (including itself) are input as black points to the label routine. This number, T, is called the threshold level. Because of the nonuniformity of the noise, no single T-value is optimum, Using T=U, too many bad points are retained_, and the picture is not thoroughly cleaned. Using T=5, not enough points are retained and small portions of lines are erased. Therefore, the picture to be cleaned is labeled twice, using T=^ and T=5 o The portions erased by using T=5 are picked up by extending the results of T=5 into the results of T=U on a direction continuation basis. The resulting picture is then reextended into T-h until no new points are picked up. The extension is begun with the results of the labeling using T=U in four planes starting with Ik, T^(d) contains the points labeled in the d and d+k directions. Similarly, T5(d) contains the d and d+k labeled points using T=5„ T5ALL contains all points labeled using T=5. T5BAR = T5ALL, and contains all points not labeled. The end points in T5 are selected by direction and are put into one of eight planes, DENDS(d). A point is an end point in the d direction if it is in T?(d), has no labels in the side or corner in the d direction, and has any label in the opposite direction 'see Example l) . In an effort to retain continuity at corners, all points in TU(d+l) and TU(d-l) are added to DENDS(d) to form DENDSX(d). 1. See program listing in Appendix n and flow chart in Figure 2, -7- Example 1. Examples of End Point Definitions Requirements for end points in the 2 direction: D N N D X N L D D Requirements for end points in the 3 direction: N N N D X D D L D In these examples, X is the point in question and must be labeled in the same direction as the end point is to be labeled; N is a point with No label; L is a Labeled point (regardless of direction); and D is a "Don't Care" point (does not influence the selection of end points). -8- Read ORIG picture INPUT = Points in ORIG with > 5 black neighbors [labe l input"] T5(d) = IODIR(d) + IODIR(d+U) T5ALL = NEWVAL T5BAR = NOCON INPUT = Points in ORIG with > k black neighbors LABEL INPUT I TU(d) - IODIR(d) + IODIR(d+U) DENDS(d) = End Points of lines in T5(d) I DENDSX(d) = DENDS(d) + TU(d+l) + TU(d-l ) | T|?(d) = T5(d) + NEWPTS(d) 1 NEWPTS(d) = Points found by chaining DENDSX( d) into Th(d ) A A COMP = NE¥PTS(d) - T5(d) Null jfcj Print T5's | Figure 2. Noise Cleaning Flow Chart -9- The growing is accomplished by chaining the points in DENDSX(d) into TU(d). The new points are put into NEWPTS(d). After all directions have been grown, NEWPTS(d) is tested against T5(d). (NEWPTS(d) may contain points previously in T5(d).) If no new points have been picked up, the process is complete and the T5 ' s contain the final picture. If new points are found, they are added to the T5's and the extension is reiterated. 3.U Results The program was tested using noise levels from to 3. The results are shown in Figure 3- Comparison of input and output pictures show that all prominent features of the input are retained in the output. The routine obviously does not work well in the highest noise case, but this degree of noise is extremely rare in actual pictures produced by electrical or mechanical means. The symbols which mark points on the processed pictures of Figure 3 specify the labels assigned to the points in accordance with the code of the table below. For example, a point on a processed picture which is marked "3" was at the juncture of a "2-6" (Northeast-Southwest) line segment and a "3-7" (North-South) segment. ■10- Direction Code Symbol . Di it. pi it. on Pi- ed nrp 1-5 2-6 3-7 k-Q E X A X N X B X 1 X X 2 X X 3 X X k X X 6 X X + X X X - X X X * X X X • X X X $ X X X X > 1 direction > 2 directions * 3 directi ons k directions -11- xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxxx xxxxx xxxx xxxx xxxx XXX XXX XXX XX XXX XXX XXX XXX XX XXX XXX X XX XX XX XX XX XXX XX XXX xxxxxxx XX xxxxxxxxxxxxxxx xxxxxxxxx xxxxx XXXXXXXX xxx xxxxx xxx XXX XX xxx XXX XX xxx XXXXX XX XXX XX XX XX XX XX XX XX XX XX XX XX XXX XX XX XXX XX XX XX XX XX XX XX XX XXX XX xxx XX xxx xxx XX XX xxx XX xxx XX XX Xa xxx XX xxxx xxx xxx xxx xxxx XX xxxx xxxx XX xxxxxxxxxx XX xxxxxx XX XXX XX XX XXX XX XX xxx XX XX xxx XX XX XX xxx XX XX >xx XX XX XX xxx XX XXX XX xxx ORIGIN/SI PICTURE ERROR LEVEL = ) ex xxxx xxxxx XX XX XX XX xxx XX XX XXX XXX xxx XX XX XX XX XX XXX XX XX XX XXX XXXXXX XX XXXXXXXXX XX XXX XXXXXX xxx XX xxxxxxxx XX XXXXXX XX XX XX XXX XX XX XX XX XX XX X -12- EEEEEEEfc EEEEEEEEEEEbtEEEE 1EEEEEE Et^EC 111 ^4^BB 1111 ^44B All B4B AA BBB AA BBB AA BBE AA B AAA AA AA AA A 3 3N 33N NN6 3NN EEE 33«*EEEEEEEEEEEL A32EEEtE E44 A1+11E BB6B 11E23A RB6 A1E2NA B66 AA NN N AA NN NN A A NN NN 3 A NN NN 33 NN NN 33 NN NN 33 NN NN 33 NN N 33 NN N NN NN A3 N N 33 N N 33 NN 66 333 NN 66B A33 NN B6B AAA N eEB AAA N BAB HA N BB4 11A NN ^EEEEEEl NN EE NN N NN N 6 NN NN 6 N NN N N NN N N N N N NN NN 6 N6 N6 N PROCESSED PICTURE ERROR LEVEL * Al EB 331466 33 B6 33A B66 3N N6 33 6 N3 NN 33 N6 33N 66 3NN NN 33N6 No 3 + 444 36N 331EE44E 3N6 3A ^E4^EE+266 3A EEEEL*6 3 E4466 3 BB6 N B66 B6 N •13- X X XX X X X X X X XXX XXXX XXX X XX XX XXXXXXXX XXX X xxxxxx X XX XXXXXXXX X XXXX XX X X XX XXXX XXXXXX X X XX XXXXX X XX X XXXX X X X XX XXX XX XX XXXX XX X XXX X X XXX X X XXX XXX XX XXX XX X XXXXX X XXX X X XXX X X XX XXX X X X XX XX X X XXX X XX XXX XX X X XX XX XX X XX X X X XX X XX X X XX XX XX XX XXX X XXXXX XX X X XX XXX X XX X X XX XX XX XX X X X X XX X X XX XX XX X X X X X X XX XX XXXXXXXXX X XX X X X XXXX X XX XXXXXX XX X X XXXXXXXXX XXXX XX XX XXXXX X X XXX X XX X X XXX XX XX XXXX X X XXX XX X X XXX X X X XXX XXX XX X X XXX XX X X X XX XXX X XX XXX X XX XX X X XXX XX X X X XX X XX X X XX X XX XX XX XX X X XX XX XX X XXX XXX X XXXX XX XXX XX X X X XX X X XX X XX X X XX XX XX X XX X X XX XX X X XXX XXX X XXX X X XX X XX X XXX XX X X XXX XX X XXX X XX XX XXX X X X XX X X X XX X XX X X XX XX XX XXXXXX XXX XX X X XX XX XXX X XX XX X X X XX X X XXXX XX X X XX X X X XX X X XXX XXX XX X XXXX XX X XX X XX X X XXX XXX XXXXX XX X XX X XX X X XX XXXX XX XX XX X XXX XX X X X XX XX XX X XX X XX XXX X XX XXXX X X XXX XXX X XXXX X XXXX XX XX XXXX XXX X XX XXX X X XXX XXX X XX X XX XX XXX XXX XXX XX XXX X X ( XX X XXXX X XX X X XX XX X XX XX X XX XXX X X XX X XX X X XXX XXXXX XX X X XX X XXXXX XXXX X XX X X X XX X X XX XX X X XXX X X XX XX X X XXXX X XX X XXXX XXX XX XXXX XX XXX X XX X XXX XXXX XX XX XX XX XX XXX XX XXX X XX X XXX XXXX X XX XXX X XX X X X X XX X XX X XX XX X XXX XXXX X X XXX XX ORIGINAL PICTURE ERROR LEVEL = 1 -lU- E EEEEEEEEEEEEEEEEEEE 1EE1EEE EE4EEE A114 EEE4444 11111 44446 11111 444B A tlA BB6B A BB6B A BBB A B A A AA AA 3A 3 N N N 3N EEE AN2EEE1EEEEEEEEEEE 1ANEEEEE L44»BB 11+11 BB«6B A11EE3A BB6*E AA1E«N3 B6N6 AAA 6NN MM3 3*A 6NN NNN 33A NNN N*JN N3 NNN NMN 33 NNN N^N 3A NNN NNN AA NNN NNN A A NNN 3.MN 33 NN 3 ^ 3N N A + 3 N6 N B133 NN6 N .+3 NN2 NB MN33 NNN B N3A N3 441 N 3A NN B4B 6 AA NN B4*6B 1A NN 8B4B AA NN 4EEEEEE1 NNN NNN N6N N66 NN NN 66N 6N 66 66 N N NN N N N NN NN NNN NN NN 6N 6 66 6 PROCESSED PICTURE ERROR LEVEL = 1 IE AlE 31- BN AAA B6 33A 6 NN N6 N N 3N NN N3 N6 3N 6 3NN NB 366 N66 A + E B 3NN 31EEE4E 3NN AA EEE236 3A E4E»66 3 B4»4 3 B4 N BB B N ■15- XXX XXXX XX XX XX X X X X XX X XX XXX XXX X XX X X XXXX XXXXXX XXXX XXXXXX X XX X X X XXXX XXX X XXXX X X X XX X X X XXXX XXaXXX X X X X XXX XXXXX X X xxxxxxx XX X X XX X XXX XX XXXX X xxx X XX X X X XX X XX X XX X X XXXX XX XX XXX XXX XXX XX X XX XX XXX XXXXXX XXX X XX XX XXX XXXX XX XX XX XXX X X XX XX XX X XX XX X XX X X XXX XXX X XXX XXX X X XX X XXX X XX X XXX X XX XX X X XX X XXXXX XX XX XXX XX XX XX X XX XX XX XX XXXX XX XX X XXX X XX X XX XXX X XXX XX X X XXXXXX XX XXXX XX XX XX XXX X X X XXX X XX X X X XX XX X X X X XX XX XX X X X XX X XX X XX X XXXXXX XX X XXXX X X XX XXX X XX XXXXXX XX X X XX X X X XX XXX XXXXX XXX XXXX XX X XX XX X XX XX XXXX XX XXX XXX XX X XX XXX XXXX XX XX X X X XX XX XX XX X X XXX X XXX X X XXX X XXX XX X XX X XXXX X X XXX XX XX XXX X XX XX XX X XX XX X X X XX XX XX X XXX XX XX X X X X XX XXX XXX X XXXX X XXX XXX X XX X XX X XX X X XX XX X XX XXX XX X X XX X X XX XX X X XXX X XX XX XXXX X XX X X XX XX X XX XX X XX XX X XXXXX X XXX X X X XX X X XX XX XX XXX XX XXXXX X XXX XX XX X X X XXX XXX XX X XXXX XX XXXXX XXX X X XX XX XX XXX XXXX X XXX XX XX X XX X X XX XXX X X XXX X XX X XXXXXX X XXX XXXX XX XX XX XX XXX X XX XX XXX X X X X XX X X XX XXX XX X XXX X X X X XXX XX XX XXX XXX XX X XX X XX X X X XX X XX XX X X XXX XXX X X XXXXXX XX X X XX XXXX XX XX XX X XX XXX XXXX X XXXXX XX XXX X X XXX X XX XX X XXX X XX XX XX X XXX XX X X X XX XX XXX X XX X XX X X X X XXX XXX X X X XXXXXX X XXXXX XX XXX XX XXX XXX XXXX XX X X X XXXX XX X X X X XXXX X X XXXX X XX XX XX XXX XXX XXX XXX X XXX XXX XXX X XX XXXX XXX XXX X XX XX X X XX X XX XX X X X XX XX XX X XX X XXX XXXXX XX XX X XX X XXX X XX XX XX XXX X X XXX X XXX X XXX X x x x XX X X X X XX XXX X X X XXX X XXX x XXXX X XX XX XXXX X x x x XX X X X X XX X X X X XXX XXX xx XX X X XX XX XX XX X X XX XX XXX XXX XX XXX XXXX XX X X X XXXX XXX X X XXX XX X XX X x X XX XXXXXX X XX XXXXXX XXXXX X XX XXX XX XX XX XX X X X x X X XX X XXXX X X X XX X XXX XX X XXXX XX XXXX XX XX X X X XXX XX ORIGINAL PICTURE ERROR LEVEL = 2 -16- E 1EEEEEEEEEEEEEEEEEEE Ell+EIE 144»6B 11113N A B4B AA+E1-B6 A 444 B11AIIEE4B8 B4B A4E1A BBB BBB A BB BBB A B BBB A 6 A A AA 3A A NA 3 3 3N NN EEE 3NN EEEEEEEEEBB 1322EEEEEEEE+ 1EE44»4 E1 + +3 44*«E A1+E$+3A B66N B 11126+3A 663 B«ElAlE*6+3 N63 N33A BNNN 3NN \3A BNNN 33N 33 N6N N3N 33N NN6 NNN 33N NNN 6NN E A3\B NN 6NN AMBB NN 3N6 N3t4E NN 3N NN3 N El + 3 N.N N .133 6NB N NNA 3EBB NB NN3 3214BB B N3. NN 8B 441 N 336 NN 6 BBB 6 AA N6B N B4*6B E11EEE NN6 3 BB4BEEEEEE1A NN211A B4»E4E1E1 12 NN11A EEE B A3NN NN3A B 3A-*N N63 B EEE111466 N6N 4EEE AA B6N NN 6N3 B66 N6 NN 66B N6N 33 66 N6N 3 N6 66 A3 N66 6 A3N N6N B NNN A36N B *EE B AANNN N 3A A1E26N N N N3A 3 N6 N3 N 3A NEE4BN66 3 N 3 B6644E 33 NN NN BB* 3N NN 3 BBBN NN BB6 NN 6 NN N N6B 66BB E44BB B6 PROCESSED PICTURE ERROR LEVEL •IT- XXXXXX XXXXX XXXX X XX XXX XX XX XX XXXX XX XX XX XX X XXX X X XX XX XXXXX XXXX XXXXX XXXX X X XX X XX X X XXXX XXX X X XXXX X X X XX XX X XX X X X X XX XX X XXXX X X X XX X X XX XXXX X X XX XXXXX XX X XXX XX XX XXX XX XXXX XXX X X XX X X X XX X XX X X XX X XX XXXX XX XX XXX X XX X XXX XX X X XX XX X XXXXX X XX XX X XXX X XX XX X X XXXX XXXXX XXX XXX XXX X XXX X X XX X XX XX XX X XX X X XX X X X XX XXX X XXX XX X XX XX X X X X XX X X XX X X X XXX XXX XX XX X X XX X XXX XX XX XXXXX X XX XX XX XXX X XX X X X X XX X XX XX XX XXXXX X XX XX X XXX XX XX XXXX X X XX X XXX XX XXXX XXXXXXXX XX XXX XX XXX XX X XXX X XX XXX X X XX X X XXX X X X XX XX X X X X XX XX X X XX X X X XX XX XX X X X XXX XX X XX X XXX XXX XX X X XXXX XXXX X X X X X XX X X X XX XXX X XX XXXXXX XX X X XXX XXX X X XX XXX XXXXXX XX X X XX XX XX X X XX XXX X X X XXX XXX XXX XXX XX XXX XX XX XX X X X XXX XXX XXXX XXX XX X XX X X XX XXXXXX XX XX XXX XX XX XX XXX XXX XXX X XXX XX X XX X X XXXX X XXX XXX X XX X XX XXX X XX XX XX X X XXX XXX XX XX XX XX XXX X X XXX X XX X X XX X XXX X XXX XXX XXXXXXX X XXX XXX X X XXX XXX XXX XX XX XXXXX X XX X XXX X XX X X X XX X X X XX X XX X X XXX X XX XX XX X X X XX XX XX X X X X XX XXX X XX XX X X XXX XX X XXXXX X XXX X XXX XXXX XX XX X X XX X XXX XX XX X X X XX XXXX X XXXXX X XX XX X X XX XX X X XX XXX X XX XX X XX XXXX XXX XXX XX XX XXX X XX X X XX XX X XXX XXXX XXXX XX XX XX XXX XX XX XXX X X XXX X XXXX XXXXXX X XXXX XXX X XX XX XX X X X XX XX XXX X XX X XXX XX X XX X XX XX XX XXXX XX X XX XXXX X XX X XX X X XXX XX XX XX XXX XX X XX X X XX X X X X XXX X X XX XX X XX XXX XXX XX X X XXXX XX XXX X XX XX X XX X XXX XXX XXX X X XX X XXX XXXXX XX XXX XXX X XXXXXX X XX X XXX X XX XX XX XXX XX XX XX XX X XXX XX X X XXX X X X XX X X XXX XXX X XXX X XX XXX X XXXX XXX XXX XX X X XXXX XX XX XX X XX XX X X XX X XXX X XX X X X X XX X XX X X X XX X X X XX XXXX X XX X X X X X XXXXX X X XX X X X X X X XX XX X X XX XX XX X XX XXX XXX XXXXX X XX XXX XXX XX X XX X X X X X X XX XX X XX XXXX XX XX X X XX XXX X X XX XX X XX X X X X XX XXX X X XXX X XX XXXXX X XXX XXX X XX XX X XX X XX X XX XXX XXX XXXXX X XXX X X XX ^X X XX X X XXX XX X X XXX X X XXX X X XXX X XXXXX XXX X XX XXXX XX X XX XX XXX XX X XX XXXXX XXX XXX X XX XX XX X XX X XX XX XX X XX X X XX XX XXX X XX XX X X XX X XXX XX XX X XX X XX X X X XX X XXX X X XXX XX X XX X XX XX X XX XXXXX XX X XX X X XX XXXXXXX XX XX X XX XX XX XXXXX X XXX XX XX XXXXX XX XXX X XX XX XXXXX XXX X XXXXXXX X XX X XX X X XX X X XX X XXXXX XXXX XXX X X XXXXX X X X XXX X XX X ORIGINAL PICTURE ERROR LEVEL = 3 ■18- ItEcEEEEcE R A122E 1EEE64 BBH 1111221 A 44 B44cll+1+1-6N A 4B R^ll!3N B6 B6C BBB . l + l- - N 6B R6M 6 BB NN B 44 BBB B»B 1 6 B 3 A N 3 r\N3 N N.3 E 3AB B B 33 BB N24 B BB4133 B N3 B BB 3N 33 B 666B EEEEEEEE AA 3.oN NEEEEEEEE»44 Al N 4E13+«2EEEE6 AEE44»*2*E A 3 64-++23 B 44*»» B A+1441+++A B B66i6 6BEEE111162$A. B 66 + N BE1+311462+AA N6+3 N6+++A NN+1EEE 333 N3+AA NN 333 A N33A N6 A .N3N Ell 333 NN A NNN E A A33N NN EE1 3 666 E BB 3+6B NN .66 N B4E A2+BB N3 4EE 3N» B B NN3E4E N El + 33 N63 N LE41+31 3.N N 61 3 A 5.6 N NN1A lEee MB N3A 6BB 6 B 3A B6 B441 N A3A 6 BeSB N A33 A B N6 B466 E113 A A B 3K BBB4EElEfcllAN A 3 1ENE-13N BR4411*ll4»86 A 224ELEEE A N6-S+N B4«E*E 44»BA 33NN EE«N$i$»6B 4E1 B4«4B 3$t$3N N6+11.B B6N6B Al EE4E 1 1 IE 66N BN«*+144B B4»44E1A114EE311446N NN33 4E44A NA 633A B66 N6.3 N A3A 66B 336N B6 A33 N66 N«N 641+A NN»1 EEEE.EE46 NB-33 N2»6 66 N3.. $E*6N 66 NN + N 33-$»N B AB A NN2 + E 33AN6. 4EE A1E 6 B A N 4 13+ES.NN BB4EN N 3 B N A B336A336N A 1E23 6 N 1 NA 3+21-4266 A N3 N6 El 3 11NE1E4EB44EE1 3A *U B 3N 64BE1 53 N N NB46 A5 N N 46H AA N 6611A BN N M A 6 B2244 B A N *2E5 N B A N «-$«66 +EE E44»E E E44EEEE EE PKOCESSED PICTURE ERROR LEVEL ■19- k . RECONNECTION h .1 General Another form of noise is burst noise. It differs from random noise because it is completely local; all points in a small area have been erased. Clearly, the noise cleaning routine cannot be used to correct this noise. The method of correction is to reconnect the lines which have been broken. To select the lines which are to be reconnected, one must consider such things as the direction and the curvature of the lines, and the size of the gaps. It is important that the decision consider the continuity of the curvature of the lines . k .2 Generation of Burst Noise The pattern used in the noise cleaning testing is also used in the testing of the reconnection routine. The point where the curved line in Figure 3 crosses itself was selected for the center of the noise area. A plane called NOISE is used as a negative mask on the input picture. Each time the program is iterated, the points in NOISE are smeared to produce a larger noise area. Then a plane called NOISY is set as NOISY = ORIG • NOISE, thus causing points to be removed from ORIG. k .3 Reconnection Process The first step in the reconnection process is the selection of end points. This is done by nearly the same process used in the noise cleaning routine. The difference is that the labels are extended to nonlabeled points after the LABEL routine. The nonlabled points are given the labels of their neighbors by a directional smearing process. The end point coordinates are listed, then the program leaves the parallel processing mode and processes this list. 1. See program listing in Appendix II and flow chart in Figure k, -20- Read ORIG picture i Add NOISE 1 LABEL all points 'of NOISY picture I Find END POINTS in pi cture 1 List and Count END POINTS I For each pair of END POINTS: Test for possible connections and calculate continuity of curvature through gap (see Figure ^b) I J For each END POINT; Find the best connection point (if one exists) by selecting minimum change in curvature through the gap I Reconnect the best connections I Output: Reconnected picture Figure ka . Reconnection Routine Flow Chart ■21- Enter from Fig. Ua Get next pair of END POINTS 1 Return to Fig. ka (No more pairs) L^ Length of gap between END POINTS Record BAD-PAIR Indicator Find three segments of length L in each line 1 Find the directions and weighted dir e c tions of the s e gme n t s I Find curvatures of gap and outside sections (using unweighted directions) Does the sign of the gap curvature agree with those of the outside sections? I No Yes Find curvatures on both sides of gap (using weighted directions) I Put differences between curvatures in ' DIFERS' array Figure l*b . END POINT Test Flow Chart ■22- For each pair cf end points , the length of the gap which may separate them is approximated as the larger of the x or y differences in coordinates. If this length, L, is greater than 12, the gap is too large for the size of the burst being used, and the next set of points is started. If L < 12, the subroutine SPREAD is used to find line segments of length L which extend from the end points. This is done three times for each end point. The second segment begins at the far end of the first segment, and the third at the end of the second. This produces three sequential segments of each line (seven in all, including the gap) of length L The eight coordinate sets of the junction and terminal points are put in a block called SEGSC (segment coordinates) „ The SPREAD routine is entered with the starting coordinates in location ENDC and L in PAX index register 8„ SPREAD returns to the main program with the other end point of the segment m ENDC, Then, for each segment., the direction of the line is found by computing DIR = ARCTANGENT (DY/DX)„ This direction is changed to conform to our labeling convention by making 1,0 < DIR < 9°0° With seven segments, there are six junction points (three on each side of the gap), At each junction point the change in direction, DELTAD, is computed as the difference between the two segment directions. This gives an indication of the curvature of the line at that point. Also, a weighted set of changes in direction are computed by multiplying the DELTAD 1 s nearest the center of the string by 3i multiplying the next nearest DELTAD' s by 1,5, and by leaving the outside DELTAD' s un- modified, 'These weighted values are put in a block called WATDD, This gives more emphasis to the curvatures near the gap, and is useful in getting an accurate indication of the continuity of the curvature, A preliminary test of the signs of the curvatures , is made. Three curvatures are computed: one is the sum of the two center DELTAD' s, the other two are the sums of the extreme DELTAD : s, If the signs of these two outside curvatures agree, the center (or gap) curvature is tested „ If its sign disagrees with the other two, computation is terminated and the next pair of end points is started. If the signs of the two outside curvatures disagree, no conclusions can be drawn, and the computation continues. -23- Two more curvatures are computed. They are the sums of the first three and last three WATDD's. The difference between these two is put in a two-dimensional array called DIFERS. DIFERS(a,b) and DIFERS(b,a) are set to this difference for the end points a and b. If the computation terminates prematurely (L > 12, sign test fails, etc.) these DIFERS are set to 10.0 (larger than any possible difference). This completes the computations for each pair of end points. When all pairs have been computed, the test for the best connections begins. First, the value 10.0 is stored in all primary diagonal elements of DIFERS. Then, for each value of a, the minimum value of DIFERS(a,b) is found and this b is the best connection for a. The end points a and b are entered in the reconnection list, OKCS (O.K. connections). If no best connection is found, no points are entered in OKCS. When all a's have been checked, each pair of points in OKCS is connected in NOISY and this becomes the output picture. h.k Results The results of the program are shown in Figure 5„ Three sizes of burst were tried, and the outputs show that the errors in reconnection increase as the size of the burst increases. However, these results show that the routine is sound in principle and can be used in the cleaning of burst noise of small size. -2k- xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxxx xxxxx xxxx xxxx xxxx XXX XXX XXX XX XXX XXX XXX XXX XX XXX XXX X XX XX XX XX XX XXX XX XEE XXXXXXX XXXXXXXXXXXXXXE EXXXXX XXXXX E EX XXX XX XXX XXX XXX XXX EE XXX XXX XX XX XXX XX XX XX XX XX XX XX XX XX XX XX XXX XX XX XXX XX XX XX XX XX XX XX XX XXX XX XXX XX XXX XXX XX XX XXX XX XXX XX XX XX XXX XX XXXX XXX XXX XXX XXXX XX XXXX XXXX XX XX XXXXXXXXXX EXXX XX XXXXXX XXXXE XX XX XX XXX XX XX XX XXX XX XX XX XXX XXX XXX XXX XX XX XX XX XX XX XXX XX XXX XX XX XX XX XX XXX XXX XXXXXX XX XX XXXXXXXXX XX XX XXX XXXXXX XXX XX XX XXXXXXXX XXX XX XXXXXX XX XX XX XX XX XXX XXX XX XX XX EX XX XX XX XX XX XXX E XX XXX XX XXX No. 1 ORIGINAL •25- XXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXXXXXX XXXX XXXXX xxxxx XXXX XXXX XXXX XXX XXX XXX XX XXX XXX XXX XXX XX XXX XXX X XX XX XX XX XX XXX XX XXX XXXXXXX XX xxxxxxxxxxxxxxx xxxxxxxxx XXXXX XXXXXXXX XXX XX XX XXX XXX XX XXX XXX XX XXX XXX XX XX XXX XX XX XX XX XX XX XX XX XX XX XX XXX XX XX XXX XX XX XX XX XX XX XX XX XXX XX XXX XX XXX XXX XX XX XXX XX XXX XX XX XX XXX XX XXXX XXX XXX XXX XXXX XX XXXX XXXX XX XX xxxxxxxxxx XXXX XX xxxxxx XXXXX XX XX XX XXX XX XX XX XXX XX XX XX XXX XXX XXX XXX XX XX XX XX XX XX XXX XX XXX XX XX XX XX XX XXX XXX XXXXXX XX XX XXXXXXXXX XX XX XXX XXXXXX XXX XX XX XXXXXXXX XXX XX XXXXXX XX XX XX XX XX XXX XXX XX XX XX XX XX XX XX XX XX XXX X XX XXX XX XXX No. 1 PROCESSED -26- xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxxx xxxxx xxxx xxxx xxxx XXX XXX XXX XX XXX XXX XXX XXX XX XXX XXX X XX XX XX XX XX XXX EX XXXXXXX EXXXXXXXXXXXXXE EXXXX XXXXX X XXX E XXX XXX XXX XXX XXX XXX EE XX XXX XX XX XX XX XX XX XX XX XX XX XX XXX XX XX XXX XX XX XX XX XX XX XX XX XXX XX XXX XX XXX XXX XX XX XXX XX XXX XX XX XX XXX XX XXXX XXX XXX XXX XXXX XX XXXX xxxx XX xxxxxxxxxx XX xxxxxx XX XXX XX XX XXX XX XX XXX XX XX XXX XX XX XX XXX XX XX XXX XX XX XX XXX XX XXX XX XXX XX EXXX XXXXE XX XX XX XX XXX XX XX XXX XXX XXX XX XX XX XX XX XXX XX XX XX XXX XXXXXX XX XXXXXXXXX XX XXX XXXXXX XXX XX XXXXXXXX XX XXXXXX XX XX XX XXX XX XX EX XX XX XX E No. 2 ORIGINAL -27- xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx XXXXXXXX XXXXXXXX XXXX XXXXX XXXXX XXXX XXXX XXXX XXX XXX XXX XX XXX XXX XXX XXX XX XXX XXX X XX XX XX XX XX XXX XX X XXXXXXX X XXXXXXXXXXXXXXX xxxxxxxxx XXXXX ; [ X> 1 XXX •••EXECUTION TERMINATED VIA SYSERR. No. 3 PROCESSED ■30- EXTRACTION OF FEATURES ■ .ion 01 minary approach to the extraction of atures from a Line-like drawing. The program has not been written, but would rely on the reconnection process of Part k. The purpose of the program will be only a low-level extraction, with no identification of the extracted portions. (Further processing would require the identification,) Extraction Process As an example of this extraction process, consider the face shown below: For the extraction, it is desirable to separate the ears, eyes, nose, mouth and neck from the outline of the face. The eyes, nose and mouth are disjointed from the other parts and are easily extracted. The neck and ears are more difficult because they are directly connected to the face outline. The first step in extracting the features is to label the points of discontinuity ("punctuation" points) as follows: node - lines enter the point from four directions; i.e.*^C branch - lines enter the point from three directions; i.e. / — vertex - lines enter the point from two nonopposite directions, i,e.^ terminal - only one line enters the point; i.e. *""" -31- Directional continuity through punctuation points is then tested. This results in the extraction of the neck and the ears, but leaves the outline of the face in two segments. The reconnection routine is then used to correct such errors o In more difficult cases, higher level tests will be necessary. These could include a combination of the direction continuity test and the reconnection probability, or could make use of a dictionary of basic forms found in the picture [l]. [1] Ledley, R. S. and J, B, Wilson, "Concept Analysis by Syntax Processing." Proc, of Amer. Doc. Inst., Annual Meeting, Vol. 1, pp. 1-8 (October, 196U) -32- APPENDIX I. PLOTXY ROUTINE An addition to PAX has been used in these programs. The addition is called PLOTXY. Given a series of coordinates, this routine plots through the series by connecting the coordinates with straight line segments. The routine is called by the order: PLOTXY PLANE, PX,FIRSTC,CX,N, NX where PLANE, PX is the plane (indexed) where the line is to be plotted, FIRST, CX is the location of the first coordinate (indexed) to be plotted, and N,NX is the number of coordinate sets (indexed) in the list. The previous contents of the plane are undisturbed. -33- APPENDIX II ♦** PROGRAM LISTINGS LABEL SUBROUTINE - PAGE 1 OF 1 - LABEL INDEX SET, 1,4 BCOLOP NEWVAL, , CLEAR LOOPA INDEX DECK, 1, 1 BOOLOP TEMPI, , EQUAL, INPUT BCOLOP TEMP2, , EQUAL, INPUT SHIFTD TEMPI,, 1, 1,2 SHIFTD TEMP2, ,4, 1,2 BCOLOP TEMPI, , AND, TEMPI, ,TEMP2 BOOLOP IODIR, 1, AND, TEMPI, , INPUT BCOLOP I0DIR+4*144, 1, EQUAL, I0D1R,1 BCOLOP NEWVAL, , OR, NEWVAL, , IODIR, 1 JUMP NOZERO, LOOPA, 1 INDEX SET, 1,4 BOOLOP NOCON, , EQUAL, NEW VAL,, , ,BAR LOOPU INDEX DECR, 1, 1 INDEX TRANS, 2, 1 INDEX TRANS, 3, 1 INDEX TRANS, 4, 1 INDEX INCk,2,4 INDEX INCR,3, 3 INDEX 0ECK,4, 1 TMARK DL1, 1, TEMPI, , NOCON, , IODIR, 2, EQ,1 INDEX SET, 11,3 LOOPU1 INDEX DECR, 11, 1 JUMP LESS, GOON1A, 3,8 INDEX DECR, 3, 8 GOON1A JUMP MORE, GOON1B, 4,-1 INOEX INCR,4,8 GOON1B JUMP LESS, GOON1C, 4,8 INDEX DECR, 4, 8 GOON1C TMARK DL1,3,TEMP2, , TEMPI,, IODIR, 4, EQ,1 GOON2 BOOLOP NEWVAL, , OR, NEWVAL, , TEMP 2 BCOLOP NEWVAL, , OR, NEWVAL, , TEMP2 BCOLOP IODIR, 1, OR, IODIR, 1, TEMP 2 BCOLOP IODIR, 3, OR, IODIR, 3, TEMP 2 INDEX INCR,3, 1 INDEX INCR,4,1 JUMP NOZERO, L00P81, 11 JUMP NOZERO, LOOPB, 1 BOOLOP NOCON, , EQUAL, NEW VAL,, ,,BAR JUMP RETURN, ,8 CLA DL 2,1,5 DL 2,2,6 DL 2,3,7 DL 2,4,8 • 3 U- NOISE CLEANING ROUTINE - PAGE 1 OF Z - SETMOD 11 BCOLOP ALL, , CLEAR, ,,, ,BAR NEWPIC r2f » EQUAL, T5ALL SHIFTD TEMP2,, 1,1,1 BCOLOP CENDS, 1, AND, TEMPI, , TEMP2 JUMP NOZERO, LABELE, 1 INDEX SET, 1,3 XLA3S INOEX DECK, 1,1 EXTEND LAbELS RY ADDING T4 ( D- 1 ) + T4 ( 0+ 1 ) INDEX TRANS, 2,1 INDEX TRAslS,3,l INDEX DECK, 2,1 INDEX INCK,3,1 JUMP MORE, G00N4A, 2,-1 INDEX INCR,2,4 GOOiN-tA JUMP M0Rc,G00N4B, 3,-1 INDEX INCR,3,4 G0CN4B JUMP LESS, G00N4C, 2,4 INDEX DECK, 2, 4 G0CN4C JUMP LESS, G00N4D, 3,4 INDEX DECR,3,4 GC0N4C BCOLOP DENOSX , 1 , OR , DENDS , 1 , T4 , 2 BOOLOP DENDSX, 1, OR, DENOSX, 1, T4, 3 JUMP NOZERO, XLABS, 1 ■35- NOISE CLEANING ROUTINE - PAGE 2 OF 2 - INDEX SET, 1,8 INDEX SET, 2, 4 GROW INDEX DECR,1,1 EXTEND DENDSX INTO T4 INDEX DECR,2,1 JUMP MORE, GU0N6, 2,-1 INDEX INCR,2,4 GCCNo CHAIN DL1, 1,NEWPTS,1, DENDSX, 1, T4, 2 JUMP NOZERO,GROW, 1 INDEX SET, 1,3 INDEX SET, 2, 4 COMP'XR INDEX DECK, 1,1 WERE NEW POINTS PICKED UP INDEX DECR,2,1 JUMP MORE, GOON5, 2,-1 INDEX INCR,2,4 GC0N5 BCOLOP COMP , , AND , NE wP T S , 1 , T5 , 2 , BAR JUMP NONULL,'"SSor oi 30112088398208