Processing method and device, equipment and storage medium
By obtaining and analyzing the template list of packaging printing areas, identifying and adjusting interfering pixels in the crossing areas, the problem of false detection in existing packaging detection methods is solved, and the accuracy and efficiency of detection is improved.
Patent Information
- Application Number
- CN202510084707.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-06-13
AI Technical Summary
When existing packaging inspection methods deal with packaging with diverse shapes, sizes and design elements, crossing areas between templates are prone to occur, resulting in mis-checking problems and affecting the accuracy and efficiency of detection.
By obtaining the template list of the packaging printing areas to be detected, the templates where the crossing areas exist, and adjust the area to be detected based on these crossing areas to remove interfering pixels, thereby avoiding false detection.
It effectively avoids mis-checking, improves the accuracy and efficiency of testing, and ensures accurate inspection of packaging quality.
Smart Images

Figure CN120147220A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of packaging detection, and in particular, to a processing method, apparatus, device, and storage medium. Background Art
[0002] In the production process of the packaging field, whether it is the packaging of electronic products, food, daily necessities, or other commodities, the first edition inspection is a key link to ensure packaging quality. Currently, image recognition or machine learning technology is usually used to establish a detection template according to the design document or standard for automatically detecting whether the printed content, color, pattern, text layout, etc. on the packaging meet the design requirements.
[0003] This template-based detection method can greatly improve production efficiency, reduce manual intervention, and lower production costs. However, in actual applications, the shapes, sizes, and design elements of packaging boxes or bags are diverse, which may cause overlapping or cross-over areas between templates, thus leading to misdetection problems. Especially when the cross-over area contains printed content that does not belong to the current template, the detection algorithm may wrongly identify this content as part of the current template, resulting in the omission or misjudgment of packaging quality problems. Summary of the Invention
[0004] The present disclosure provides a processing method, apparatus, device, and storage medium to at least solve the above technical problems existing in the prior art.
[0005] According to a first aspect of the present disclosure, there is provided a processing method, the method comprising:
[0006] Obtaining a template list of the printed area of the packaging to be detected, the template list being a set of templates representing different image features;
[0007] Determining templates with cross-over areas based on the template list;
[0008] If the cross-over area exists in the area to be detected of the printed area, adjusting the area to be detected based on the cross-over area so that there are no interfering pixels in the area to be detected.
[0009] In an implementable manner, the obtaining a template list of the printed area of the packaging to be detected includes:
[0010] Obtaining the connected regions of the printed area based on the design document of the packaging to be detected;
[0011] Obtaining the template list based on the connected regions of the printed area.
[0012] In an implementable manner, the determining templates with cross-over areas based on the template list includes:
[0013] Traverse the template list to determine whether there is an intersection between any two templates;
[0014] Determine that the two templates with an intersection are a pair of templates with an overlapping area.
[0015] In one implementable manner, the adjusting the area to be detected based on the overlapping area includes:
[0016] Determine the interfering pixels within the overlapping area;
[0017] Determine the coordinates of the interfering pixels, serialize the connected domain formed by the set of coordinates of the interfering pixels to obtain an overlapping template;
[0018] Adjust the area to be detected based on the overlapping template.
[0019] In one implementable manner, the adjusting the area to be detected based on the overlapping template includes:
[0020] Delete the pixel points in the area to be detected that coincide with the interfering pixels to obtain an adjusted image to be detected.
[0021] In one implementable manner, the method further includes:
[0022] Detect the adjusted image to be detected to obtain a detection result of the package to be detected.
[0023] According to a second aspect of the present disclosure, there is provided a processing device, the device includes:
[0024] An acquisition module, configured to acquire a template list of a printing area of a package to be detected, where the template list is a set of templates representing different image features;
[0025] A determination module, configured to determine a template with an overlapping area based on the template list;
[0026] An adjustment module, configured to, if the area to be detected in the printing area has the overlapping area, adjust the area to be detected based on the overlapping area so that there are no interfering pixels in the area to be detected.
[0027] In one implementable manner, the device further includes:
[0028] A detection module, configured to detect the adjusted image to be detected to obtain a detection result of the package to be detected.
[0029] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0030] At least one processor; and
[0031] A memory communicatively connected to the at least one processor; wherein,
[0032] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method described in this disclosure.
[0033] According to a fourth aspect of this disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method described in this disclosure.
[0034] This disclosure provides a processing method, apparatus, device, and storage medium. By obtaining a template list of a packaging printing area to be detected, the template list being a set of templates characterizing different image features; then determining templates with overlapping areas based on the template list; if an overlapping area exists in the area to be detected of the printing area, adjusting the area to be detected based on the overlapping area so that there are no interfering pixels in the area to be detected. By adopting the above method, the interfering pixels in the overlapping area are removed, thereby being able to avoid false detection and improve the efficiency and accuracy of detection.
[0035] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of this disclosure, nor is it used to limit the scope of this disclosure. Other features of this disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] By referring to the accompanying drawings and reading the following detailed description, the above and other objects, features, and advantages of the exemplary embodiments of this disclosure will become readily understandable. In the drawings, several embodiments of this disclosure are shown in an exemplary and non-limiting manner, wherein:
[0037] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0038] Figure 1 A schematic diagram of an existing detection method is shown;
[0039] Figure 2 A flowchart of a processing method according to an embodiment of this disclosure is shown;
[0040] Figure 3 A flowchart of another processing method according to an embodiment of this disclosure is shown;
[0041] Figure 4 A flowchart of another processing method according to an embodiment of this disclosure is shown;
[0042] Figure 5 A schematic diagram of a processing apparatus according to an embodiment of this disclosure is shown;
[0043] Figure 6 shows a schematic structural diagram of another processing device according to an embodiment of the present disclosure;
[0044] Figure 7 shows a schematic composition structure diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners
[0045] To make the objectives, features, and advantages of the present disclosure more obvious and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present disclosure.
[0046] In the first edition detection stage of the packing box, usually one or more templates are established according to the design document or standard by using image processing or machine learning technology. These templates represent the patterns, texts, or logos that should be correctly printed on the packing box. These templates are used to detect the printed areas on the actually produced packing boxes to ensure that they meet the design standards. When using the templates for detection, usually the region of interest (ROI) to be detected needs to be cut out separately. However, when there are overlapping areas in the circumscribed rectangles of different templates, that is, these overlapping areas contain printed contents that do not belong to the current template, then the detection algorithm may misjudge these contents as part of the current template, resulting in false detection. As Figure 1 shown in the schematic diagram of the existing detection method, the left figure in the first row is the template set established according to the design document, T in the middle is a template in the template set, and the right figure represents the area corresponding to the T template in the figure to be detected. Template matching is performed in the original figure using the template to obtain the area of the original figure to be detected; when performing background detection, there are other printed elements (appearing part of the feature of h) in the background area, which does not match the T template, resulting in misjudgment.
[0047] Due to the above false detection problem, manual secondary judgment is required to confirm whether the detection result is accurate, thereby reducing the detection efficiency. Based on this, the present disclosure provides a processing method to reduce the interference of the overlapping area on the printed content of the current template and improve the detection accuracy and detection efficiency.
[0048] As Figure 2 shown in the flowchart of a processing method provided by an embodiment of the present disclosure, the method includes:
[0049] S1. Obtain a template list of the packaging printed area to be detected, where the template list is a set of templates representing different image features.
[0050] The template list is a series of predefined image templates. Each template is an image segment that represents a specific image feature or object. These templates are used to compare or match with the input image to identify or locate specific image features, objects, or regions.
[0051] S2. Determine the templates with overlapping regions based on the template list.
[0052] Traverse the template list. For each pair of templates in the list, calculate their intersection. If overlapping or intersection is found during the matching of the two templates, record these overlapping regions, indicating that there is an intersection between the two templates, and they are regarded as a pair of templates with overlapping regions. The overlapping region contains some interfering pixels that may cause misjudgment during the detection process.
[0053] S3. If the overlapping region exists in the region to be detected in the printing area, adjust the region to be detected based on the overlapping region so that there are no interfering pixels in the region to be detected.
[0054] Within the determined region to be detected, determine whether the overlapping region determined in step S2 exists. If it exists, adjust the region to be detected containing the overlapping region to remove the interfering pixels in the region to be detected.
[0055] In the above solution, by obtaining the template list of the printing area of the packaging to be detected, the template list is a set of templates representing different image features; then determine the templates with overlapping regions based on the template list; if the overlapping region exists in the region to be detected in the printing area, adjust the region to be detected based on the overlapping region so that there are no interfering pixels in the region to be detected. By adopting the above method, the interfering pixels in the overlapping region are removed, thus avoiding misdetection and improving the efficiency and accuracy of detection.
[0056] In one example, obtaining the template list of the printing area of the packaging to be detected includes:
[0057] Obtain the connected components of the printing area based on the design drawing of the packaging to be detected;
[0058] Based on the connected components of the printing area, obtain the template list.
[0059] The design document of the package to be detected contains the complete layout of the package. The design document includes a printing area and a non-printing area, where the printing area is marked in the design document with a specific color, filling pattern, or line. The design document can be a file in digital form, such as a CAD file, a PDF document, or an image file, etc. In one example, the printing area can be identified from the design document through image processing or CAD software tools. After identifying the printing area, it is necessary to further extract the connected components of these areas. For example, the region growing algorithm can be used to obtain the connected components, where the connected component refers to a set of adjacent pixels with similar color or brightness in the image.
[0060]
[0061] t represents the distance threshold between two sub-connected components that can grow into the same template, T represents the pixel difference threshold of pixels belonging to the same template, C represents the connected component, I(x 1 ,y 1 ),I(x 2 ,y 2 ) represents the coordinates and pixel value of the pixel to be calculated, and d(P 1 ,P 2 ) represents the distance between two pixels to be calculated. By performing recursion according to the above formula (1), the ordinary template set can be obtained.
[0062] For each extracted connected component, create a corresponding template according to its shape, size, color and other characteristics. For example, taking the character "Thinkpad" in the printing area as an example, each character can be used as a separate template, that is, 8 templates of "T", "h", "i", "n", "k", "p", "a", "d" can be obtained, and these 8 templates form a template list.
[0063] In one example, the template for determining the existence of an overlapping area based on the template list includes:
[0064] Traverse the template list to determine whether there is an intersection between any two templates;
[0065] Determine that the two templates with an intersection are a pair of templates with an overlapping area.
[0066] For example, you can start from the first template in the template list and check each template in the list one by one. For the currently checked template (such as template T), compare it with all the remaining templates in the list to determine whether there is an intersection between the current template and other templates in the feature space or the image space.
[0067] Among them, calculating the intersection between each template to obtain a pair of templates with an overlapping area can be carried out through the following method.
[0068]
[0069] Bounding Box = {(x min , y min ), (x max , y max )} Formula (3)
[0070]
[0071] Formulas (2) and (3) are used to calculate the outer rectangle (Bounding Box) of the template obtained in Formula (1), where x min , y min , x max , y max represent the coordinate boundary maximum and minimum values of each point in template P, and Bounding Box represents the minimum circumscribed rectangle of the template area composed of the maximum and minimum values. Formula (4) is used to calculate the intersection of any two outer rectangles A and B, where represents the maximum value among the minimum values of x of rectangles A and B, and is used to calculate the intersection box, similarly. Formula (5) is used to determine whether there is an intersection. If Formula (5) is not satisfied, there is no intersection area between the templates, and it is skipped. If satisfied, these two templates are determined to be a template pair with an intersection area.
[0072] For example, directly making an outer rectangle for the detection area, using the outer rectangle in the template of "T" will include a partial area of "h", so there is an intersection area between "T" and "h".
[0073] In one example, adjusting the area to be detected based on the intersection area includes:
[0074] Determining the interfering pixels within the intersection area;
[0075] Determining the coordinates of the interfering pixels, serializing the connected domain formed by the coordinate set of the interfering pixels, and obtaining an intersection template;
[0076] Adjusting the area to be detected based on the intersection template.
[0077] The pixel points within the intersection area that do not belong to the current template are determined as interfering pixels. The interfering pixels within the intersection area will cause misjudgment or error in subsequent image processing or detection. Extract the coordinates of all interfering pixels, then combine adjacent interfering pixels into a larger connected domain, and serialize the connected domain. Serialization means converting the information (such as shape, size, coordinates, etc.) of the connected domain into an ordered data structure that is easy to store and transmit, and obtaining an intersection template. That is, the intersection template is a digital representation of the connected domain of interfering pixels.
[0078] To facilitate the recording of cross templates, each template pair is set with a unique identifier for convenient reference in subsequent processing. For example, a template pair with an overlapping area is recorded as cross_x_y template, where x is the current template number and y is the template number causing interfering pixels.
[0079]
[0080] For example, in formula (6), where P result represents the obtained cross template. In the recorded overlapping area, the pixel points that do not belong to the connected domain in template A but belong to the connected domain in template B form the cross template cross_A_B.
[0081] In one example, adjusting the area to be detected based on the cross template includes:
[0082] Deleting the pixel points in the area to be detected that coincide with the interfering pixels to obtain the adjusted image to be detected.
[0083] Before detection, it is first necessary to match the cross template with the area to be detected, find out which parts of the area to be detected match the cross template, and delete the pixel points in the area to be detected that coincide with the interfering pixels to obtain the adjusted image to be detected.
[0084] In one example, such as Figure 3 , the method further includes:
[0085] S4. Detect the adjusted image to be detected to obtain the detection result of the package to be detected.
[0086] The influence of interfering pixels is removed from the adjusted image to be detected, and then printing detection, CANNY detection, and background detection are performed on it, which can improve the detection accuracy and avoid misjudgment.
[0087] The following combines specific embodiments to elaborate on this solution in detail. The pattern in the printing area takes "Thinkpad" as an example. As Figure 4 shown is the flow schematic diagram of this method.
[0088] S101. Obtain the connected domains of the printing area based on the region growing algorithm to get a template list. The 8 characters "T", "h", "i", "n", "k", "p", "a", "d" each correspond to a template, which are named template A to template H in sequence.
[0089] S102. Calculate the intersections between the templates to obtain the template pairs with overlapping areas.
[0090] Taking template A as the current template, calculate the intersection of template A with templates B to H in sequence. If it is determined that there is an intersection between template A and template B, then template A and template B are a pair of templates with an overlapping area.
[0091] S103. Determine the pixel points in the overlapping area that do not belong to the connected components in template A but belong to the connected components in template B, and form the overlapping template cross_A_B.
[0092] The other templates are also calculated according to this method, which will not be elaborated here.
[0093] S104. Obtain the image to be detected of the packaging to be detected, perform preprocessing such as transfer and filtering, and then match the area to be detected from the image to be detected according to the template list, and determine whether there is an overlapping template in this area.
[0094] If there is an overlapping template in this area, delete the pixel points that coincide with the overlapping template in this area to obtain the adjusted area to be detected, and perform printing detection, CANNY detection, and background detection on the adjusted area to be detected. If there is no overlapping template in this area, it means that there are no interfering pixels in this area, and printing detection, CANNY detection, and background detection can be directly performed.
[0095] The present disclosure also provides a detection device, as Figure 5 shown in the structural schematic diagram of the device. The device includes:
[0096] An acquisition module 50, configured to acquire a template list of the printing area of the packaging to be detected, where the template list is a set of templates representing different image features;
[0097] A determination module 60, configured to determine the templates with overlapping areas based on the template list;
[0098] An adjustment module 70, configured to, if the area to be detected in the printing area has the overlapping area, adjust the area to be detected based on the overlapping area so that there are no interfering pixels in the area to be detected.
[0099] In the above device, the acquisition module 50 acquires a template list of the printing area of the packaging to be detected, and the template list is a set of templates representing different image features; then the determination module 60 determines the templates with overlapping areas based on the template list; the adjustment module 70 is configured to, if the area to be detected in the printing area has an overlapping area, adjust the area to be detected based on the overlapping area so that there are no interfering pixels in the area to be detected. Through the above device, the interfering pixels in the overlapping area are removed, so as to avoid false detection and improve the efficiency and accuracy of detection.
[0100] In one example, the acquisition module 50 is further configured to:
[0101] Obtain the connected components of the printing area based on the design document of the packaging to be detected;
[0102] Based on the connected components of the printing area, obtain the template list.
[0103] In one example, the determination module 60 is further configured to:
[0104] Traverse the template list to determine whether there is an intersection between any two templates;
[0105] Determine that two templates with an intersection are a pair of templates with an overlapping area.
[0106] In one example, the adjustment module 70 is further configured to:
[0107] Determine the interfering pixels within the overlapping area;
[0108] Determine the coordinates of the interfering pixels, serialize the connected components formed by the coordinate set of the interfering pixels to obtain an overlapping template;
[0109] Adjust the area to be detected based on the overlapping template.
[0110] In one example, the adjustment module 70 is further configured to:
[0111] Delete the pixel points in the area to be detected that coincide with the interfering pixels to obtain an adjusted image to be detected.
[0112] In one example, as Figure 6 shown, the device further includes:
[0113] A detection module 80, configured to detect the adjusted image to be detected to obtain a detection result of the packaging to be detected.
[0114] According to an embodiment of the present disclosure, there is also provided an electronic device, including:
[0115] At least one processor; and
[0116] A memory communicatively connected to the at least one processor; wherein,
[0117] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the present disclosure.
[0118] According to an embodiment of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method described in the present disclosure.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0120] Figure 7 FIG. shows a schematic block diagram of an exemplary electronic device 800 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0121] As Figure 7 shown, the device 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0122] A plurality of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0123] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 executes the various methods and processes described above, such as the processing method. For example, in some embodiments, the processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the processing method described above can be executed. Alternatively, in other embodiments, the computing unit 801 can be configured to execute the processing method in any other suitable manner (e.g., by means of firmware).
[0124] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, as an independent software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0127] To provide for interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).
[0128] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or in a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0129] A computer system can include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
[0130] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0131] In addition, the terms "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of this disclosure, "a plurality" means two or more, unless otherwise specifically defined.
[0132] As described above, the above are only specific embodiments of this disclosure, but the protection scope of this disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed in this disclosure can easily think of changes or substitutions, which should all be covered by the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be subject to the protection scope of the claims.
Claims
1. A processing method, characterized in that: The method comprises: Obtaining a template list of the packaging printing area to be detected, wherein the template list is a collection of templates representing different image features; Determine the templates with the intersection area based on the template list; If the area to be detected in the printing area has the intersection area, the area to be detected is adjusted based on the intersection area so that no interfering pixels exist in the area to be detected.
2. The method according to claim 1, characterized in that The step of obtaining a template list of a printing area of the package to be detected includes: Acquire a connected domain of the printing area based on the design file of the package to be inspected; The template list is obtained based on the connected domain of the printing area.
3. The method according to claim 1, characterized in that The determining, based on the template list, of templates having intersection areas includes: Traversing the template list to determine whether there is an intersection between any two templates; The two templates with an intersection are determined as a template pair with an intersection area.
4. The method according to claim 1, characterized in that The adjusting the area to be detected based on the intersection area includes: determining interfering pixels within the intersection region; Determine the coordinates of the interfering pixels, and serialize the connected domain formed by the coordinate set of the interfering pixels to obtain a cross template; The area to be detected is adjusted based on the cross template.
5. The method according to claim 4, characterized in that The adjusting the area to be detected based on the cross template includes: Pixel points in the area to be detected that overlap with the interfering pixels are deleted to obtain an adjusted image to be detected.
6. The method according to claim 5, further comprising: The adjusted image to be inspected is detected to obtain a detection result of the package to be inspected.
7. A processing device, characterized in that: The device comprises: An acquisition module, used to acquire a template list of a packaging printing area to be detected, wherein the template list is a collection of templates representing different image features; A determination module, configured to determine a template having an intersection area based on the template list; The adjustment module is used for adjusting the area to be detected based on the intersection area if the area to be detected in the printing area has the intersection area, so that there is no interference pixel in the area to be detected.
8. The device according to claim 7, characterized in that The device also includes: The detection module is used to detect the adjusted image to be detected and obtain the detection result of the package to be detected.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute: Obtaining a template list of the packaging printing area to be detected, wherein the template list is a collection of templates representing different image features; Determine the templates with the intersection area based on the template list; If the area to be detected in the printing area has the intersection area, the area to be detected is adjusted based on the intersection area so that no interfering pixels exist in the area to be detected.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute: Obtaining a template list of the packaging printing area to be detected, wherein the template list is a collection of templates representing different image features; Determine the templates with the intersection area based on the template list; If the area to be detected in the printing area has the intersection area, the area to be detected is adjusted based on the intersection area so that no interfering pixels exist in the area to be detected.