Nameplate defect detection methods, devices, electronic equipment and storage media

By identifying and comparing the photo pictures of the nameplate, the defect area is determined, and the production efficiency problem caused by manual inspection is solved, and the accurate detection and automated detection of nameplate defects are achieved.

CN114612427BActive Publication Date: 2025-03-21GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210233522.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-10
Publication Date
2025-03-21
Estimated Expiration
2042-03-10

AI Technical Summary

Technical Problem

In the prior art, nameplate defect detection mainly relies on manual inspection, resulting in low production efficiency.

Method used

By obtaining the photo picture of the nameplate, identifying and comparing, the defect area of ​​the nameplate is determined. The specific steps include obtaining pictures, identifying template pictures and date areas, erasing the dates of the date areas, and comparing the processed pictures with the template pictures to determine the defect areas.

Benefits of technology

It realizes accurate detection of nameplate defects, improves production efficiency, reduces the fatigue of manual review, and can automatically detect without manual template creation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612427B_ABST
    Figure CN114612427B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, electronic device and storage medium for nameplate defect detection. The method comprises: obtaining a first picture obtained by photographing a nameplate; identifying the first picture to determine a template image corresponding to the first picture and a date area in the first picture; erasing the date in the date area in the first picture to obtain a second picture; comparing the second picture with the template image to determine the defect area of ​​the nameplate. The scheme provided by the present invention can realize the detection of nameplate defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection technology, and in particular to a nameplate defect detection method, device, electronic equipment and storage medium. Background Art

[0002] The application range of laser marking instruments on the market is very wide. Before marking, users are required to import patterns or texts, adjust parameters, fill, etc. (commonly seen in CAD drawing). During this period, the user's operation and human emotions may cause defects in the nameplate, affecting subsequent production.

[0003] At present, in the actual production environment, the nameplates are checked by manual initial inspection. The large number of characters on the nameplates and fatigue of manual re-inspection reduce production efficiency. Summary of the invention

[0004] The present application provides a nameplate defect detection method, device, electronic device and storage medium to solve the technical problem of low production efficiency caused by manual detection of nameplate defects.

[0005] In a first aspect, the present application provides a nameplate defect detection method, the method comprising:

[0006] Obtaining a first image obtained by photographing the nameplate;

[0007] Identify the first picture, and determine the template image corresponding to the first picture and the date area in the first picture;

[0008] Erasing the date in the date area in the first picture to obtain a second picture;

[0009] The second image is compared with the template image to determine the defective area of ​​the nameplate.

[0010] In one embodiment, the identifying the first picture and determining the template image corresponding to the first picture and the date area in the first picture includes:

[0011] Recognize the first image, determine a barcode area in the first image, and obtain barcode characters in the barcode area;

[0012] Based on the barcode character, searching for a template image corresponding to the barcode character in a preset template image set;

[0013] The date area in the first picture is determined by using the barcode area and based on the correspondence between the barcode area and the date area.

[0014] In one embodiment, before erasing the date in the date area in the first picture, the method further includes:

[0015] Get the date in the date range;

[0016] Determining whether the date is consistent with a preset date;

[0017] When the date is inconsistent with the preset date, it is determined that the defective area of ​​the nameplate includes the date area.

[0018] In one embodiment, searching for a template image corresponding to the barcode character in a preset template image set based on the barcode character includes:

[0019] Based on the barcode character, determining whether a template image corresponding to the barcode character is found in a preset template image set;

[0020] When a template image corresponding to the barcode character is found in a preset template image set, the template image is acquired;

[0021] When the template image corresponding to the barcode character is not found in the preset template image set, a prompt is given to enter the correct barcode.

[0022] In one embodiment, before comparing the second image with the template image, the method further includes:

[0023] Identify the template image and determine the date area in the template image;

[0024] Erasing the date in the date area of ​​the template image.

[0025] In one embodiment, comparing the second image with the template image to determine the defective area of ​​the nameplate includes:

[0026] The second image is globally matched and the template image is matched by regions to determine the defective region of the nameplate.

[0027] In one embodiment, performing region-by-region screenshot matching on the second image and the template image to determine the defective region of the nameplate includes:

[0028] Respectively performing region-by-region interception on the second image and the template image to obtain a first region image and a second region image;

[0029] Continuously moving the coordinates of the four vertex corners in the first area picture, matching the picture after the perspective transformation of the four vertex corners of the first area picture with the second area picture, and obtaining a matching result with the minimum difference;

[0030] Based on the matching result, a defective area of ​​the nameplate is determined.

[0031] In a second aspect, the present application provides a nameplate defect detection device, the nameplate defect detection device comprising:

[0032] An acquisition module, used to acquire a first image obtained by photographing the nameplate;

[0033] an identification module, configured to identify the first picture, and determine a template image corresponding to the first picture and a date area in the first picture;

[0034] An erasing module, configured to erase the date in the date area in the first picture to obtain a second picture;

[0035] A comparison module is used to compare the second image with the template image to determine the defective area of ​​the nameplate.

[0036] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein:

[0037] When the processor is used to run the computer program, it executes the steps of the method described in any one of the embodiments of the first aspect.

[0038] In a fourth aspect, the present application provides a storage medium storing a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of the embodiments of the first aspect are implemented.

[0039] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0040] The method provided in the embodiment of the present application can not only recognize the characters in the nameplate, but also recognize the icons in the nameplate, and can realize accurate detection of nameplate defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1A flowchart of a nameplate defect detection method provided in an embodiment of the present application;

[0044] Figure 2 This is a schematic diagram of the overall process of nameplate defect detection in an application example of this application;

[0045] Figure 3 This is a structural schematic diagram of a nameplate defect detection device according to an application example of the present application;

[0046] Figure 4 A schematic diagram of a template diagram set preset for an application example of this application;

[0047] Figure 5 A schematic diagram of two template images in a template image set preset in an application embodiment of the present application;

[0048] Figure 6 This is a schematic diagram of the effect of normalizing a picture in an application example of this application;

[0049] Figure 7 This is a schematic diagram of the barcode character recognition process of the application embodiment of the present application;

[0050] Figure 8 This is a schematic diagram of date positioning detection in an application example of the present application;

[0051] Fig. 9 This is a schematic diagram of template matching in an application example of this application;

[0052] Fig.10 This is a schematic diagram of the test results of the application example of this application;

[0053] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0055] Figure 1 A flowchart of a nameplate defect detection method provided in an embodiment of the present application. Figure 1 As shown, the method includes:

[0056] Step 101: Acquire a first picture obtained by photographing the nameplate;

[0057] Step 102: Identify the first picture, and determine the template image corresponding to the first picture and the date area in the first picture;

[0058] Step 103: erasing the date in the date area in the first picture to obtain a second picture;

[0059] Step 104: Compare the second image with the template image to determine the defective area of ​​the nameplate.

[0060] Specifically, the template diagram in this embodiment can be a CAD diagram based on which the nameplate is made. In actual application, the template diagram can be commanded with barcode characters in the diagram for easy search.

[0061] During the production process of the nameplate, the date in the date area of ​​the CAD image will be changed based on the date. Therefore, in order to achieve accurate recognition, the date in the date area of ​​the first image needs to be erased to obtain the second image. The second image is compared with the template image to detect the defective area in the nameplate.

[0062] Furthermore, before the first image is recognized, the first image may be rectified. Specifically, the maximum connected domain of the first image is obtained, the frame outline and the minimum circumscribed rectangle of the first image are obtained, 1 / 4 of the shortest side of the circumscribed rectangle is used as the length, 5 pixels are used as the step length, and the points in the maximum connected domain are traversed with the step length, and a line segment is obtained each time the traversal is performed. The slope and offset are calculated based on the starting point; the data is divided into four colinear groups of data according to the slope angle, and the mean of the slope and offset are taken as the optimal value for straight line fitting to obtain four straight lines for frame fitting. The four intersection points of the straight lines are obtained to perform perspective transformation on the image to obtain the rectified image.

[0063] In one embodiment, the identifying the first picture and determining the template image corresponding to the first picture and the date area in the first picture includes:

[0064] Recognize the first image, determine a barcode area in the first image, and obtain barcode characters in the barcode area;

[0065] Based on the barcode character, searching for a template image corresponding to the barcode character in a preset template image set;

[0066] The date area in the first picture is determined by using the barcode area and based on the correspondence between the barcode area and the date area.

[0067] Since the barcode area is generally located in the lower right corner of the nameplate, the bottom 1 / 3 area in the first image can be screenshot first, and the bottom 1 / 3 area can be processed to determine the barcode area in the first image. Here, the bottom 1 / 3 area is processed, specifically: calculate the gradients in the x and y directions in the 1 / 3 area, subtract the y direction gradient from the x direction gradient to get the absolute value, perform multiple expansion and corrosion operations on the effect diagram, and obtain the largest contour in the 1 / 3 area as the barcode. Furthermore, 1 / 2 of the barcode height can be extended downward to obtain the barcode number, and a deep learning convolutional neural network is used for character recognition to obtain the barcode character.

[0068] In one embodiment, before erasing the date in the date area in the first picture, the method further includes:

[0069] Get the date in the date range;

[0070] Determining whether the date is consistent with a preset date;

[0071] When the date is inconsistent with the preset date, it is determined that the defective area of ​​the nameplate includes the date area.

[0072] In actual application, before erasing the date, the date can be judged first. If the date is inconsistent with the preset date, the date area is judged to be a defective area. If the date is consistent with the preset date, the date in the date area is erased and the nameplate defect detection continues.

[0073] Here, it should be noted that this embodiment identifies all areas of the nameplate and identifies all defective areas, so there may be multiple defective areas during identification. Here, when it is identified that the date is inconsistent with the preset date, the date area of ​​the nameplate can be determined as one of the defective areas.

[0074] Specifically, after the date area is determined, character recognition may be used to determine the date in the date area.

[0075] In one embodiment, searching for a template image corresponding to the barcode character in a preset template image set based on the barcode character includes:

[0076] Based on the barcode character, determining whether a template image corresponding to the barcode character is found in a preset template image set;

[0077] When a template image corresponding to the barcode character is found in a preset template image set, the template image is acquired;

[0078] When the template image corresponding to the barcode character is not found in the preset template image set, a prompt is given to enter the correct barcode.

[0079] Since the barcode characters may be changed in the actual process, in order to avoid the nameplate being unable to be detected for defects, when the template image corresponding to the barcode characters is not found in the preset template image set, a prompt may be given to enter the correct barcode so as to continue the nameplate defect detection.

[0080] In one embodiment, before comparing the second image with the template image, the method further includes:

[0081] Identify the template image and determine the date area in the template image;

[0082] Erasing the date in the date area of ​​the template image.

[0083] Specifically, there is also a date area in the template image, and the content in the date area is generally in the format of YYYY.MM. In order to successfully detect nameplate defects, the date in the date area in the template image needs to be erased.

[0084] Furthermore, the completion process of this embodiment may be:

[0085] Identify the template image and determine the date area in the template image;

[0086] Erasing the date in the date area of ​​the template image.

[0087] Obtaining a first image obtained by photographing the nameplate;

[0088] Identify the first picture, and determine the template image corresponding to the first picture and the date area in the first picture;

[0089] Erasing the date in the date area in the first picture to obtain a second picture;

[0090] The second image is compared with the template image to determine the defective area of ​​the nameplate.

[0091] In one embodiment, comparing the second image with the template image to determine the defective area of ​​the nameplate includes:

[0092] The second image is globally matched and the template image is matched by regions to determine the defective region of the nameplate.

[0093] Since there are large differences between the second image and the template image (such as the thickness of the characters, etc.), the detection accuracy can be improved and the false detection rate can be reduced through global matching and regional screenshot matching.

[0094] In one embodiment, performing region-by-region screenshot matching on the second image and the template image to determine the defective region of the nameplate includes:

[0095] Respectively performing region-by-region interception on the second image and the template image to obtain a first region image and a second region image;

[0096] Continuously moving the coordinates of the four vertex corners in the first area picture, matching the picture after the perspective transformation of the four vertex corners of the first area picture with the second area picture, and obtaining a matching result with the minimum difference;

[0097] Based on the matching result, a defective area of ​​the nameplate is determined.

[0098] Specifically, the four vertex coordinates of the intercepted image are continuously moved, and the image after the perspective transformation of the four vertex angles is matched with the template image. The image with the smallest difference is obtained as the matching result, and the white area in the matching result is determined as a defect; by binarizing the matching result, the defect area is located.

[0099] In addition, for small defect detection, considering the large difference between the template image and the second image, there are many false detections. Therefore, the binary image can be optimized; the binary image is expanded to enlarge the white difference area; by finding the contour, the difference area is cut out and further compared with the corresponding area of ​​the template image to obtain the final defect area.

[0100] The nameplate defect detection method provided in the embodiment of the present application obtains a first picture obtained by photographing the nameplate; identifies the first picture to determine the template image corresponding to the first picture and the date area in the first picture; erases the date in the date area in the first picture to obtain a second picture; compares the second picture with the template image to determine the defect area of ​​the nameplate. The solution provided in the embodiment of the present application can recognize not only the characters in the nameplate, but also the icons in the nameplate, and can realize accurate detection of nameplate defects.

[0101] Hereinafter, the present application will be described in detail in conjunction with application examples.

[0102] This embodiment provides a nameplate defect detection method, which can replace the manual review of the initial inspection and improve the overall efficiency; can identify defects according to the template diagram; and can perform automatic detection without the need for manual template creation.

[0103] Specifically, see Figure 2 The overall process of the nameplate defect detection method in this embodiment is as follows:

[0104] Step 201: The nameplate is placed in the device; then step 202 is performed:

[0105] Here, the structural diagram of the device can be shown as Figure 3 The device includes a lens and a camera, a strip light source, a notch for placing a nameplate, a bracket, a light-shielding square structure, a red warning light, a green signal light and a display.

[0106] Step 202: The camera takes a photo; then execute step 203:

[0107] Step 203: barcode positioning; then execute step 204:

[0108] Step 204: Identify the barcode characters; then execute step 205:

[0109] Step 205: Searching for a CAD drawing according to the barcode;

[0110] Here, the CAD drawing refers to each template drawing in a preset template drawing set. According to the barcode, the CAD drawing in the preset template drawing set corresponding to the barcode can be found. Figure 4 , Figure 4 Each template image in the preset template image set. Each template image is in CAD format. Since the current nameplates are made according to the corresponding CAD images, in order to achieve the effect of reducing manpower and manual modeling operations, the CAD images corresponding to all products can be exported to a folder in the early stage, and each image is named by a barcode. Such exported images are used as template images, and they can be searched by barcode name later. Figure 5 for Figure 4 The template stores two of the template images in the collection.

[0111] If no CAD drawing is found, step 206 is executed; if a CAD drawing is found, step 208 is executed;

[0112] Step 206: Alarm prompt; then execute step 207;

[0113] Step 207: Enter the correct barcode;

[0114] If it is detected that the user enters a correct barcode, then step 205 is executed;

[0115] Step 208: date identification and comparison; then execute step 209;

[0116] Step 209: Whether the date is successfully located;

[0117] If the date is not successfully located, then execute step 210; if the date is successfully located, then execute step 211;

[0118] Step 210: Date defect; then execute step 212;

[0119] Step 211: Erase the date area, and then execute step 212;

[0120] Step 212: Defect detection, then executing step 213;

[0121] Step 213: Determine whether it is defective;

[0122] If there is a defect, execute step 214; if there is no defect, execute step 215;

[0123] Step 214: Alarm, red light on; then execute step 216;

[0124] Step 215: Green light quantity, then execute step 216;

[0125] Step 216: Display the result.

[0126] The following is a detailed description based on the above steps.

[0127] (1) Figure 5 Example of nameplate on the left side of the center, located Figure 2 The device obtains a picture taken by the camera; obtains the maximum connected domain of the picture, obtains the border outline and the minimum circumscribed rectangle of the outer periphery of the picture, takes 1 / 4 of the shortest side of the circumscribed rectangle as the length, and 5 pixels as the step length, and uses the step length to traverse the points in the maximum connected domain, and obtains a line segment each time it is traversed. The slope and offset are calculated based on the starting point; the data is divided into four colinear groups of data according to the slope angle, and the mean of the slope and offset are taken as the optimal value for straight line fitting to obtain four straight lines for border fitting. Obtain the four intersection points of the straight lines to perform perspective transformation on the picture to obtain the straightened picture. Here, the specific straightening effect can be seen in Figure 6 .

[0128] (2) Perform barcode positioning digital recognition. Since the barcode is located in the lower right corner of the nameplate, the bottom 1 / 3 area is intercepted for processing; the gradients in the x and y directions of the image are calculated, and the absolute value is obtained by subtracting the gradient in the y direction from the gradient in the x direction, see Figure 7 , perform multiple expansion and erosion operations on the effect image, and obtain the largest outline in the image as the barcode; take 1 / 2 of the barcode height and extend it downward to obtain the barcode number; here, deep learning convolutional neural network can be used to recognize characters to obtain the barcode number.

[0129] (3) Use the barcode to obtain the CAD template image. If the barcode is not found, enter it manually. After obtaining the template image, perform date recognition and positioning (because the date format of the CAD image is in YYYY.MM format, it needs to be detected separately); first obtain the current year and month, and then intercept the local area of ​​the date for character recognition (there may be multiple types of recognized strings, and filter to obtain the string in date format), see Figure 8If the recognized characters of the image match the current year and month, the area on the detection image is erased and no detection is performed. Otherwise, it means that there is a defect in the date area of ​​the current image (this method does not require manual modeling and saves the labor of manual labeling).

[0130] (4) Match the processed image with the template image. Since there are large differences between the CAD image as the template image and the actual photographed image (such as the thickness of the characters, etc.), if only global matching is used, the false positive rate is high. Here, the images are cut out in different regions for comparison (such as Fig. 9 The first and second left pictures in the figure); the four vertex coordinates are continuously moved for the intercepted picture, and the picture transformed by the four vertex perspectives is matched with the template picture, and the picture with the smallest difference is taken as the matching result, and the white area is a defect (such as Fig. 9 The third picture from the left in the figure); Binarize the matching results (such as Fig. 9 The defect area is located by referring to the fourth picture from the left in the figure.

[0131] (5) For the detection of small defects, considering that there is a large difference between the CAD image and the actual image, there will be a lot of false detections, so the binary image is optimized; the binary image obtained in (4) is expanded to enlarge the white difference area; the contour is found, the difference area is cut out and further compared with the corresponding area of ​​the template image to obtain the best effect; the final effect is as follows Fig.10 shown.

[0132] This embodiment can realize both character recognition and icon recognition. Compared with single character recognition, it can increase the detection range of nameplates, without the need to create a large number of data sets, and improve detection accuracy. This embodiment can replace the manual review of the first inspection and improve overall efficiency; it can identify defects based on the template image; it can perform automatic detection without the need to manually create a template.

[0133] In order to implement the method of the embodiment of the present invention, the embodiment of the present application also provides a nameplate defect detection device. The nameplate defect detection device includes:

[0134] An acquisition module, used to acquire a first image obtained by photographing the nameplate;

[0135] an identification module, configured to identify the first picture, and determine a template image corresponding to the first picture and a date area in the first picture;

[0136] An erasing module, configured to erase the date in the date area in the first picture to obtain a second picture;

[0137] A comparison module is used to compare the second image with the template image to determine the defective area of ​​the nameplate.

[0138] It should be noted that the above-mentioned device provided in the above-mentioned embodiment and the above-mentioned method embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and will not be repeated here.

[0139] like Fig.11 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0140] Memory 113, used for storing computer programs;

[0141] In one embodiment of the present application, the processor 111 is used to implement the steps of the method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.

[0142] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0143] The device provided by the embodiment of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method of any one of the above embodiments is implemented.

[0144] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program objects. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program object implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0145] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program objects according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0146] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0148] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0149] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method provided in any of the aforementioned method embodiments are implemented.

[0150] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0151] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0152] It can be understood that the memory of the embodiment of the present invention can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.

[0153] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0154] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A nameplate defect detection method, characterized in that: The method comprises: Obtaining a first image obtained by photographing the nameplate; Identify the first picture, and determine the template image corresponding to the first picture and the date area in the first picture; Erasing the date in the date area in the first picture to obtain a second picture; Comparing the second image with the template image to determine the defective area of ​​the nameplate; Among them, identifying the first picture, determining the template image corresponding to the first picture and the date area in the first picture includes: identifying the first picture, determining the barcode area in the first picture, and obtaining the barcode characters in the barcode area; based on the barcode characters, searching for the template image corresponding to the barcode characters in a preset template image set; using the barcode area, based on the correspondence between the barcode area and the date area, determining the date area in the first picture.

2. The method according to claim 1, characterized in that Before erasing the date in the date area in the first picture, the method further includes: Get the date in the date range; Determining whether the date is consistent with a preset date; When the date is inconsistent with the preset date, it is determined that the defective area of ​​the nameplate includes the date area.

3. The method according to claim 1, characterized in that The step of searching a preset template graph set for a template graph corresponding to the barcode character based on the barcode character includes: Based on the barcode character, determining whether a template image corresponding to the barcode character is found in a preset template image set; When a template image corresponding to the barcode character is found in a preset template image set, the template image is acquired; When the template image corresponding to the barcode character is not found in the preset template image set, a prompt is given to enter the correct barcode.

4. The method according to claim 1, characterized in that Before comparing the second image with the template image, the method further includes: Identify the template image and determine the date area in the template image; Erasing the date in the date area in the template image.

5. The method according to claim 1, characterized in that The comparing the second picture with the template picture to determine the defective area of ​​the nameplate includes: The second image is globally matched and the template image is matched by regions to determine the defective region of the nameplate.

6. The method according to claim 5, characterized in that The performing region-by-region screenshot matching on the second image and the template image to determine the defective region of the nameplate includes: Respectively performing region-by-region interception on the second image and the template image to obtain a first region image and a second region image; Continuously moving the coordinates of the four vertex corners in the first area picture, matching the picture after the perspective transformation of the four vertex corners of the first area picture with the second area picture, and obtaining a matching result with the minimum difference; Based on the matching result, a defective area of ​​the nameplate is determined.

7. A nameplate defect detection device, characterized in that: The nameplate defect detection device comprises: An acquisition module, used to acquire a first image obtained by photographing the nameplate; an identification module, configured to identify the first picture, and determine a template image corresponding to the first picture and a date area in the first picture; An erasing module, configured to erase the date in the date area in the first picture to obtain a second picture; A comparison module, used for comparing the second image with the template image to determine the defective area of ​​the nameplate; Among them, the recognition module is also used to: identify the first picture, determine the barcode area in the first picture, and obtain the barcode character in the barcode area; based on the barcode character, search for the template image corresponding to the barcode character in a preset template image set; use the barcode area to determine the date area in the first picture based on the correspondence between the barcode area and the date area.

8. An electronic device, characterized in that: include: A processor and a memory for storing a computer program capable of running on the processor; wherein, When the processor is used to run the computer program, the steps of the method according to any one of claims 1 to 6 are performed.

9. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method for detecting defects of cosmetic paper label

    CN108548820A

  • Label defect detection method based on template comparison

    CN113850756A