A corrugated box printing pattern matching detection method and system
By real-time identification and cutting of the depression area of the corrugated carton, determining the printing parameters based on the printing pattern demand data, and using digital inkjet or laser technology for accurate printing, the printing defects caused by depression in traditional printing processes are solved, and the printing quality is improved. Resource utilization rate.
Patent Information
- Application Number
- CN202410891944.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-07-04
AI Technical Summary
Traditional corrugated carton printing technology cannot accurately avoid the recessed areas on the carton surface, resulting in missing, blurred or deformed printing patterns, affecting the aesthetics of the packaging and brand image, and increasing resource waste and rework costs.
By collecting corrugated carton images in real time, identifying the depression areas and cropping the printing areas, filtering the target printing parameters based on the printing pattern demand data, using parallel light sources and K-means algorithms for image clustering analysis, ensuring that defective parts are avoided during the printing process and using numbers Inkjet or laser printing technology for accurate printing.
It improves the integrity and aesthetics of the printing pattern, significantly improves resource utilization and production efficiency, avoids waste of printing areas caused by depressions, and ensures the integrity and clarity of the printing pattern.
Smart Images

Figure CN118691952B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine vision detection, and in particular to a corrugated box printing pattern matching detection method and system. Background Art
[0002] In the modern packaging industry, corrugated boxes are widely used due to their good protection, portability and environmental protection properties. However, during the production process of corrugated boxes, due to improper transportation, storage or processing, different degrees of depressions may appear on the surface of the boxes. Although these depressions may seem small, they can cause a series of problems in the subsequent printing process. In serious cases, they may even directly affect the final quality of the product and cause a huge waste of resources.
[0003] Traditional corrugated carton printing processes usually use fixed templates for mass printing, lacking detailed consideration of the surface conditions of individual cartons. When encountering cartons with dents, traditional printing methods often cannot accurately avoid these defective areas, resulting in missing, blurred or deformed printed patterns, which in turn affects the overall appearance and brand image of the packaging. In addition, due to the failure to effectively identify the dented areas before printing, a large number of cartons with surface defects are not discovered until after printing is completed, which not only causes a waste of raw materials, but also increases additional rework costs and reduces production efficiency. Summary of the invention
[0004] In order to solve at least one of the above-mentioned technical problems, the present invention provides a method and system for detecting matching of printed patterns on corrugated paper boxes.
[0005] In a first aspect, the present invention provides a method for detecting matching of printed patterns on corrugated paper boxes, the method comprising:
[0006] Acquire a plurality of different printing pattern requirement data from a printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information, and pattern size allowable range information;
[0007] Collecting a carton image of a corrugated carton to be printed in real time, and performing concave recognition on the carton image to obtain concave data, and cutting the carton image based on the concave data to obtain a printing area; the concave data includes concave position information and concave shape information;
[0008] Filtering at least one target printing data from the printing pattern requirement data based on the printing area, and determining a target printing parameter according to the target printing data and the printing area;
[0009] The corrugated box pattern is printed based on the target printing parameters.
[0010] Preferably, the step of cutting the carton image based on the concave data to obtain a printing area comprises:
[0011] Based on the concave position information and the concave shape information, the printable flag of the pixel points in the concave area of the carton image is set to 0, and the printable flags of the remaining pixel points are set to 1;
[0012] Extracting printable marks from the carton image and integrating them to obtain a mask matrix;
[0013] The mask matrix is multiplied pixel by pixel by the carton image to obtain the printing area of the carton image.
[0014] Preferably, the printing pattern requirement data includes printing pattern requirement data of one printing pattern or a combination of multiple printing patterns.
[0015] Preferably, the step of selecting at least one target printing data from the printing pattern requirement data based on the printing area, and determining target printing parameters according to the target printing data and the printing area includes:
[0016] Based on the printing area, at least one printing data that meets the pattern position allowable range information is selected from the printing pattern requirement data to obtain target printing data;
[0017] Calculating in sequence the maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area;
[0018] The printing parameters corresponding to each of the maximum allowable pattern areas are determined, and the printing parameters corresponding to the maximum allowable pattern area with the largest value are used as target printing parameters, wherein the printing parameters include shape information, position information and size information of the printing pattern.
[0019] Preferably, the real-time acquisition of the carton image of the corrugated carton to be printed, and the concave recognition of the carton image to obtain the concave data include:
[0020] Using a parallel light source to illuminate the corrugated paper box to be printed, to obtain the paper box image with shadow information;
[0021] Using K-means algorithm to perform cluster analysis on the pixels of the carton image to obtain multiple classification clusters;
[0022] Calculate the average gray value of each classification cluster, and select the classification cluster with the largest gray value difference from the preset comparison as the concave classification cluster;
[0023] The depression position information and the depression shape information are obtained according to the distribution of pixels of the depression classification cluster in the carton image.
[0024] In a second aspect, the present invention provides a corrugated box printing pattern matching detection system, the system comprising:
[0025] A data acquisition module, used to obtain a plurality of different printing pattern requirement data from a printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information and pattern size allowable range information;
[0026] A printing area screening module, used for real-time acquisition of a carton image of a corrugated carton to be printed, and for performing concave recognition on the carton image to obtain concave data, and for cutting the carton image based on the concave data to obtain a printing area; the concave data includes concave position information and concave shape information;
[0027] a printing parameter calculation module, configured to select at least one target printing data from the printing pattern requirement data based on the printing area, and determine a target printing parameter according to the target printing data and the printing area;
[0028] The pattern printing module is used to print a pattern on a corrugated box based on the target printing parameters.
[0029] Preferably, the printing area screening module comprises:
[0030] A printable mark setting unit, configured to set the printable marks of the pixels in the concave area of the carton image to 0 based on the concave position information and the concave shape information, and set the printable marks of the remaining pixels to 1;
[0031] A mask matrix setting unit, used for extracting printable marks from the carton image and integrating them to obtain a mask matrix;
[0032] A printing area calculation unit is used to multiply the mask matrix by the carton image pixel by pixel to obtain the printing area of the carton image.
[0033] Preferably, the printing area screening module comprises:
[0034] a target printing data screening unit, configured to screen out at least one printing data that meets the pattern position allowable range information from the printing pattern requirement data based on the printing area, to obtain target printing data;
[0035] a pattern area calculation unit, configured to sequentially calculate a maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area;
[0036] The target printing parameter determination unit is used to determine the printing parameters corresponding to each of the maximum allowable pattern areas, and take the printing parameters corresponding to the maximum allowable pattern area with the largest value as the target printing parameters, wherein the printing parameters include shape information, position information and size information of the printing pattern.
[0037] In a third aspect, the present invention further provides an electronic device comprising: a processor and a memory, wherein the memory is used to store computer program code, wherein the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method as described in the first aspect above and any possible implementation thereof.
[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the method as described in the first aspect above and any possible implementation thereof.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] 1) The present invention effectively solves the problem of printing defects caused by depressions in traditional corrugated box printing by avoiding the depressed area and reasonably matching the printing pattern or printing pattern group that meets the printing requirements based on the size and shape of the printable area, which not only improves the integrity and aesthetics of the printed pattern, but also significantly improves resource utilization and production efficiency;
[0041] 2) The present invention uses parallel light source illumination and K-means algorithm to perform image clustering analysis, which can accurately identify the concave areas on the surface of the corrugated box, ensuring that these defective areas can be completely avoided during the printing process, avoiding pattern omissions, thereby greatly improving the integrity of the printed pattern;
[0042] 3) Based on the identified depression data, the present invention can intelligently cut out the area suitable for printing, and reasonably layout the printing pattern according to the pattern requirement data provided by the customer, so as to maximize the use of the carton surface space, avoid the waste of printing area caused by depression, and significantly improve resource utilization.
[0043] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.
[0045] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0046] Figure 1 A schematic diagram of a process flow of a corrugated box printing pattern matching detection method provided by an embodiment of the present invention;
[0047] Figure 2 A structural schematic diagram of a corrugated box printing pattern matching detection system provided by an embodiment of the present invention;
[0048] Figure 3 A certain embodiment of the present invention provides Figure 2 The structural diagram of the printing area screening module;
[0049] Figure 4 Another embodiment of the present invention provides Figure 2 The structural diagram of the printing area screening module;
[0050] Figure 5 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0053] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0054] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0055] In addition, in order to better illustrate the present invention, numerous specific details are provided in the following specific embodiments. It should be understood by those skilled in the art that the present invention can be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present invention.
[0056] Traditional corrugated cardboard printing processes usually use fixed templates for mass printing, and lack detailed consideration of the surface conditions of individual cartons. When encountering dented cartons, traditional printing methods often cannot accurately avoid these defective areas, resulting in missing, blurred or deformed printed patterns.
[0057] The present invention provides a method for detecting matching of printed patterns on corrugated paper boxes. Figure 1 , the method comprising:
[0058] S100, acquiring a plurality of different printing pattern requirement data from a printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information, and pattern size allowable range information;
[0059] S200, collecting a carton image of a corrugated carton to be printed in real time, and performing concave recognition on the carton image to obtain concave data, and cutting the carton image based on the concave data to obtain a printing area; the concave data includes concave position information and concave shape information;
[0060] S300, selecting at least one target printing data from the printing pattern requirement data based on the printing area, and determining a target printing parameter according to the target printing data and the printing area;
[0061] S400, printing a corrugated box pattern based on the target printing parameters.
[0062] In this embodiment, a variety of different printing pattern demand data are first extracted from a pre-established printing pattern database. The printing pattern demand data not only includes the specific shape and size of the pattern and its allowed range of variation (scaling factor), but also covers the customer's special requirements for the pattern position, such as the distance limit between the pattern and the edge of the carton, etc. By pre-setting the printing pattern demand data, the customer can more accurately control the final presentation effect of the printed pattern, meeting the requirements of personalization, brand consistency and printing flexibility.
[0063] In a possible implementation, a graphical user interface corresponding to the printing pattern database is also provided to facilitate customers to input specific printing pattern requirement data, such as pattern shape, size range, position preference, etc.
[0064] The carton image of the corrugated carton to be printed is collected in real time, and the image is subjected to concave recognition. The specific steps of concave recognition are as follows:
[0065] By applying image processing libraries such as OpenCV for image preprocessing, such as grayscale and noise removal, the concave areas on the surface of corrugated boxes are then identified using a convolutional neural network (CNN) model trained using a deep learning framework (such as TensorFlow or PyTorch). The model needs to be trained with a large number of corrugated box concave images to achieve high-precision recognition. Concave recognition is not limited to identifying the location of the concave, but also includes the shape information of the concave, so as to more comprehensively evaluate the quality of the box surface. Based on the identified concave data, the area suitable for printing is cut out to avoid printing in the concave area, significantly improve the printing quality, and reduce the problem of pattern omissions caused by concave.
[0066] After determining the printing area, the most suitable target printing data is selected from the printing pattern demand data based on the printing area with the goal of maximizing the printing pattern area. In order to maximize the printing pattern area, an objective function is first defined, which can quantify the total area of the printing pattern and consider the shape, size and layout of the pattern on the carton. The goal is to find a set of printing pattern demand data so that the sum of the total area of all patterns is maximized while satisfying the constraints of non-overlapping and avoiding concave areas. In order to solve the above optimization problem, the following steps can be taken:
[0067] All possible pattern layouts are initialized as a feasible solution set, taking into account the constraints that the recessed area and the pattern do not overlap. For each layout in the solution set, the objective function value is calculated, which is the sum of all pattern areas. A greedy algorithm or simulated annealing algorithm is used to try to fine-tune the position of each pattern to find the local optimal solution, and a genetic algorithm or particle swarm optimization algorithm is used to explore the global optimal solution in a wider solution space. When the predetermined number of iterations is reached or the objective function value is no longer significantly improved, the search is stopped and the target printing parameters that maximize the sum of all printed pattern areas are determined.
[0068] In one possible embodiment, pattern recognition technology is used to compare the printing area with the pattern demand data in the database to screen out the pattern suitable for the current printing area. Combined with optimization algorithms such as genetic algorithms and simulated annealing algorithms, the best pattern arrangement and size (i.e., target printing parameters) are determined to maximize the area.
[0069] Furthermore, digital inkjet printing or laser printing technology is used to perform precise printing according to the parameters determined in S300 to ensure high-quality output of the pattern.
[0070] In this embodiment, the problem of printing defects caused by depressions in traditional corrugated cardboard printing is effectively solved by avoiding the depressed areas and reasonably matching the printing pattern (or printing pattern group) that meets the printing requirements based on the size and shape of the printable area. This not only improves the integrity and aesthetics of the printed pattern, but also significantly improves resource utilization and production efficiency, bringing revolutionary changes to the corrugated cardboard industry.
[0071] Preferably, the step of cutting the carton image based on the concave data to obtain a printing area comprises:
[0072] Based on the concave position information and the concave shape information, the printable flag of the pixel points in the concave area of the carton image is set to 0, and the printable flags of the remaining pixel points are set to 1;
[0073] Extracting printable marks from the carton image and integrating them to obtain a mask matrix;
[0074] The mask matrix is multiplied pixel by pixel by the carton image to obtain the printing area of the carton image.
[0075] In this embodiment, using image processing technology, each pixel of the carton image is firstly corresponded to a printable flag, which is a binary value, where 1 indicates printable and 0 indicates non-printable. According to the previously identified concave position information and shape information, the printable flag of the pixel in the concave area is set to 0, while the printable flags of the remaining pixel points remain at 1.
[0076] By integrating the printable marks of all pixels, a two-dimensional matrix with the same size as the original image is formed, namely the mask matrix. Each element in the matrix represents the printability of the pixel at the corresponding position, 0 means that the position is not printable, and 1 means that it is printable.
[0077] The mask matrix is multiplied pixel by pixel with the original carton image. Since the multiplication operation follows the logical AND rule (that is, any number multiplied by 0 equals 0), the positions corresponding to the values of 0 in the mask matrix in the original image will be "erased", while the positions with values of 1 remain unchanged. The final result is a carton image that only contains the printable area, that is, the printing area.
[0078] In this embodiment, by marking the pixel points in the recessed area as non-printable, the present solution can accurately identify and exclude the non-printable areas on the surface of the corrugated box, avoiding invalid or low-quality printing in the recessed areas. Furthermore, the cropped printing area only contains the printable part, ensuring the integrity and clarity of the printed pattern, while reducing unnecessary printing operations and improving the overall printing efficiency and yield rate.
[0079] Preferably, the printing pattern requirement data includes printing pattern requirement data of one printing pattern or a combination of multiple printing patterns.
[0080] Preferably, the step of selecting at least one target printing data from the printing pattern requirement data based on the printing area, and determining target printing parameters according to the target printing data and the printing area includes:
[0081] Based on the printing area, at least one printing data that meets the pattern position allowable range information is selected from the printing pattern requirement data to obtain target printing data;
[0082] Calculating in sequence the maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area;
[0083] The printing parameters corresponding to each of the maximum allowable pattern areas are determined, and the printing parameters corresponding to the maximum allowable pattern area with the largest value are used as target printing parameters, wherein the printing parameters include shape information, position information and size information of the printing pattern.
[0084] In this embodiment, according to the shape and position information of the printing area, printing data that meets the conditions is screened out from the printing pattern demand database. The conditions here are mainly based on the pattern position allowable range information, that is, the position of the pattern in the printing data must be within the printing area and not exceed the boundary of the area. For each screened target printing data, according to its pattern shape information and size allowable range information, combined with the specific size of the printing area, the maximum pattern area that each printing data can accept under the premise of satisfying the pattern integrity and visual effect is calculated. This process requires comprehensive consideration of the aspect ratio, shape characteristics and actual available space of the printing area.
[0085] After calculating the maximum allowable pattern area of each target printing data, the one with the largest value is selected as the final target printing data. This selection is based on the principle of maximizing the use of the printing area to ensure that the printed pattern is both beautiful and practical. After the target printing data is selected, the specific printing parameters are determined according to its pattern shape information, position information and size information, including but not limited to the precise size of the pattern, placement position and possible shape adjustment.
[0086] In this embodiment, by accurately matching the printing pattern with the printing area, the adaptability and flexibility of the printing pattern are effectively improved, ensuring that high-quality printing effects can be achieved on printing areas of various shapes and sizes. The screening and calculation process fully considers the actual limitations of the printing area, maximizes the use of available space, avoids waste of resources, and improves the efficiency of material and time use.
[0087] Preferably, the real-time acquisition of the carton image of the corrugated carton to be printed, and the concave recognition of the carton image to obtain the concave data include:
[0088] Using a parallel light source to illuminate the corrugated paper box to be printed, to obtain the paper box image with shadow information;
[0089] Using K-means algorithm to perform cluster analysis on the pixels of the carton image to obtain multiple classification clusters;
[0090] Calculate the average gray value of each classification cluster, and select the classification cluster with the largest gray value difference from the preset comparison as the concave classification cluster;
[0091] The depression position information and the depression shape information are obtained according to the distribution of pixels of the depression classification cluster in the carton image.
[0092] In this embodiment, in the process of collecting carton images, a parallel light source is used to evenly illuminate the corrugated carton to be printed, in order to produce clear shadows on the carton surface, which can reflect the concave conditions on the carton surface. The parallel light source can be an LED line light source or a laser light source, which can provide stable light intensity and direction to ensure accurate capture of shadow information.
[0093] By performing K-means clustering analysis on the pixels of the collected carton images with shadow information, the images are segmented into multiple classification clusters. The K-means algorithm is a common unsupervised learning algorithm that can effectively classify similar pixels into the same category. The categories here essentially reflect the different grayscale areas of the image.
[0094] For each classification cluster, calculate the average gray value of all pixels inside it. Classification clusters with lower gray values usually correspond to areas with darker shadows, which means that there is a depression in the area. By comparing the average gray value of each classification cluster with the preset comparison gray value, the classification cluster with the largest difference is selected as the depression classification cluster. Then, according to the distribution of pixels in the depression classification cluster in the image, the specific location and shape information of the depression is determined. This process may involve computer vision technologies such as connected domain analysis and contour detection to accurately depict the boundaries of the depression area.
[0095] By combining parallel light source illumination and K-means cluster analysis, this embodiment can accurately identify the concave area on the surface of the corrugated box, avoid misjudgment or missed detection that may exist in traditional methods, and improve recognition accuracy.
[0096] In a possible implementation, the present invention provides a corrugated box printing pattern matching detection system, referring to Figure 2 , the system comprising:
[0097] The data acquisition module 100 is used to obtain a plurality of different printing pattern requirement data from the printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information and pattern size allowable range information;
[0098] The printing area screening module 200 is used to collect the carton image of the corrugated carton to be printed in real time, and perform concave recognition on the carton image to obtain concave data, and cut the carton image based on the concave data to obtain the printing area; the concave data includes concave position information and concave shape information;
[0099] A printing parameter calculation module 300, configured to select at least one target printing data from the printing pattern requirement data based on the printing area, and determine a target printing parameter according to the target printing data and the printing area;
[0100] The pattern printing module 400 is used to print a pattern on a corrugated box based on the target printing parameters.
[0101] See also Figure 3 In one embodiment, the printing area screening module 200 includes:
[0102] A printable flag setting unit 201 is used to set the printable flag of the pixel points in the concave area of the carton image to 0 based on the concave position information and the concave shape information, and set the printable flags of the remaining pixel points to 1;
[0103] A mask matrix setting unit 202, used to extract the printable marks of the carton image and integrate them to obtain a mask matrix;
[0104] The printing area calculation unit 203 is used to multiply the mask matrix by the carton image pixel by pixel to obtain the printing area of the carton image.
[0105] See also Figure 4 In one embodiment, the printing area screening module 200 further includes:
[0106] A target printing data screening unit 204 is used to screen out at least one printing data that meets the pattern position allowable range information from the printing pattern requirement data based on the printing area to obtain target printing data;
[0107] A pattern area calculation unit 205, configured to sequentially calculate a maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area;
[0108] The target printing parameter determination unit 206 is used to determine the printing parameters corresponding to each of the maximum allowable pattern areas, and take the printing parameters corresponding to the maximum allowable pattern area with the largest value as the target printing parameters, wherein the printing parameters include shape information, position information and size information of the printing pattern.
[0109] It can be understood that the functions or modules included in the system provided in this embodiment can be used to execute the method described in the above method embodiment. Its specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.
[0110] The present invention also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device executes a method as described in any possible implementation manner.
[0111] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a method as described in any possible implementation manner.
[0112] See also Figure 5 , Figure 5 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention.
[0113] The electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.
[0114] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.
[0115] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.
[0116] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The input device 23 and the output device 24 can be independent devices or an integrated device.
[0117] It is understandable that in the embodiment of the present invention, the memory 22 is not only used to store related instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.
[0118] Understandably, Figure 5 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all video analysis devices that can implement the embodiments of the present invention are within the protection scope of the present invention.
[0119] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of the various embodiments of the present invention have different focuses. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, for parts not described or not described in detail in a certain embodiment, refer to the records of other embodiments.
[0121] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0124] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0125] A person skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Claims
1. A method for detecting matching of printed patterns on corrugated boxes. It is characterized in that The method comprises: Acquire a plurality of different printing pattern requirement data from a printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information, and pattern size allowable range information; Collecting a carton image of a corrugated carton to be printed in real time, and performing concave recognition on the carton image to obtain concave data, and cutting the carton image based on the concave data to obtain a printing area; the concave data includes concave position information and concave shape information; The method further comprises: selecting at least one target printing data from the printing pattern requirement data based on the printing area, and determining a target printing parameter according to the target printing data and the printing area, comprising: Based on the printing area, at least one printing data that meets the pattern position allowable range information is selected from the printing pattern requirement data to obtain target printing data; Calculating in sequence the maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area; Determine the printing parameters corresponding to each of the maximum allowable pattern areas, and use the printing parameters corresponding to the maximum allowable pattern area with the largest value as target printing parameters, wherein the printing parameters include shape information, position information, and size information of the printing pattern; The corrugated box pattern is printed based on the target printing parameters.
2. A corrugated box printing pattern matching detection method according to claim 1, It is characterized in that The step of cutting the carton image based on the concave data to obtain a printing area includes: Based on the concave position information and the concave shape information, the printable flag of the pixel points in the concave area of the carton image is set to 0, and the printable flags of the remaining pixel points are set to 1; Extracting printable marks from the carton image and integrating them to obtain a mask matrix; The mask matrix is multiplied pixel by pixel by the carton image to obtain the printing area of the carton image.
3. A corrugated box printing pattern matching detection method according to claim 1, It is characterized in that The printing pattern requirement data includes printing pattern requirement data of one printing pattern or a combination of multiple printing patterns.
4. A corrugated box printing pattern matching detection method according to claim 1, It is characterized in that The real-time acquisition of the carton image of the corrugated carton to be printed, and the concave recognition of the carton image to obtain the concave data include: Using a parallel light source to illuminate the corrugated paper box to be printed, to obtain the paper box image with shadow information; Using K-means algorithm to perform cluster analysis on the pixels of the carton image to obtain multiple classification clusters; Calculate the average gray value of each classification cluster, and select the classification cluster with the largest gray value difference from the preset comparison as the concave classification cluster; The depression position information and the depression shape information are obtained according to the distribution of pixels of the depression classification cluster in the carton image.
5. A corrugated box printing pattern matching detection system, It is characterized in that The system comprises: A data acquisition module, used to obtain a plurality of different printing pattern requirement data from a printing pattern database, wherein the printing pattern requirement data includes pattern position allowable range information, pattern shape information and pattern size allowable range information; A printing area screening module, used for real-time acquisition of a carton image of a corrugated carton to be printed, and for performing concave recognition on the carton image to obtain concave data, and for cutting the carton image based on the concave data to obtain a printing area; the concave data includes concave position information and concave shape information; a printing parameter calculation module, configured to select at least one target printing data from the printing pattern requirement data based on the printing area, and determine a target printing parameter according to the target printing data and the printing area; The printing parameter calculation module includes: A target printing data screening unit is used to screen out at least one printing data that meets the pattern position allowable range information from the printing pattern requirement data based on the printing area to obtain target printing data; a pattern area calculation unit, configured to sequentially calculate a maximum allowable pattern area corresponding to each printing data in the target printing data according to the pattern shape information, the pattern size allowable range information and the printing area; a target printing parameter determination unit, configured to determine the printing parameters corresponding to each of the maximum allowable pattern areas, and to use the printing parameters corresponding to the maximum allowable pattern area with the largest value as the target printing parameters, wherein the printing parameters include shape information, position information and size information of the printing pattern; The pattern printing module is used to print a pattern on a corrugated box based on the target printing parameters.
6. A corrugated box printing pattern matching detection system according to claim 5, It is characterized in that The printing area screening module comprises: A printable mark setting unit, configured to set the printable marks of the pixels in the concave area of the carton image to 0 based on the concave position information and the concave shape information, and set the printable marks of the remaining pixels to 1; A mask matrix setting unit, used for extracting printable marks from the carton image and integrating them to obtain a mask matrix; A printing area calculation unit is used to multiply the mask matrix by the carton image pixel by pixel to obtain the printing area of the carton image.
7. An electronic device, It is characterized in that include: A processor and a memory, wherein the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the corrugated box printing pattern matching detection method as described in any one of claims 1 to 4.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the corrugated box printing pattern matching detection method according to any one of claims 1 to 4.
