Marker identification method and device, electronic equipment and laser processing equipment

By obtaining the target color part area difference value of the printed circuit board, the problems of low recognition accuracy and high cost of deep learning algorithms are solved, and efficient and low-cost marker recognition is achieved.

CN120279235APending Publication Date: 2025-07-08HANS CNC SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311869604.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2025-07-08

Smart Images

  • Figure CN120279235A_ABST
    Figure CN120279235A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a marker identification method and device and electronic equipment, and relates to the technical field of data storage. The marker identification method comprises the following steps: acquiring an image of a to-be-identified object; determining the area of a first part of the image of the to-be-identified object, wherein the first part is a part of a target color in the image of the to-be-identified object; acquiring the area of the first part of the preset template image; the preset template image is an image of a preset template object, and the preset template object is a preset object which is the same as the to-be-identified object and does not have a marker; the marker is used for marking an abnormal object; and according to the area of the first part of the image of the to-be-identified object and the area of the first part of the preset template image, determining whether the to-be-identified object has a marker. The problems of low identification precision and high cost of a deep learning algorithm based on contour feature identification markers in related technologies are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and particularly to a marker recognition method, device, electronic device and laser processing device. Background Art

[0002] At present, machines need to identify defective products containing markers. For example, in the production and processing of printed circuit boards (PCBs), a certain number of defective products (i.e., scrapped boards) will be generated during the production process. At present, although the printed circuit boards are delivered as small boards, for the convenience of production and processing, a large board working piece is often manufactured first in the process, and then the large board working piece is cut into small boards after the manufacturing process is completed. There are often defects in individual small board areas on the large board working piece. Therefore, it is necessary to manually mark the defective products on the large board, and then the machine destroys the defective products containing markers, and then cuts out the small boards that have not been destroyed from the large board working piece. In this way, the machine needs to identify the markers on the printed circuit board.

[0003] In the related art, a deep learning algorithm is set inside the machine. The deep learning algorithm gives a conclusion on whether there is a marker on the object to be recognized based on the contour features of each area on the problem to be recognized. However, this method has high requirements for the recognition accuracy of the deep learning algorithm. Long-term training of the deep learning algorithm increases the production cost and reduces the production efficiency, and this method takes a long time to recognize the marker and has low recognition accuracy. Summary of the Invention

[0004] In view of this, the present application provides a marker recognition method, its device and electronic device to solve the problems of low recognition accuracy and high cost in the related art that the deep learning algorithm recognizes markers based on contour features.

[0005] In a first aspect, an embodiment of the present application provides a marker recognition method, including the following steps:

[0006] Obtain an image of an object to be recognized;

[0007] Determine the area of a first part of the image of the object to be recognized, where the first part is the part of the image of the object to be recognized with a target color;

[0008] Obtain the area of a first part of a preset template image; the preset template image is an image of a preset template object, and the preset template object is an object that is preset to be the same as the object to be recognized and has no markers; the marker is used to mark an object with an abnormality;

[0009] Determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

[0010] In a possible implementation, the object to be recognized is a printed circuit board, the marker is ink, and the target color is the color of the metal or the substrate in the printed circuit board.

[0011] In a possible implementation, determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes: if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than a preset threshold, it is determined that there is a marker on the object to be recognized.

[0012] In a possible implementation, determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes:

[0013] If the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is not greater than a preset threshold, it is determined that there is no marker on the object to be recognized.

[0014] In a possible implementation, the image of the object to be recognized and the preset template image are both images after binarization processing; the first part is the black area or the white area of the image after binarization processing.

[0015] In a possible implementation, when the image of the object to be recognized and the preset template image both include at least two first parts, determining the area of the first part of the image of the object to be recognized includes:

[0016] Determining the area of each first part of the image of the object to be recognized respectively;

[0017] Obtaining the area of the first part of the preset template image includes:

[0018] Obtaining the area of each first part of the preset template image respectively;

[0019] If the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than a preset threshold, determining that there is a marker on the object to be recognized includes:

[0020] If there is a difference value between the area of at least one first part of the image of the object to be recognized and the area of the corresponding first part of the preset template image that is greater than a preset threshold, it is determined that there is a marker on the object to be recognized.

[0021] In a possible implementation, when the image of the object to be recognized and the preset template image both include at least two first parts, determining the area of the first part of the image of the object to be recognized includes:

[0022] Determine the area of each first part of the image of the object to be recognized respectively;

[0023] Obtaining the area of the first part of the preset template image includes:

[0024] Obtain the area of each first part of the preset template image respectively;

[0025] If the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold, determining that there is a marker on the object to be recognized includes: If there is a difference value between the sum of the areas of the first parts of the image of the object to be recognized and the sum of the areas of the first parts of the preset template image that is greater than the preset threshold, determine that there is a marker on the object to be recognized.

[0026] In a possible implementation manner, before determining the area of the first part in the image of the object to be recognized, it further includes:

[0027] Determine the part of the target color of the preset template image;

[0028] Take the part of the target color of the preset template image as the first part of the preset template image.

[0029] In a possible implementation manner, taking the part of the target color of the preset template image as the first part of the preset template image includes:

[0030] If the preset template image includes at least two parts of the target color, take at least two parts of the target color as at least two first parts of the preset template image.

[0031] In a possible implementation manner, the method further includes:

[0032] Obtain the positions of the centers of at least two first parts of the preset template image.

[0033] In a possible implementation manner, when both the image of the object to be recognized and the preset template image include at least two first parts, determining the area of the first part of the image of the object to be recognized includes:

[0034] Determine the position of the corresponding first part in the image of the object to be recognized according to the positions of the centers of at least two first parts of the preset template image;

[0035] Determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized.

[0036] In a possible implementation manner, the first part includes a first sub - part and a second sub - part, and the first sub - part at least partially encloses the second sub - part;

[0037] Determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized includes:

[0038] Weight values are respectively set for the first sub - part and the second sub - part, where the weight value of the first sub - part is less than the weight value of the second sub - part;

[0039] Determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized according to the weight value of the first sub - part and the weight value of the second sub - part.

[0040] In a second aspect, an embodiment of the present application provides a marker recognition device, including:

[0041] A first acquisition unit, configured to acquire an image of an object to be recognized;

[0042] A first processing unit, configured to determine the area of the first part of the image of the object to be recognized, where the first part is the part of the target color in the image of the object to be recognized;

[0043] A second acquisition unit, configured to acquire the area of the first part of a preset template image; the preset template image is an image of a preset template object, and the preset template object is an object that is preset to be the same as the object to be recognized and has no markers; the marker is used to mark an object with an abnormality;

[0044] A second processing unit, configured to determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

[0045] In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the electronic device is triggered to execute the method provided in the first aspect of the embodiments of the present application.

[0046] In a fourth aspect, an embodiment of the present application provides a laser processing device, which includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the laser processing device is triggered to execute the method provided in the first aspect of the embodiments of the present application.

[0047] In a fifth aspect, an embodiment of the present application provides a computer - readable storage medium, which includes a stored program. When the program runs, it controls the device where the computer - readable storage medium is located to execute the method provided in the first aspect of the embodiments of the present application.

[0048] By adopting the solution provided in the embodiment of the present application, if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold, it can be determined that there is a marker on the object to be recognized. In this way, only by determining the area of the first part of the object to be recognized according to the target color can the marker be recognized, which requires less machine algorithm, lower cost, and higher marker recognition accuracy. Description of the Drawings

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0050] Figure 1 It is a flowchart of a marker recognition method provided by an embodiment of the present application;

[0051] Figure 2 It is a flowchart of determining the first part of the preset template image provided by an embodiment of the present application;

[0052] Figure 3 It is a flowchart of determining the area of the first part of the image of the object to be recognized provided by an embodiment of the present application;

[0053] Figure 4 It is a schematic diagram of a marker recognition device provided by an embodiment of the present application;

[0054] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Detailed Embodiments

[0055] In order to better understand the technical solutions of the present application, the embodiments of the present application will be described in detail below with reference to the drawings.

[0056] It should be clear that the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0057] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the" and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0058] It should be understood that the term "and / or" used herein is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, both A and B exist simultaneously, and B exists alone. In addition, the character " / " in this text generally represents an "or" relationship between the associated objects before and after.

[0059] Before specifically introducing the embodiments of the present application, first, the terms applied or possibly applied in the embodiments of the present application are explained.

[0060] In the related art, it is necessary for a machine to identify markers on defective products. The general method is to set a deep learning algorithm inside the machine. The deep learning algorithm gives a conclusion on whether there is a marker on the object to be identified based on the contour features of each area on the object to be identified. However, this method has high requirements for the recognition accuracy of the deep learning algorithm. Long-term training of the deep learning algorithm increases the production cost and reduces the production efficiency. Moreover, this method takes a long time to identify markers and has low recognition accuracy.

[0061] In view of the above problems, the embodiments of the present application provide a marker recognition method, its device, and an electronic device, which are beneficial to solving the problems of low recognition accuracy and high cost in the related art where the deep learning algorithm recognizes markers based on contour features. The following is a detailed description.

[0062] See Figure 1 , which is a flowchart of a marker recognition method provided by the embodiments of the present application. As Figure 1 shown, it includes the following steps:

[0063] Step S101: Obtain an image of the object to be identified.

[0064] It should be noted that the image of the object to be identified at least includes the image of the part of the object to be identified that may mark ink information. For example, when the object to be identified is a printed circuit board, the image of the object to be identified includes the image of the metal side of the printed circuit board.

[0065] In order to avoid giving a conclusion on whether there is a marker on the object to be identified based on the contour features on the object to be identified, in the embodiments of the present application, it is determined whether there is a marker on the object to be identified based on the area difference value between the area of the target color part on the image of the object to be identified and the area of the first part on the preset template image.

[0066] Therefore, it is necessary to obtain an image of the object to be identified.

[0067] Step S102: Determine the area of the first part of the image of the object to be identified. Among them, the first part is the part of the image of the object to be identified with the target color.

[0068] That is, since the image of the object to be recognized usually includes multiple different colors, to reduce the calculation amount, it is only necessary to determine the area of the first part of the object to be recognized. And since when there is a marker on the object to be recognized, the color of the first part of the object to be recognized itself is superimposed on the color of the marker, making the color of the first part including the marker different from the target color, when there is a marker on the image of the object to be recognized, the area of the first part of the image of the object to be recognized will change.

[0069] It should be noted that when the color area of the object to be recognized is large and the color distribution is relatively concentrated, the target color can be the color on the object to be recognized where markers are likely to be included. When the color area of the object to be recognized is small and the color distribution is relatively scattered, the target color can be any color on the object to be recognized. For example, when the object to be recognized is a printed circuit board, since the color area on the printed circuit board is small and scattered, the marker may be in any area, so any color on the printed circuit board can be used as the target color.

[0070] As a possible implementation, the object to be recognized is a printed circuit board, the marker is ink, and the target color is the color of the metal or the substrate in the printed circuit board.

[0071] That is, when the object to be recognized is a printed circuit board, for the convenience of marking on the printed circuit board, the most common marker is ink. To facilitate subsequent determination of the area of the first part of the image of the object to be recognized, the color of the part with the widest distribution or the largest area in the printed circuit board is used as the target color. In the printed circuit board, the part with the widest distribution and the largest area is the metal or the substrate in the printed circuit board, so the target color is set as the color of the metal or the substrate in the printed circuit board.

[0072] In some embodiments, the target color and other colors can be distinguished based on one or more of multiple modes such as RGB mode, CMYK mode, HSB mode, Lab color mode, bitmap mode, grayscale mode, indexed color mode, duotone mode, multichannel mode, etc., which are not limited here.

[0073] As a possible implementation, before step S102, that is, before determining the area of the first part in the image of the object to be recognized, as Figure 2 shown, the method further includes:

[0074] Step S121: Determine the part of the target color of the preset template image;

[0075] Step S122: Use the part of the target color of the preset template image as the first part of the preset template image.

[0076] In an embodiment of the present application, based on the area difference value between the area of the target color part on the image of the object to be recognized and the area of the first part on the preset template image, it is determined whether there is a marker on the object to be recognized. Therefore, it is necessary to set the part of the target color on the preset template image.

[0077] As a possible implementation, taking the part of the target color of the preset template image as the first part of the preset template image includes:

[0078] If the preset template image includes at least two parts of the target color, then the at least two parts of the target color are used as at least two first parts of the preset template image.

[0079] That is, when the color distribution of the object to be recognized is relatively scattered, there may be at least two non-touching parts of the target color on the object to be recognized. For example, when the object to be recognized is a printed circuit board and the target color is the metallic color on the printed circuit board, then the printed circuit board includes multiple first parts.

[0080] Step S103: Obtain the area of the first part of the preset template image.

[0081] Among them, the preset template image is an image of a preset template object, and the preset template object is a preset object that is the same as the object to be recognized and has no marker; the marker is used to mark the object with an abnormality.

[0082] In some embodiments, an object without abnormality can be selected from the objects to be recognized in the same batch as the preset template object. For example, when the object to be recognized is a printed circuit board, a good small board is selected from the large board working pieces as the preset template object.

[0083] As a possible implementation, the image of the object to be recognized and the preset template image are both images after binarization processing; the first part is the black area or the white area of the image after binarization processing.

[0084] In an embodiment of the present application, when determining whether there is a marker on the object to be recognized, it is obtained by comparing the area difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image with a preset threshold value. However, since there may be too many colors on the image of the object to be recognized and the preset template image, and due to reasons such as light and shadow changes, many colors are difficult to recognize, and thus it is difficult to calculate the area of the first part on the image of the object to be recognized and the preset template image. For this reason, in the embodiments of the present application, the image of the object to be recognized and the preset template image are subjected to binarization processing. The image after binarization processing only has a black area and a white area, which is convenient for the machine to recognize colors and calculate areas, and avoids the area calculation error caused by the subtle deviation between the color of the image of the object to be recognized and the target color due to reasons such as light and shadow.

[0085] In some embodiments, the area of the first part of the object to be recognized and the area of the first part of the preset template image can be determined based on the number of target color pixel points.

[0086] As a possible implementation, when the image of the object to be recognized and the preset template image both include at least two first parts, determining the area of the first part of the image of the object to be recognized includes: determining the area of each first part of the image of the object to be recognized respectively. Correspondingly, obtaining the area of the first part of the preset template image includes: obtaining the area of each first part of the preset template image respectively.

[0087] In the embodiments of the present application, when the image of the object to be recognized and the preset template image both include at least two first parts, it is necessary to determine the area of each first part respectively, so as to subsequently correspond the first part of the image of the object to be recognized with the first part of the preset template image one by one, and calculate the difference degree value between each group of the first part of the image of the object to be recognized and the first part of the preset template image.

[0088] Step S104: Determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

[0089] To determine whether there is a marker on the object to be recognized, in the embodiments of the present application, it can be determined according to the difference degree value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image. It can be understood that when there is no marker on the object to be recognized, the colors of each part on the object to be recognized correspond to those of each part on the preset template image. Therefore, the area of the first part of the image of the object to be recognized corresponds to the area of the first part of the preset template image, and the difference between the two should not exceed the preset threshold. If it exceeds the preset threshold, it means there is a marker on the object to be recognized.

[0090] As a possible implementation, determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes: if the difference degree value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold, it is determined that there is a marker on the object to be recognized.

[0091] That is, when the difference value of the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold, it indicates that the difference in the area of the target color part of the image of the object to be recognized and the area of the target color part without the marker is greater than the preset threshold. Therefore, it can be determined that there is a marker on the object to be recognized. In some embodiments, the difference value includes one or more of a ratio, a difference, and an absolute value of a difference.

[0092] It should be noted that when the difference value is a difference, the preset threshold is usually not 0; when the difference value is a ratio, the preset threshold is usually not 1. That is, due to factors such as light and shadow and manufacturing errors of the object to be recognized, when the object to be recognized does not include a marker, there is usually a slight difference between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

[0093] As a possible implementation, determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes: if the difference value of the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is not greater than the preset threshold, it is determined that there is no marker on the object to be recognized.

[0094] That is, when the difference value of the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is not greater than the preset threshold, it indicates that the difference in the area of the target color part of the image of the object to be recognized and the area of the target color part without the marker is not greater than the preset threshold. Therefore, it can be determined that there is no marker on the object to be recognized.

[0095] As mentioned above, when both the image of the object to be recognized and the preset template image include at least two first parts, the area of each first part of the image of the object to be recognized can be determined respectively, and the area of each first part of the preset template image can be obtained correspondingly. Then, correspondingly, when determining whether there is a marker on the object to be recognized according to the difference value of the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image, it is also necessary to judge for the case where both the image of the object to be recognized and the preset template image include at least two first parts. The following explains this situation.

[0096] As a possible implementation, if the difference value of the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold, determining that there is a marker on the object to be recognized includes:

[0097] If there is a difference value greater than the preset threshold between the area of at least one first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image, it is determined that there is a marker on the object to be recognized.

[0098] That is, the difference value between the area of each first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image is compared with a preset threshold value to determine whether there is a marker on the object to be recognized. In this way, small markers can be avoided from being missed. That is, when the area of the marker on the object to be recognized is small, the marker cannot cover the area of all the first parts. Therefore, the difference value between the area of the first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image is calculated one by one and compared with the preset threshold value one by one, which can ensure that the marker can be recognized even if it only exists on a small part of the first parts of the image of the object to be recognized.

[0099] In some embodiments, the method further includes: setting an order for each first part in the image of the object to be recognized; sequentially comparing the difference value between the area of the first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image with the preset threshold value according to the order of the first parts in the image of the object to be recognized. For each first part in the image of the object to be recognized, if the difference value between the area of the first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image is greater than the preset threshold value, it is determined that there is a marker on the object to be recognized, and the comparison of the difference value between the area of the first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image with the preset threshold value is stopped. In this way, the recognition efficiency of the marker on the object to be recognized can be improved.

[0100] In some embodiments, setting an order for each first part in the image of the object to be recognized can be based on the probability of the position where the marker is likely to appear, that is, the first part at the position with a high probability of the marker appearance is in the front order, and the first part at the position with a low probability of the marker appearance is in the back order.

[0101] As a possible implementation manner, if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold value, determining that there is a marker on the object to be recognized includes:

[0102] If there is a difference value between the sum of the areas of the first parts of the image of the object to be recognized and the sum of the areas of the first parts of the preset template image that is greater than the preset threshold value, it is determined that there is a marker on the object to be recognized.

[0103] That is, compare the difference value between the sum of the areas of all the first parts in the image of the object to be recognized and the sum of the areas of all the first parts in the preset template image with a preset threshold value, so as to determine whether there is a marker on the object to be recognized. In this way, when the markers are relatively scattered on the first part of the image of the object to be recognized and the area distributed on each first part is small, the method of the embodiment of the present application can still recognize the markers on the object to be recognized. For example, when the object to be recognized is a printed circuit board and the first part of the printed circuit board is the metallic color part on the printed circuit board, since the metallic color on the printed circuit board is scattered, the marker may be located at the edges of multiple metallic color parts. At this time, compare the difference value between the sum of the areas of multiple metallic color parts on the printed circuit board and the sum of the areas of the metallic color parts in the preset template image with the preset threshold value, which can avoid the marker being ignored due to the too small area in the metallic color area and being close to the edge.

[0104] In some embodiments, the method further includes: if the difference value between the sum of the areas of the first parts in the image of the object to be recognized and the sum of the areas of the first parts in the preset template image is not greater than the preset threshold value, it is determined that there is no marker on the object to be recognized.

[0105] As described above, when both the image of the object to be recognized and the preset template image include at least two first parts, the difference threshold value between each first part in the image of the object to be recognized and the corresponding first part in the preset template image can be calculated respectively and compared with the preset threshold value. Then, the following will describe how to correspond each first part in the image of the object to be recognized with the first part on the preset template image.

[0106] As a possible implementation manner, the method further includes:

[0107] Obtain the positions of the center points of at least two first parts of the preset template image.

[0108] That is, when both the image of the object to be recognized and the preset template image include at least two first parts, in order to determine the correspondence between the first part of the image to be recognized and the first part on the preset template image, the correspondence between the two can be determined based on the target color parts corresponding to the positions of the center points of at least two first parts of the preset template image. Therefore, it is necessary to obtain the positions of the center points of at least two first parts of the preset template image.

[0109] In some embodiments, the positions of the center points of all the first parts of the preset template image can be obtained.

[0110] As a possible implementation manner, as Figure 3 shown, when both the image of the object to be recognized and the preset template image include at least two first parts, determining the area of the first part of the image of the object to be recognized includes:

[0111] Step S131: Determine the positions of the corresponding first parts in the image of the object to be recognized according to the positions of the center points of at least two first parts of the preset template image.

[0112] Step S132: Determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized.

[0113] That is, determine the positions of the corresponding first parts in the image of the object to be recognized according to the positions of the center points of the first parts of the preset template image, so as to determine the correspondence between the first parts of the preset template image and the first parts in the image of the object to be recognized. Furthermore, the area of the target color part corresponding to the position of the first part in the image of the object to be recognized can be determined, so as to judge whether there is a marker on the object to be recognized according to the difference value between the area of the target color part corresponding to the position of the first part in the image of the object to be recognized and the area of the first part of the preset template image.

[0114] In some embodiments, it further includes establishing an image coordinate system according to the preset template image, obtaining the positions of the center points of at least two first parts of the preset template image in the image coordinate system, and determining the positions of the corresponding first parts in the image of the object to be recognized in the image coordinate system according to the positions of the center points of at least two first parts of the preset template image.

[0115] In the embodiments of the present application, there may be errors in the machine's processing of the first part and other parts on the image of the object to be recognized or the preset template image. Especially when the images of the object to be recognized and the preset template image are both binary-processed images, the machine may binary-process the parts adjacent to the first part and having a different color from the first part as the first part. Therefore, in order to improve the recognition accuracy of the marker, in the embodiments of the present application, a higher weight value is also set for the parts near the center point position of the first part, which will be described below.

[0116] As a possible implementation manner, the first part includes a first sub-part and a second sub-part, and the first sub-part at least partially surrounds the second sub-part;

[0117] Determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized includes:

[0118] Set weight values for the first sub-part and the second sub-part respectively, where the weight value of the first sub-part is less than the weight value of the second sub-part;

[0119] Determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized according to the weight value of the first sub-part and the weight value of the second sub-part.

[0120] In some embodiments, determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized according to the weight value of the first sub - part and the weight value of the second sub - part includes: multiplying the weight value of the first sub - part by the area of the first sub - part to obtain a first area, multiplying the weight value of the second sub - part by the area of the second sub - part to obtain a second area, and adding the first area and the second area to obtain the area of the target color part corresponding to the position of the first part in the image of the object to be recognized.

[0121] In some embodiments, the first sub - part may completely surround the second sub - part.

[0122] In some embodiments, in the first part, the points whose distance from the first part exceeds a preset distance threshold are the points of the second sub - part, and the points whose distance from the first part does not exceed the preset distance threshold are the points of the first sub - part.

[0123] See Figure 4 , a marker recognition device provided by an embodiment of the present application. As Figure 4 shown, the device includes:

[0124] A first acquisition unit 401, configured to acquire an image of an object to be recognized;

[0125] A first processing unit 402, configured to determine the area of the first part of the image of the object to be recognized, where the first part is the part of the target color in the image of the object to be recognized;

[0126] A second acquisition unit 403, configured to acquire the area of the first part of a preset template image; the preset template image is an image of a preset template object, and the preset template object is a pre - set object that is the same as the object to be recognized and has no marker; the marker is used to mark an object with an abnormality;

[0127] A second processing unit 404, configured to determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

[0128] As a possible implementation, the object to be recognized is a printed circuit board, the marker is ink, and the target color is the color of the metal in the printed circuit board or the color of the substrate.

[0129] As a possible implementation, the second processing unit 404 is further configured to determine that there is a marker on the object to be recognized if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than a preset threshold.

[0130] As a possible implementation, the second processing unit 404 is further configured to determine that there is no marker on the object to be recognized if the difference degree value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is less than a preset threshold.

[0131] As a possible implementation, when the image of the object to be recognized and the preset template image both include at least two first parts, the first processing unit 402 is specifically configured to respectively determine the area of each first part of the image of the object to be recognized; the second obtaining unit is specifically configured to respectively obtain the area of each first part of the preset template image; the second processing unit is specifically configured to determine that there is a marker on the object to be recognized if the difference degree value between the area of at least one first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image is greater than a preset threshold.

[0132] As a possible implementation, the second processing unit 404 is specifically configured to determine that there is a marker on the object to be recognized if the difference degree value between the sum of the areas of the first parts of the image of the object to be recognized and the sum of the areas of the first parts of the preset template image is greater than a preset threshold.

[0133] As a possible implementation, the second processing unit 404 is further configured to determine the part of the target color of the preset template image; and use the part of the target color of the preset template image as the first part of the preset template image.

[0134] As a possible implementation, the second processing unit 404 is specifically configured to, if the preset template image includes at least two parts of the target color, use the at least two parts of the target color as at least two first parts of the preset template image.

[0135] As a possible implementation, the second processing unit 404 is further configured to obtain the positions of the center points of at least two first parts of the preset template image.

[0136] As a possible implementation, when the image of the object to be recognized and the preset template image both include at least two first parts, the second processing unit 404 is specifically configured to determine the positions of the corresponding first parts in the image of the object to be recognized according to the positions of the center points of at least two first parts of the preset template image; and determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized.

[0137] As a possible implementation, the first part includes a first sub - part and a second sub - part, and the first sub - part at least partially surrounds the second sub - part; the second processing unit 404 is specifically configured to set weight values for the first sub - part and the second sub - part respectively, where the weight value of the first sub - part is less than the weight value of the second sub - part; and determine the area of the target color part corresponding to the position of the first part in the image of the object to be recognized according to the weight value of the first sub - part and the weight value of the second sub - part.

[0138] Corresponding to the above - mentioned embodiment, the present application further provides an electronic device. Figure 5 FIG. 500 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. The electronic device 500 may include: a processor 501, a memory 502, and a communication unit 503. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiments of the present invention. It can be a bus - shaped structure, a star - shaped structure, and may also include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0139] Among them, the communication unit 503 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices, or send user data to other devices.

[0140] The processor 501 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 502, and calling data stored in the memory, it executes various functions of the electronic device and / or processes data. The processor may be composed of an integrated circuit (IC). For example, it may be composed of a single - packaged IC, or may be composed of multiple packaged ICs with the same or different functions connected together. For example, the processor 501 may only include a central processing unit (CPU). In the embodiment of the present invention, the CPU may be a single - core operation core or may include multiple operation cores.

[0141] The memory 502 is used to store execution instructions of the processor 501. The memory 502 can be implemented by any type of volatile or non - volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read - only memory (EEPROM), erasable programmable read - only memory (EPROM), programmable read - only memory (PROM), read - only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0142] When the execution instructions in the memory 502 are executed by the processor 501, the electronic device 500 is enabled to execute Figure 1 some or all of the steps in the illustrated embodiments.

[0143] Corresponding to the above embodiments, the present application also provides a laser processing device. For the electronic structure part of the laser processing device, refer to the structure of the electronic device 500.

[0144] In some embodiments, the laser processing device provided by the embodiments of the present application includes a laser drilling device or a laser cutting device. When the object to be recognized is a printed circuit board, the laser drilling device or the laser cutting device can drill or cut the printed circuit board with markers to ensure that all the produced printed circuit boards are qualified products without markers.

[0145] In a specific implementation, the present invention also provides a computer storage medium. The computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in the embodiments of the marker recognition method provided by the present invention. The storage medium can be a magnetic disk, an optical disc, a read-only memory (ROM), or a random access memory (RAM), etc.

[0146] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution in the embodiments of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

[0147] For the same and similar parts among the various embodiments in this specification, reference can be made to each other. In particular, for the device embodiments and the terminal embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A marker recognition method, characterized in that, Including the following steps: Obtain an image of the object to be recognized; Determine the area of the first part of the image of the object to be recognized, where the first part is the part of the image of the object to be recognized with the target color; Obtain the area of the first part of the preset template image; The preset template image is an image of a preset template object, and the preset template object is a preset object that is the same as the object to be recognized and has no markers; The marker is used to mark an object with an abnormality; Determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

2. The method according to claim 1, wherein The object to be recognized is a printed circuit board, the marker is ink, and the target color is the color of the metal or the substrate in the printed circuit board.

3. The method according to claim 1, wherein The determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes: if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than a preset threshold value, it is determined that there is a marker on the object to be recognized.

4. The method according to claim 1, characterized in that The determining whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image includes: If the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is not greater than the preset threshold value, it is determined that there is no marker on the object to be recognized.

5. The method according to claim 1, characterized in that Both the image of the object to be recognized and the preset template image are images after binarization processing; the first part is the black area or the white area of the image after binarization processing.

6. The method according to any one of claims 1-5, characterized in that, When both the image of the object to be recognized and the preset template image include at least two first parts, the determining the area of the first part of the image of the object to be recognized includes: Respectively determine the area of each first part of the image of the object to be recognized; The obtaining the area of the first part of the preset template image includes: Respectively obtain the area of each first part of the preset template image; The if the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than the preset threshold value, it is determined that there is a marker on the object to be recognized includes: If there is a difference value between the area of at least one first part in the image of the object to be recognized and the area of the corresponding first part in the preset template image that is greater than the preset threshold value, it is determined that there is a marker on the object to be recognized.

7. The method according to any one of claims 1-5, characterized in that, When both the image of the object to be recognized and the preset template image include at least two first parts, the determining the area of the first part of the image of the object to be recognized includes: Respectively determine the area of each first part of the image of the object to be recognized; The obtaining the area of the first part of the preset template image includes: Respectively obtain the area of each first part of the preset template image; If the difference value between the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image is greater than a preset threshold, determining that there is a marker on the object to be recognized includes: if there is a difference value between the sum of the areas of the first parts of the image of the object to be recognized and the sum of the areas of the first parts of the preset template image that is greater than the preset threshold, determining that there is a marker on the object to be recognized.

8. The method according to claim 1, characterized in that, Before determining the area of the first part in the image of the object to be recognized, it further includes: Determining the part of the target color of the preset template image; Taking the part of the target color of the preset template image as the first part of the preset template image.

9. The method according to claim 8, wherein The taking the part of the target color of the preset template image as the first part of the preset template image includes: If the preset template image includes at least two parts of the target color, taking the at least two parts of the target color as at least two first parts of the preset template image.

10. The method according to claim 9, wherein The method further includes: Obtaining the positions of the centers of at least two first parts of the preset template image.

11. The method according to claim 9, wherein When both the image of the object to be recognized and the preset template image include at least two first parts, the determining the area of the first part of the image of the object to be recognized includes: Determining the position of the corresponding first part in the image of the object to be recognized according to the positions of the centers of at least two first parts of the preset template image; Determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized.

12. The method according to claim 11, wherein The first part includes a first sub - part and a second sub - part, and the first sub - part at least partially surrounds the second sub - part; The determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized includes: Respectively setting weight values for the first sub - part and the second sub - part, wherein the weight value of the first sub - part is less than the weight value of the second sub - part; Determining the area of the target color part corresponding to the position of the first part in the image of the object to be recognized according to the weight value of the first sub - part and the weight value of the second sub - part.

13. A marker recognition device, characterized in that, It includes: A first obtaining unit, configured to obtain an image of an object to be recognized; A first processing unit, configured to determine the area of the first part of the image of the object to be recognized, where the first part is the part of the target color in the image of the object to be recognized; A second obtaining unit, configured to obtain the area of the first part of the preset template image; The preset template image is an image of a preset template object, and the preset template object is a pre - set object that is the same as the object to be recognized and has no marker; The marker is used to mark an object with an abnormality; A second processing unit, configured to determine whether there is a marker on the object to be recognized according to the area of the first part of the image of the object to be recognized and the area of the first part of the preset template image.

14. An electronic device, characterized in that, It includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 1 - 12.

15. A laser processing device, characterized in that, Comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the laser processing device is triggered to execute the method according to any one of claims 1-12.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein when the program runs, it controls the device where the computer-readable storage medium is located to execute the method according to any one of claims 1-12.