Pattern matching method and apparatus

Abstract: Disclosed is a pattern matching method and apparatus, wherein when an object pattern is coated with a master pat­ tern using pattern matching, an area corresponding to the master pattern size is sequentially extracted from a master sample image for forming the master pattern, each extracted pattern is collated to the other patterns in the image, and an ex­ tracted pattern, which has the minimum similarity to all the oth­ er patterns, and, as a result, shows the most distinctive pattern is used for a master pattern. Using the present method and ap­ paratus, the pattern matching having a higher recognition rate can be performed. Further, using the present pattern matching, an apparatus for positioning the object to be recognized with a higher accuracy can be obtained.

Description: BACKGROUND OF THE INVENTION 1) Field of the Invention The present invention relates to a pattern recognition apparatus, more particularly to a pattern matching method and apparatus wherein the optimum master pattern can be selected quantitatively when the pattern matching is processed. 2) Description of the Prior Art The inventors of the present application have already disclosed a Master Pattern Pick Up Method in Japanese Unexamined Patent Publication (Kokai) JP-A-59 4130. This publication shows a method of forming a master pattern in a pattern matching. In this method, only the appropriateness of the master pattern indicated by an operator is checked, and the best method of forming a master pattern is not always provided. That is, the master pattern indicated by the operator is checked only for whether it has similar patterns or not in the image picture. The most appropriate master pattern or the master pattern having the most distinctive features, which has the minimum similarity to the other patterns in the image, is not selected. Also, since this must be determined by the operator, there is little or no reduction of the work load for the operator. There is also known from patent document US-A-3 898 617 a system for detecting the position of a pattern, wherein a specific partial pattern in a pattern of an object is previously stored as a standard pattern. Two-dimensional partial patterns are sequentially set out from the pattern of the object picked up by an image pickup device, and the partial patterns set out are successively compared with the standard pattern to thus detect degrees of coincidence. Coordinates of a position to be found on the pattern of the object are calculated from the coordinates of a position representing the most coincident partial pattern. Finally, EP-A-0 066 321 describes a pattern recognition procedure, in a teach mode, for automatically selecting a reference image for comparison with a target image. Subsignatures having the most useful information contained therein are selected by comparison with subsets of the total signatures during the teach mode. In the run mode, the subsignatures thus selected are compared with snapshot signatures of a target object for precise location of corresponding portions of said target object. SUMMARY OF THE INVENTION An object of the present invention is to provide a pattern matching method and apparatus based on a concept of picking up a master sample that includes a master pattern and automatically detecting a pattern having the most distinctive features, wherein operation by the operator is not necessary as the most appropriate master pattern is automatically obtained. That is, the master pattern in the image picture having the most distinctive features i.e., having the minimum matching degree to the other patterns, is selected and memorized, and a pattern recognition having a high recognition rate and highly accurate positioning through the pattern recognition is carried out using the master pattern. According to an aspect of the present invention, there is provided a pattern matching method comprising the steps recited in claim 1. According to another aspect of the present invention, there is provided a pattern matching apparatus as defined in claim 3. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 is a block circuit diagram of a pad pattern position recognition apparatus for a fully automatic wire bonder using a pattern matching method and apparatus according to a first embodiment of the present invention; Fig. 2 is a block circuit diagram of a mater pattern forming circuit in the apparatus shown in Fig. 1; Fig. 3 shows an example of an image picture stored in a frame memory in the apparatus shown in Fig. 1; Figs. 4A, 4B, and 4C are diagrams of the relationship between extraction areas shown in Fig. 3 and matching degrees; Fig. 5 is a block circuit diagram of the master pattern forming circuit according to a second embodiment of the present invention; Fig. 6 shows an image picture of a master sample for explaining the circuit shown in Fig. 5; Fig. 7 is a graph showing an example of a relationship between each extraction pattern size and the similar pattern matching degree in the circuit shown in Fig. 5; Figure 8 is a block circuit diagram of a master pattern forming circuit according to the present invention; Figs. 9, 10, and 11 are diagrams of a correlation between the position of the master pattern and the pattern matching degree for various shapes of an image pattern; Figs. 12A, 12B, and 12C, and Figs. 13A, 13B, and 13C are graphs showing first order differential values and second order differential values of matching degree curves for explaining the circuit shown in Fig. 8; Fig. 14 is a block circuit diagram of an extraction circuit, an extraction size command circuit, and a pattern matching control circuit shown in Fig. 5; Fig. 15 is a block circuit diagram of a similar pattern detection circuit shown in Fig. 2; and Figs. 16A and 16B are a block circuit diagram of a pattern matching circuit shown in Fig. 2. DESCRIPTION OF THE PREFERRED EMBODIMENTS Figure 1 shows a block circuit diagram of a pad pattern position recognition apparatus for a fully automatic wire bonder using the pattern matching method and apparatus according to a first embodiment of the present invention. A sample feed mechanism 1 introduces a master sample 2 or an object sample 3 to be recognized placed thereon, into an image pickup system, for example a television (TV) camera 4. The pickup signal by the TV camera 4 is converted to a digital signal through an analog to digital (A/D) conversion circuit 5 and stored in a frame memory 6, which is an object pattern memory. When the object sample 3 is placed on the sample feed mechanism 1 and a master pattern has been stored in a master pattern memory 7, in a pattern matching circuit 9, the collation (pattern matching) between the master pattern and the image of the object pattern in the frame memory 6 is processed and a pattern portion which is matched at the highest degree to the master pattern is sent to a control circuit 10 as a desired pad position. The control circuit 10 controls a bonding mechanism 11 using the positioning information and automatic wire bonding is then carried out. On the other hand, at the time the master pattern is formed, the most appropriate pattern portion is selected as a master pattern in a master pattern forming circuit 8 from a master sample image stored in the frame memory 6 and picked up from the master sample 2 placed on the sample feed mechanism 1, and the selected portion is stored into a master pattern memory 7. The operation of one aspect only of the above-mentioned master pattern forming circuit 8 is explained with reference to Figs. 2 and 3. The master pattern forming circuit according to the invention further comprises a second order differential circuit as exemplified in the part of the description referring to Fig. 8. Figure 2 is a block circuit diagram of part of the master pattern forming circuit 8 and circuits connected thereto. When the master pattern is formed, the master sample image has been stored in the frame memory 6. Figure 3 shows an image 60 stored in the frame memory 6. The images showing pads 62 hatched on a chip 61 of an integrated circuit (IC) are included in the image 60. An extraction circuit 81 extracts a small area (0, 0) from the frame memory 6. A pattern in the small area is stored in the master pattern memory 7 as a temporary master pattern. A pattern matching control circuit 82 makes the pattern matching circuit 9 to perform the patterns matching between the master pattern and all the patterns stored in the frame memory 6. The pattern matching circuit 9 scans, in the frame memory 6, the pattern in the master pattern memory 7. At each scanning point, the pattern matching degree signal S(92) between the master pattern and the corresponding pattern portions in the frame memory 6, and scanning position signal S(91), are sent to a similar pattern detection circuit 83. The similar pattern detection circuit 83 checks the sequentially transferred pattern matching degree signal S(92), and looks for the highest (first rank) pattern matching degree other than the extracting position (0, 0) of the extraction pattern. The first rank pattern matching degree is stored as a similar pattern matching degree M₂ (0, 0) to the extraction pattern (0, 0). In the above explanations the reference symbol (0, 0) shows coordinates at the upper left corner in the extraction pattern showi. in the Figure. The similar pattern detection circuit 83 includes a master pattern determination circuit. The extraction circuit 81 operates to store the next extraction pattern (1, 0) into the master pattern memory 7, looks for the first rank pattern matching degree, and obtains the similar pattern matching degree M₂ (1, 0). The above-mentioned extraction operation is performed to the end, namely the coordinates (x m , y n ) in the frame memory 6. Figure 4A shows a graph for the extraction pattern (0, 0). The abscissa of the graph is the scanning position signal S(91) transferred from the pattern matching circuit 9. The ordinate is the pattern matching degree signal S(92), In Figs. 4A, 48, and 4C, patterns at the left side show extraction patterns. In the case of Fig. 4A, since the extraction pattern (0, 0) does not include a pad pattern, when the scanning positions are positioned at the portions not including pad patterns, all pattern matching degrees are 100 percent. Thus, the similar pattern matching degree M₂ (0, 0) is 100 percent. In Fig. 4B, a similar graph is shown for the extraction pattern (x₁ , y₁) in Fig. 3. In the extraction area, one pad pattern is included. In this case, the pattern matching degree at the scanning position (x₁ , y₁) becomes, of course, 100 percent, also a pattern matching degree close to 100 percent is obtained at the position (x₂ , y₂). If the pads are the indentical shape, the pattern matching degree becomes 100 percent and this value is simultaneously the similar pattern matching degree M₂ (x₁ , y₁). Figure 4C shows a graph similar to Figs. 4A and 4B but corresponding to the extraction pattern (x₃, y₃). In this case, the pattern matching degree at the scanning position (x₃ , y₃) becomes 100 percent, as in Fig. 4B. However, the pattern matching degree does not reach such a high degree except in the case of the scanning position (x₃, y₃). Thus, the similar pattern matching degree M₂ (x₃ , y₃) is lower than that of the examples in Figs. 4A and 4B. The extraction pattern (x₃ , y₃) is a considerably distinctive pattern in the image 60. In Figs. 4A, 4B, and 4C, portions referred to as B are the extraction pattern themselves. These portions are, of course, not involved in the detection of the similar pattern matching degree M₂. The extraction pattern having the minimum value M 2min out of all similar pattern matching degrees M₂ corresponding to all extraction patterns, is the most distinctive pattern in the image 60. To this end, the waveform of the pattern matching degree is calculated for each collating position, the waveform relating to the shifting of one extracted pattern along the x or y coordinate, the other, y or x coordinate being held constant, and to the resulting degree of similarity at each position; thereafter differentiating the waveform of the pattern matching degree to a second order; measuring the interval length la between the peaks of the second order differential waveform; and thereby registering an extracted pattern having a minimum degree of similarity as the master pattern, such that the measurement is within a predetermined range. If the master pattern determination circuit in the similar pattern detection circuit 83 determines the extraction pattern having the M 2min as a master pattern the most reliable pattern matching process can be carried out. If M₂ < α, the extraction pattern is allowed to be the master pattern. If M₂ ≥ α, the extraction pattern is not allowed to be the master pattern. Therefore, the master pattern formed by the above process does not always provide the most appropriate master pattern, i.e., that which has the lowest similarity degree to the other extraction pattern, as does the present embodiment. The value α is an allowable similarity degree, for example, 80 percent. A second embodiment corresponding to the method and apparatus of claims 2 and 4 respectively is explained with reference to Figs. 5 and 6. In the preceding part of the description, the size of an extraction area is predetermined, and the most distinctive pattern defined at that size is detected. Figure 5 shows a block circuit diagram of the master pattern forming circuit 8 according to the second embodiment. The difference between the second embodiment and the circuit shown in Fig. 2 is the addition of an extraction size command circuit 84 and an extraction size determination circuit 85. The extraction size command circuit 84 commands an initial extraction size (area 65 in Fig. 6) of the given master sample image, to the extraction circuit 81. The extraction circuit 81 sequentially extracts the area having the size 65 from the master sample image. As shown in the first embodiment, the similar pattern matching degree M 2min at size 65 is detected by the similar pattern detection circuit 83. The similar pattern matching degree M 2min is transferred to the extraction size determination circuit 85. Then, changing the extraction size 65 to the next size 66, the extraction size command circuit 84 performs processes similar to the above-mentioned processes. When these operations are repeated, the similar pattern matching degrees M 2min corresponding to each extraction size are obtained at the extraction size determination circuit 85, as shown in Fig. 7. After applying the plurality of extraction sizes, the extraction pattern having the minimum M 2min is determined as a master pattern. Using this method, the extraction size which has the least pattern matching degree to the other patterns in the master sample image, namely, the most distinctive pattern, can be determined. If an allowable value "a" percent is predetermined as a master pattern regarding the similar pattern matching degrees M 2min , when the extraction size is changed sequentially and the value of M 2min becomes lower than "a" percent, the extraction size, at that moment, is determined as a master pattern size. As a result, the determination of the master pattern size can be speeded up. As stated above, in the second embodiment, there is an advantage wherein the master pattern size, which was determined as a certain size, can be determined with an optimum value, automatically. Figure 8 shows a block circuit diagram of a master pattern forming circuit 8 according to the present invention. The circuit 8 comprises the circuit in Fig. 2, a second order differential circuit 86, and a peak interval checking circuit 87. The principle of the operation in the third embodiment is now explained with reference to Figs. 9 and 10. Curves 71 and 76 in Figs. 9 and 10 show pattern matching degrees between the object patterns 73 or 78 and moving master patterns 74 or 79, respectively, (corresponding to the portions referred to as β in the curves in Fig. 4A, 4B, and 4C). As found from the curves 71 and 76, where the object pattern and the master pattern include many longer figures in the lateral direction (Fig. 9), when the master pattern moves to the x direction the curve showing the pattern matching degree has a gentle slope. On the other hand, as shown in Fig. 10, where the patterns include longer figures in the longitudinal direction, the curve is steep. In the position recognition using pattern matching, the sharper the curve the higher the positioning accuracy. Namely, when the curve is a gentle slope, as is the curve 71 in Fig. 9, the accuracy of the positioning decreases because the peaks at the matching position are not well-defined. Curves 72 and 77 in Figs. 9 and 10 show the pattern matching degree when the master pattern moves to the y direction. In this case, the curve 72 is sharp and the curve 77 is gentle. As mentioned above, in the pattern of Fig. 9 the positioning accuracy along the y direction is high, but the positioning accuracy along the x direction is low. In the pattern of Fig. 10, on the contrary, the positioning accuracy along the x direction is high and the positioning accuracy along the y direction is low. As a result, both the patterns in Figs. 9 and 10 are not patterns appropriate for increasing the position accuracy. The pattern shown in Fig. 11, which has sharp curves in both the x and y directions, is the most appropriate pattern. The pattern matching apparatus comprises the second order differential circuit 86 and the peak interval checking circuit 87, shown in Fig. 8, as means to check whether the master pattern is appropriate or not. The operations of the two circuits are explained with reference to Figs. 12A, 12B, and 12C, and Figs. 13A, 13B, and 13C. Curves shown in Figs. 12A and 13A are the curves showing the pattern matching degrees similar to those in Figs. 9 and 10. To check the sharpness of the curve, the second order differential circuit 86 forms second order differential curves, as shown in Figs. 12C and 13C, from the curves in Figs. 12A and 13A, respectively. The curves in Figs. 12B and 13B are first order differential curves, as a medium step therebetween. The second order differential curves each have two peaks. The length of peak intervals ℓa and ℓb corresponds to the sharpness of the original curves shown in Figs. 12A and 13A. The intervals ℓa and ℓb are checked by the peak interval checking circuit 87. If the intervals are shorter than a predetermined allowable length, the formed master pattern is determined as the most appropriate one. If the intervals are longer than the predetermined allowable length, instead of the initially selected master pattern, another master pattern, for example, having a pattern matching degree M₂ of the next lower rank, is accepted. As mentioned above, by using the apparatus of the third embodiment, a master pattern capable of a high accuracy positioning can be formed. The details of the extraction circuit 81, the extraction size command circuit 84, and the pattern matching control circuit 82 in the apparatus of the second embodiment are explained with reference to Fig. 14. The circuits can be applied partially to the apparatus of the other embodiments. Figure 14 shows the block circuit diagram of the extraction circuit 81, the extraction size command circuit 84, and the pattern matching control circuit 82. An X extraction register 811 for storing an initial x value in extraction, and a Y extraction register 812 for storing an initial y value in extraction, store coordinate values of the scanning start point (upper left point in the figure), and supply information to an X address counter 813 and a Y address counter 814. The X address counter 813 and the Y address counter 814 point out an address of the frame memory 6. An X size register 815 and a Y size register 816 indicate extraction sizes along the directions X and Y to the address counters, respectively. The extraction size command circuit 84 comprises an X size counter 841 and a Y size counter 842. The X size counter 841 and the Y size counter 842 supply information for designating the extraction size to the X size register and the Y size register, respectively. The pattern matching control circuit 82 comprises a flip-flop 821. The flip-flop 821 receives the signal from the Y size register 816, is set by the signal, supplies a start signal to the pattern matching circuit 9, and is reset by an end signal from the pattern matching circuit 9. Figure 15 shows a block circuit diagram of the similar pattern detection circuit 83 in accordance with the invention. A pattern matching degree signal S(92) from the pattern matching circuit 9 is supplied to a comparator 831 and, simultaneously, to a M ax register 832. The comparator 831 compares the value A of the signal S(92) with the value B of the M ax register. If A ≧ B, a latch signal is sent to the M ax register 832 from the comparator 831, and the value A of the signal S(92) is stored in the M ax register 832. The comparator 834 compares the value C of the M ax register 832 with the value D of a M in register 833. If C ≦ D, a latch signal is sent to the M in register 833 from the comparator 834, and the value C from the M ax register 832 is stored in the M in register 833. The data of the M 2min previously mentioned is stored in the M in register 833. Figures 16A and 16B show a block circuit diagram of the pattern matching circuit 9 in accordance with the invention. The frame memory 6 is controlled by signals from a data buffer DB and from a decoder DC through a memory controller for the frame memory 6. The frame memory 6 supplies data of correlator -2(94) through a shift register 91, which converts the parallel signal to a serial signal. Master pattern data from the master pattern memory 7 is also supplied to a shift register 933 in the correlator 93 and to a shift register 943 in the correlator 94 through a shift register 92, as for the data of the object pattern. An inverting exclusive logical summation between the outputs of the shift registers 931 and 941 and the outputs of the shift registers 933 and 943 occur one by one through exclusive NOR gates 932 and 942. The output of the exclusive NOR gate 932 is added to the output of the exclusive NOR gate 942 through an adder 951. By these operations, the number of coincident pixels by the collation between the pattern in the frame memory 6 and the pattern in the master memory 7 can be obtained. When the result of the addition is obtained at one line, the result is stored in a data memory 90. The data in the data memory 90 is controlled by a memory controller 901, is applied to an adder 952 through a data register 96, and is added to the summation of the next one line collation, namely, the output of the adder 951. The added value renews the stored value of the data memory 90. As mentioned above, in the data memory 90, the pattern matching degree of one frame between the pattern in the frame memory 6 and the master pattern is obtained. The pattern matching degree is sent to the similar pattern detection circuit 83 as a form of the signal S(92). The scanning position signal S(91) is sent to the similar pattern detection circuit 83 from the memory controller 901.

Claims: A pattern recognition method comprising the steps of: extracting from the image of an object a sequence of patterns of predetermined size and shape ((0, 0) to (x m , y n )) representative of successive portions of the image, and collating each extracted pattern ((0, 0) to (x m , y n )) with a preselected master pattern, wherein said master pattern is preselected by the steps of picking up the image (60) of a master object for forming the master pattern, starting from the initial point of the master object image, extracting a sequence of patterns of predetermined size and shape ((0, 0) to (x m , y n )) representative of successive portions of the image in order to form said master pattern, collating each extracted pattern ((0, 0) to (x m , Y n )) with every other extracted pattern (-(0, 0) to (x m , y n )) in the image; calculating pattern matching degrees between each extracted pattern and all the other patterns in the master object image, selecting the degree of similarity (M₂) of each extracted pattern as the maximum matching degree between each extracted pattern and all the other patterns, calculating the waveform of the pattern matching degree for each collating position, said waveform relating to the shifting of one extracted pattern along the x or y coordinate, the other, y or x, coordinate being held constant, and to the resulting degree of similarity at each position, differentiating the waveform of the pattern matching degree to a second order, measuring the interval length (ℓa) between the peaks of the second order differential waveform, and registering an extracted pattern having a minimum degree of similarity as a master pattern, such that the measurement is in a predetermined range. A method as set forth in claim 1, comprising the steps of : sequentially changing the extraction pattern size, and calculating the pattern matching degrees for patterns having different extraction sizes. A pattern recognition apparatus, having : an image pickup system (4) for picking up an image of an object (2, 3) placed on an object feed mechanism (1); an analog to digital converter circuit (5), for converting the analog pickup signal from the image pickup system (4) to a digital signal; an object pattern memory (6), for receiving the output of the analog to digital converter circuit (5), a master pattern memory (7), and a pattern matching circuit (9) connected to the object pattern memory (6), and the master pattern memory (7), also comprising a master pattern forming circuit (8) connected to the object pattern memory (6) and to the master pattern memory (7), said master pattern forming circuit (8) comprising a distinctive pattern detection circuit for detecting a most distinctive pattern portion from the object pattern memory (6) being the subpattem of the object pattern that has a minimum similarity to all other subpattems and for storing the detected pattern portion into the master pattern memory (7), wherein said distinctive pattern detection circuit comprises : an extraction circuit (81) for extracting a sequence of pattern signals of the master pattern size from the object pattern memory (6), which includes the master pattern image, a pattern matching control circuit (82) for driving the pattern matching circuit (9) for calculating the pattern matching degree between each extracted pattern signal and all the other pattern signals in the object pattern memory (6), a similar pattern detection circuit (83) for detecting for each extracted pattern a pattern of maximum similarity and its associated degree of similarity, a master pattern determination circuit for determining that one of said patterns of maximum similarity which has a minimum degree of similarity and for selecting the associated extracted pattern as a master pattern, a second order differential means (86) for differentiating to a second order the waveform of the pattern matching degree which is calculated by the scanning position and the pattern matching degree corresponding thereto, said waveform relating to the shifting of one extracted pattern along the x or y coordinate, the other, y or x, coordinate being held constant, and to the resulting degree of similarity at each position, and a peak interval decision means (87) for measuring the peak interval length (ℓa) of the second order differential waveform, for comparing the peak interval length with a predetermined value, and for using the result of the comparison as a criterion for the final selection of the master pattern. An apparatus as set forth in claim 3, wherein said master pattern determination circuit comprises a circuit for sequentially changing the size of the extracted patterns (84) and for calculating the pattern matching degree for the extracted patterns having different pattern sizes (9).

Inventors: KOEZUKA TETSUO, NAKASHIMA MASATO, TSUKAHARA HIROYUKI, KOEZUKA, TETSUO, NAKASHIMA, MASATO, TSUKAHARA, HIROYUKI
Applicants: FUJITSU LTD, FUJITSU LIMITED
Application year: 1984
Main classification: G06K9
IPC codes: G06K9, G06T7