Method of matching patterns and apparatus therefor

Abstract: A method matching patterns includes the steps of optically scanning a master image (a) and a to-be-recognized image (d) and outputting master image data and to-be-recognized image data, extracting master outline data representing an outline (b) of the master image from the master image data, extracting to-be-recognized outline data representing an outline (e) of a to-be-recognized image from the to-be-recognized image data, performing an enlargement process for the to-be-recognized outline data to enlarge the to-be-recognized outline, thereby forming to-be-recognized outline data, and collating the master outline data with the to-be-recognized outline data, and if a portion of the master outline projects from the to-be-recognized outline, determining that the to-be-recognized image has a short-defect indicating an omission of the image.

Description: The present invention relates to a method and an apparatus for matching patterns, which are used for detecting a defect in a printed pattern or printed matter. A technique of checking the quality of a printed pattern or the like performed on a product by means of pattern matching is conventionally known, and this technique is performed as follows. First a product determined to be a good product by eye inspection or the ike is prepared, and a to-be-checked object such as a printed pattern formed on the product is imaged by a television camera. An image signal from the camera is signal-processed, and outline data of the to-be-checked object is extracted. Enlarged outline data obtained by performing an enlargement process for the outline in the vertical and horizontal directions is stored as master pattern data in a memory. A slight error based on variations in to-be-checked objects or conveyance precision of products can be allowed by this enlargement process. Thereafter, a to-be-checked object of a to-be-checked product is imaged by the television camera. Outline data is extracted from an image signal corresponding to the to-be-checked object by an outline extraction circuit and compared with the master pattern data stored in the memory, thereby performing pattern matching. By such a conventional method of matching patterns, information for determining the quality of a to-be-checked object such as a printed pattern is obtained. Defects encountered in a printed pattern are roughly classified into a short-defect and a splashing defect. In the short-defect, a portion of a printed pattern is omitted or becomes faint. In the splashing defect, splashed ink, dirt, or foreign matters are adhered on a portion other than a predetermined printed portion. The above conventional technique is suitably used in detection of splashing defect information. Since, however, this conventional technique is based on the master pattern obtained by performing an enlargement process for the outline and an omitted portion of a printed pattern may be included in the master pattern, the technique is unsuitbale to recognize short-defect information. It is an object of the present invention to provide a method of matching patterns, which allows recognition of both a short-defect and a splashing defect. According to the method of matching patterns of the present invention, a first pattern matching process and a second pattern matching process are performed, the first pattern matching process including a step of fetching master pattern data corresponding to a master pattern having an outline into outline extracting means, to extract master pattern outline data corresponding to the outline of the master pattern from the master patter data, a step of storing the master pattern outline data obtained by the extraction into first memory means, a step of extracting to-be-recognized pattern outline data corresponding to an outline of a to-be-recognized printed pattern from to-be-recognized printed pattern data corresponding thereto by said outline extracting means, a step of subjecting the extracted to-be-recognized pattern outline data to a pattern enlargement process to form enlarged to-be-recognized outline data corresponding to an enlarged to-be-recognized pattern, and a step of collating the enlarged to-be-recognized outline data with the master pattern outline data; and the second pattern matching process including a step of subjecting the master pattern outline data to the pattern enlargement process to form an enlarged master pattern outline data, a step of storing the enlarged master pattern outline data into second memory means, a step of extracting the to-be-recognized outline data by said outline extracting means and collating the to-be-recognized outline data with the enlarged master pattern outline data. An apparatus of matching patterns according to the present invention comprises outline extracting means for independently fetching master pattern data and to-be-recognized pattern data corresponding respectively to a master pattern and a to-be-recognized pattern and extracting master pattern outline data and to-be-recognized pattern outline data corresponding to outlines of the master and to-be-recognized patterns, respectively, from master pattern data and to-be-recognized pattern data; first and second pattern enlargement processing means, connected to said outline extracting means, for subjecting the extracted master and to-be-recognized pattern outline data to an enlargement process to form enlarged master and to-be-recognized pattern outline data; first memory means, connected to said outline extracting means, for storing the master pattern outline data; first pattern matching means, connected to output terminals of said first memory means and said first pattern enlargement processing means, for collating the master pattern outline data with the enlarged to-be-recognized pattern outline data; second memory means, connected to the output terminal of said second pattern enlargement processing means, for storing the enlarged master pattern outline data; and second pattern matching means, connected to output terminals of said second memory means and said outline extracting means, for collating the enlarged master pattern outline data with the to-be-recognized pattern outline data obtained by said outline extracting means. In the present invention, master outline data serving as a comparison reference is outline data extracted from prepared master image data, and this master outline data is stored in the memory without being enlargement-processed. Subsequently, to-be-recognized pattern data to be compared with the master outline data is formed by performing an enlargement process for outline data of a to-be-recognized object. The two pattern data are collated with each other, and a portion of the master outline projecting from the to-be-recognized pattern in this collation is recognized as short-defect information. In the present invention, when pattern matching is executed, splashing defect information is recognized in addition to recognition of short-defect information. In the recognition of splashing defect information, master enlarged pattern data formed by performing an enlargement process for the master outline data extacted from the master image data and stored in the memory is collated with outline (to-be-recognized pattern) data of the to-be-recognized object. In this collation, a portion of the to-be-recognized pattern projecting from the master enlarged pattern is recognized as splashing defect information. In the present invention, after the outline extraction circuit extracts the outline data of the prepared master image, the pattern enlargement circuit pattern-enlarges the outline data to form enlarged master pattern data. This enlarged pattern data is stored in the second memory. Since the outline data of the master image is supplied to the first memory without being enlargement-processed parallel to the storage of the pattern data, the first memory stores the outline data of the master image as master outline data. After this storage, the outline extraction circuit extracts outline data of an image of a to-be-recognized object. This outline data is supplied to the second pattern matching circuit without being enlarged by the pattern enlargement circuit. This matching circuit collates the to-be-recognized outline data with the enlarged master pattern data read out from the second memory, thereby recognizing the presence/absence of splashing defect information. Since the outline data of the image of the to-be-recognized object is enlargement-processed by the pattern enlargement circuit and supplied to the first pattern matching circuit parallel to the collation, this matching circuit collates the to-be-recognized outline data with the outline data of the master image read out from the first memory, thereby recognizing the presence/absence of short-defect information. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram showing an apparatus for carrying out a method of matching patterns according to an embodiment of the present invention; Fig. 2 is a block diagram showing a relationship between an arrangement of a short-defect recognizing unit for recognizing short-defect information and various types of patterns; Fig. 3 is a block diagram showing a relationship between an arrangement of a splashing defect recognizing unit for recognizing splashing defect information and various types of patterns; and Fig. 4 is a block diagram of a pattern matching apparatus according to another embodiment of the present invention. Referring to Fig. 1, a conveyor 1 for a to-be-recognized object conveys a to-be-recognized object 2 having a printed pattern formed by, e.g., screen process printing on its surface in a direction indicated by an arrow. A television camera 3 is arranged to oppose a portion of the conveyor 1, and a field of view of the camera 3 is illuminated by a lighting device 4 as needed. An electronic camera incorporating a linear array image sensor is used as the camera 3 and scans the printed pattern on the object 2 along a direction perpendicular to a conveyance direction of the conveyor 1. Picture (image) information output from the camera 3 is processed by a defect detecting device 5 shown in Fig. 1, and the quality of the printed pattern on the object 2 is checked accordingly. The defect detecting device 5 comprises an AGC circuit 6, an outline extraction circuit 7, a short-defect recognizing unit 8, a short-defect determining circuit 9, a splashing defect recognizing unit 10, a splashing defect determining circuit 11, and a control circuit 12. The AGC circuit 6 is connected to the output terminal of the television camera 3 and used to maintain a transmission output constant with respect to a gain variation in the entire defect detecting device 5. The outline extraction circuit 7 is connected to the output terminal of the AGC circuit 6. The outline extraction circuit 7 constituted by a differentiation circuit fetches all of signals output from the camera 3 and emphasizes changes in signals, thereby extracting outline data of the image. As shown in Figs. 1 and 2, the short-defect recognizing unit 8 is constituted by a first pattern enlargement circuit 15, a first master pattern memory 16, and a first pattern matching circuit 17. The first pattern enlargement circuit 15 is connected to the output terminal of the outline extraction circuit 7. The pattern enlargement circuit 15 performs an enlargement process for data concerning an outline of an image in the vertical and horizontal directions in order to allow an error based on a variation in printed pattern of the to-be-recognized object 2 and precision of the conveyor 1, and its enlargement size can allow a slight error based on an initial variation or conveyance precision of products. This enlargement size is designated upon initialization. The pattern enlargement circuit 15 performs an enlargement process of the outline pattern to form a to-be-recognized pattern. Note that the outline extraction circuit, the pattern enlargement circuit, and the like are described in US-A-4,975,971. The first master pattern memory 16 is connected to the output terminal of the outline extraction circuit 7 and can be subjected to both write and read operations. The pattern memory 16 stores master outline data extracted by the outline extraction circuit 7 from a product determined as a good product by eye inspection or another suitable inspection. White to-be-recognized objects 2 of the same type are inspected, the memory 16 does not change but keeps the stored outline data. The first pattern matching circuit 17 is connected to the output terminals of the first pattern enlargement circuit 15 and the first master pattern memory 16. The matching circuit 17 collates the master outline data read out from the first master pattern memory 16 with the to-be-recognized pattern data obtained by the first pattern enlargement circuit 15 and checks whether the two patterns coincide with each other. The short-defect determining circuit 9 is connected to the output terminal of the first pattern matching circuit 17. The short-defect determining circuit 9 checks whether the size of defect information recognized by the short-defect recognizing unit 8 indicates a defect. Note that the size of a defect is set in the determining circuit 9 upon initialization. As shown in Figs. 1 and 3, the splashing defect recognizing unit 10 is constituted by a second pattern enlargement circuit 21, a second master pattern memory 22, and a second pattern matching circuit 23. The second pattern enlargement circuit 21 is connected to the output terminal of the outline extraction circuit 7. The second pattern enlargement circuit 21 has the same arrangement as that of the first pattern enlargement circuit 15 and performs an enlargement process for outline data to enlarge an outline, thereby forming enlarged master pattern data. The second master pattern memory 22 is connected to the output terminal of the second pattern enlargement circuit 21. This memory 22 can also be subjected to both write and read operations. The memory 22 stores enlarged master pattern data extracted from a product determined as a good product by eye inspection or another suitable inspection and processed by the circuit 21. While to-be-recognized objects 2 of the same type are inspected, the enlarged master pattern data stored in the memory 16 is kept unchanged. The second pattern matching circuit 23 is connected to the output terminals of the outline extraction circuit 7 and the second master pattern memory 22. The matching circuit 23 collates the enlarged master pattern data read out from the second master pattern memory 22 with the outline data of the to-be-recognized object 2 obtained by the outline extraction circuit 7 and checks whether the two pattern data coincide with each other. The splashing defect determining circuit 11 is connected to the output terminal of the second pattern matching circuit 23. The second pattern matching circuit 23 checks whether the size of defect information recognized by the splashing defect recognizing unit 10 indicates a defect. Note that the size of a defect is set in the determining circuit 11 upon initialization. The control circuit 12 controls operations of the entire apparatus, i.e., the AGC circuit 6, the outline extraction circuit 7, the short-defect recognizing unit 8, the short-defect determining circuit 9, the splashing defect recognizing unit 10, and the splashing defect determining circuit 11. An operation of detecting a defect by using the apparatus having the above arrangement will be described below. After a necessary initialization operation e.g. setting of the defect size and so on is performed, a printed pattern of a product determined as a good product by eye inspection or another suitable inspection is imaged by the television camera 3, and outline data is extracted from image data of the good product (master) by the outline extraction circuit 7. The extracted outline data is stored in the short-defect recognizing unit 8 and the splashing defect recognizing unit 10, as shown in Figs. 2 and 3. More specifically, in the short-defect recognizing unit 8, master image data output from the outline extraction circuit 7 and indicated by reference symbol a in Fig. 2, e.g., outline (b) data of a character A is stored as master outline data in the first master pattern memory 16. In the splashing defect recognizing unit 10, the outline (b) data of the master image A output from the outline extraction circuit 7 and indicated by a in Fig. 3 is enlargement-processed by the second pattern enlargement circuit 21, and enlarged master pattern (c) data obtained by this enlargement process is stored in the second master pattern memory 22. After pattern setting according to the master image is performed, to-be-recognized objects 2 are sequentially conveyed to the field of view of the television camera 3 by the conveyor 1 and imaged. When defect image (d) data output from the camera 3 is input to the outline extraction circuit 7 via the AGC circuit 6, outline (e) data is extracted from the image (d) data by the outline extraction circuit 7 and supplied to the short-defect recognizing unit 8 and the splashing defect recognizing unit 10. In the short-defect recognizing unit 8, therefore, the outline (e) data according to the to-be-recognized object 2 output from the outline extraction circuit 7 as shown in Fig. 2 is enlargement-processed by the first pattern enlargement circuit 15. To-be-recognized pattern (f) data obtained by the enlargement process is supplied to the first pattern matching circuit 17. The to-be-recognized pattern (f) data is input to the circuit 17 in synchronism with a read operation of the master outline (b) data corresponding to the master image A from the first master pattern memory 16 to the first pattern matching circuit 17, and the two patterns are collated with each other. As a result, if the image d has a short-defect X (this defect X is larger than an enlargement size set in the enlargement circuit 15) as shown in Fig. 2, a portion of the outline b corresponding to the master image projects from the enlarged to-be-recognized pattern f . The first pattern matching circuit 17 recognizes this projecting portion as short-defect information. This defect information is supplied to the short-defect determining circuit 9, and the circuit 9 checks whether the defect information is a true defect. This determination is performed on the basis of whether the input defect information has a size larger than a predetermined size. The outline (e) data of the image (d) corresponding to the to-be-recognized object 2 supplied to the splashing defect recognizing unit 10 is directly supplied to the second pattern matching circuit 23 without being enlargement-processed. Outline (e') data corresponding to the object 2 is input to the circuit 23 in synchronism with a read operation of the enlarged master pattern (c) data corresponding to the master image A from the second master pattern memory 22 to the second pattern matching circuit 23, and the two patterns are collated with each other. If the image d has a splashing defect Y as shown in Fig. 3, therefore, a portion of an outline e' corresponding to the to-be-recognized object 2 projects from the enlarged master pattern c . The second pattern matching circuit 23 recognizes this projecting portion as splashing defect information. This defect information is supplied to the splashing defect determining circuit 11, and the circuit 11 checks whether the defect information is a true defect. Similar to the determination of short-defect information, the determination of splashing defect information is performed on the basis of whether the input defect information has a size larger than a predetermined size. Although the pattern enlargement circuit is provided for each recognizing unit corresponding to the type of defect in the above embodiment, a single pattern enlargement circuit 15 may be commonly used for the two recognizing units 8 and 10 as shown in Fig. 4. According to this embodiment, a single pattern enlargement circuit 15 is connected to a selector switch 25. The contacts a and b of the selector switch 25 are connected to the first pattern matching circuit 17 of the short-defect recognizing unit 8 and the second master pattern memory 22 of the splashing defect recognizing unit 10, respectively. In this pattern matching apparatus, at first the selector switch 25 is switched to the contact b, and the outline (b) data of the master image is enlargement-processed by the pattern enlargement circuit 15. The enlarged master pattern (c) output from the pattern enlargement circuit 15 is stored in the second pattern memory 22 through the selector switch 25. The stored master pattern (c) data is used for collating with each of the to-be-recognized pattern (e') data sequentially input from the outline extraction circuit 7. After the enlarged master pattern (c) data is stored in the second master pattern memory 22, the selector switch 25 is switched to the contact a. Then, the pattern enlargement circuit 15 enlargement-processes the to-be-recognized pattern (e) data sequentially input from the outline extraction circuit 7. The enlarged to-be-recognized pattern (f) data is input to the first pattern matching circuit 17 through the switch 25 and collated with the first master pattern (b) data stored in the first pattern memory 16. According to the embodiment of Fig. 4, the single pattern enlargement circuit 15 enlargement-processes at once the master outline (b) data for storing in the second master pattern memory 22, and then is used for enlargement-processing the outline (e) data of the to-be-recognized image data sequentially produced from the outline extraction circuit 7. According to the pattern matching method of the present invention described above, an outline pattern extracted from a prepared master image is stored as a master outline, and this master outline is collated with a to-be-recognized pattern formed by performing an enlargement process for an outline pattern obtained for a to-be-recognized object. In this collation, since a portion of the master outline projecting from the to-be-recognized pattern is recognized as defect information, a short-defect can be recognized. An outline extracted from a prepared master image is stored as a master outline and collated with a to-be-recognized pattern formed by enlarging the outline of a to-be-recognized object, and a portion of the master outline projecting from the to-be-recognized pattern is recognized as defect information in this collation. In addition, parallel to this process, an enlarged master pattern formed by enlarging the outline extracted from the master image is stored, and the outline of the to-be-recognized object is directly collated with the stored enlarged master pattern. In this collation, a portion of the to-be-recognized pattern projecting from the enlarged master pattern can be recognized as defect information. Therefore, both the short-defect and splashing defect information can be recognized parallel to each other. Since the pattern matching apparatus the present invention comprises the outline extraction circuit, the pattern enlargement circuit, the first and second memories, and the first and second pattern matching circuits, it is capable of recognizing both of short-defect and splashing defect information parallel to each other.

Claims: A method of matching patterns, which is used for detecting a defect in a printed pattern on printed matter, characterized by comprising: a first pattern matching process including a step of fetching master pattern data corresponding to a master pattern (a) having an outline into outline extracting means (7), to extract master pattern outline data (b) corresponding to the outline of the master pattern (a) from the master patter data, a step of storing the master pattern outline data (b) obtained by the extraction into first memory means (16), a step of extracting to-be-recognized pattern outline data (e) corresponding to an outline of a to-be-recognized printed pattern (d) from to-be-recognized printed pattern data corresponding thereto by said outline extracting means (7), a step of subjecting the extracted to-be-recognized pattern outline data (e) to a pattern enlargement process to form enlarged to-be-recognized outline data (f) corresponding to an enlarged to-be-recognized pattern, and a step of collating the enlarged to-be-recognized outline data (f) with the master pattern outline data (b); and a second pattern matching process including a step of subjecting the master pattern outline data (b) to the pattern enlargement process to form an enlarged master pattern outline data (c), a step of storing the enlarged master pattern outline data (c) into second memory means (22), a step of extracting the to-be-recognized outline data (e') by said outline extracting means (7) arid collating the to-be-recognized outline data (e') with the enlarged master pattern outline data (c). A method of matching patterns according to claim 1, characterized in that said first and second pattern matching processes are performed parallel to each other. A method of matching patterns according to claims 1 or 2 characterized in that said collating steps include steps of checking whether defect information is true defect information. A method of matching patterns according to one of the claims 1 to 3, characterized in that said collating steps comprise a step of fetching the master pattern outline data (b) and the enlarged to-be-recognized outline data (f) in synchronism with each other and comparing the two data, and a step of fetching the enlarged master pattern outline data (c) and the to-be-recognized outline data (e') in synchronism with each other and comparing the two data. A method of matching patterns according to one of the claims 1 to 4, characterized by further comprising a step of optically scanning the master pattern (a) and the to-be-recognized printed pattern (d) and outputting master pattern data and to-be-recognized printed pattern data. An apparatus for matching patterns, which is used for detecting a defect in a printed pattern on printed matter, characterized by comprising: outline extracting means (7) for independently fetching master pattern data and to-be-recognized pattern data corresponding respectively to a master pattern and a to-be-recognized pattern and extracting master pattern outline data and to-be-recognized pattern outline data corresponding to outlines of the master and to-be-recognized patterns, respectively, from master pattern data and to-be-recognized pattern data; first and second pattern enlargement processing means (15, 21), connected to said outline extracting means (7), for subjecting the extracted master and to-be-recognized pattern outline data to an enlargement process to form enlarged master and to-be-recognized pattern outline data; first memory means (16), connected to said outline extracting means (7), for storing the master pattern outline data; first pattern matching means (17), connected to output terminals of said first memory means (16) and said first pattern enlargement processing means (15), for collating the master pattern outline data with the enlarged to-be-recognized pattern outline data; second memory means (22), connected to the output terminal of said second pattern enlargement processing means (21), for storing the enlarged master pattern outline data; and second pattern matching means (23), connected to output terminals of said second memory means (22) and said outline extracting means (7), for collating the enlarged master pattern outline data with the to-be-recognized pattern outline data obtained by said outline extracting means (7). An apparatus according to claim 6, characterized by further comprising image determining means including determining circuits (9, 11) for checking whether defect information is true defect information. An apparatus according to claim 6 or 7, characterized in that first and second pattern matching means (17, 23) comprise a circuit for fetching the master pattern outline data and the enlarged to-be-recognized pattern outline data in synchronism with each other and comparing the two data, and a circuit for fetching the enlarged master pattern outline data and to-be-recognized outline data and comparing the two data. An apparatus according to one of the claims 6 to 8, characterized by further comprising an image data output means which comprises an image sensor means for optically scanning a plurality of printed materials each having a predetermined printed pattern corresponding to the to-be-recognized printed pattern. An apparatus according to one of the claims 6 to 9, characterized in that said first pattern matching means (17) outputs first defect information indicating that the to-be-recognized printed pattern contains a short-defect indicating an omission of a part of the to-be-recognized printed pattern when the outline of the master printed pattern mismatches with the outline of the enlarged to-be-recognized printed pattern, and second pattern matching means (23) outputs second defect information indicating that the to-be-recognized printed pattern contains a splashing defect indicating an inclusion of a printed pattern regardless of the master printed pattern when the outline of the enlarged master printed pattern mismatches with the outline of the to-be-recognized printed pattern.

Inventors: NISHIO MASAMI, NISHIO, MASAMI
Applicants: FUTEC INC, FUTEC INCORPORATED
Application year: 1991
Main classification: G06T7
IPC codes: G06K9, G06T7