Surface printing defect detection method and device of manual cigarette case, terminal equipment and storage medium
By obtaining multiple shooting images and performing image fusion, combined with convolutional network feature extraction and comparison preset images, the problem of poor accuracy of traditional artificial testing is solved, and the accuracy and stability of handmade cigarette box printing defect detection is improved.
Patent Information
- Application Number
- CN202411909006.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional manual cigarette box printing quality inspection relies on manual visual inspection, which has the problem of poor accuracy.
By obtaining multiple shooting images of handmade cigarette cases, the image fusion is performed, and a preset convolutional network is used for feature extraction, and the preset shooting image is combined to determine whether there are defects.
The accuracy and stability of the surface printing defect detection of handmade cigarette cases was improved, and the misunderstanding rate was reduced.
Smart Images

Figure CN119359709A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method, device, terminal equipment and storage medium for detecting surface printing defects of a handmade cigarette box. Background Art
[0002] The inspection of printing quality of handmade cigarette boxes is an important part of the tobacco industry, which directly affects the appearance and use of handmade cigarette boxes. The traditional inspection method of printing quality of handmade cigarette boxes mainly relies on manual visual inspection, which has the disadvantages of poor accuracy. Summary of the invention
[0003] In view of this, the present application provides a surface printing defect detection method, device, terminal device and storage medium for handmade cigarette boxes, which can improve the accuracy of surface printing defect detection for handmade cigarette boxes. The surface printing defect detection method includes: Acquire a first captured image of the handmade cigarette box; Comparing the first captured image with the preset captured image to determine whether there is a defect, and generating a first determination result; Acquire a second captured image of the handmade cigarette box; Comparing the second captured image with the preset captured image to determine whether there is a defect, and generating a second determination result; Acquire a third shot image of the handmade cigarette box; comparing the third captured image with the preset captured image to determine whether there is a defect, and generating a third determination result; fusing the first captured image, the second captured image, and the third captured image to obtain a fused image; Comparing the fused image with the preset captured image to determine whether there is a defect, and generating a fourth determination result; When the fourth judgment result is that there is no defect, it is determined whether two or more judgment results among the first judgment result, the second judgment result and the third judgment result are that there is a defect. If so, it is determined that there is a defect in the surface printing of the handmade cigarette box.
[0004] In one embodiment, the surface printing defect detection method fuses the first captured image, the second captured image, and the third captured image to obtain the fused image, including: Normalizing the first captured image, the second captured image, and the third captured image respectively to obtain corresponding normalized captured image data; Using a preset convolutional network to perform feature extraction on normalized captured image data corresponding to the first captured image to obtain a first image feature value; Using a preset convolutional network to perform feature extraction on normalized captured image data corresponding to the second captured image to obtain a second image feature value; Using a preset convolutional network to perform feature extraction on normalized captured image data corresponding to the third captured image to obtain a third image feature value; The first image feature value, the second image feature value and the third image feature value are fused to obtain a fused image.
[0005] In one embodiment, the preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit. The preset convolution network is used to extract features from the normalized captured image data corresponding to the first captured image. The step of obtaining the first image feature value includes: Performing feature extraction on normalized captured image data corresponding to the first captured image by a pre-convolution processing unit to obtain a first intermediate image feature value; Performing a convolution operation on the first intermediate image eigenvalue and the Gaussian blur operator layer to obtain a first blurred image eigenvalue; The first blurred image feature value is input into a post-convolution processing unit for feature extraction to obtain a first image feature value.
[0006] In one embodiment, the preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit. The preset convolution network is used to perform feature extraction on the normalized captured image data corresponding to the second captured image, and the step of obtaining the second image feature value includes: Performing feature extraction on the normalized captured image data corresponding to the second captured image by a pre-convolution processing unit to obtain a second intermediate image feature value; Performing a convolution operation on the second intermediate image eigenvalue and the Gaussian blur operator layer to obtain a second blurred image eigenvalue; The second blurred image feature value is input into the post-convolution processing unit for feature extraction to obtain the second image feature value.
[0007] In one embodiment, the surface printing defect detection method further includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is a defect. If so, it is determined that there is a defect in the surface printing of the handmade cigarette box.
[0008] In one embodiment, when the fourth judgment result is that there is no defect, and there are no more than two judgment results of the first judgment result, the second judgment result and the third judgment result that there is a defect, it is judged that there is no defect in the surface printing of the handmade cigarette box. In one embodiment, the surface printing defect detection method also includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is that there is a defect. If not, it is determined that there is no defect in the surface printing of the handmade cigarette box.
[0009] In addition, a surface printing defect detection device for a handmade cigarette box is provided, comprising: A first image acquisition unit, used to acquire a first captured image of the handmade cigarette box; A first comparison generating unit, used for comparing the first captured image with a preset captured image to determine whether there is a defect, and generating a first determination result; A second image acquisition unit, used to acquire a second captured image of the handmade cigarette box; A second comparison unit, used for comparing the second captured image with the preset captured image to determine whether there is a defect, and generating a second determination result; A third image acquisition unit, used to acquire a third captured image of the handmade cigarette box; A third comparison unit, used for comparing the third captured image with the preset captured image to determine whether there is a defect, and generating a third determination result; An image fusion unit, used for fusing the first captured image, the second captured image and the third captured image to obtain a fused image; a fourth comparison unit, used to compare the fused image with a preset captured image to determine whether there is a defect, and generate a fourth determination result; When the fourth judgment result is that there is no defect, it is determined whether two or more judgment results among the first judgment result, the second judgment result and the third judgment result are that there is a defect. If so, it is determined that there is a defect in the surface printing of the handmade cigarette box.
[0010] In addition, a terminal device is also provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the surface printing defect detection method described above are implemented.
[0011] In addition, a storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the surface printing defect detection method as described above are implemented.
[0012] The above-mentioned surface printing defect detection method for handmade cigarette boxes can improve the accuracy of surface printing defect detection of images corresponding to handmade cigarette boxes by acquiring the first photographed image, the second photographed image and the third photographed image, generating a fused image, and comparing them with the preset photographed images respectively. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1A schematic diagram of a process for detecting surface printing defects of a handmade cigarette box provided in one embodiment of the present application; Figure 2 A schematic diagram of a method for obtaining a fused image provided in an embodiment of the present application; Figure 3 A schematic diagram of a method flow for obtaining a first image feature value provided in an embodiment of the present application; Figure 4 A schematic diagram of a method flow for obtaining a second image feature value provided in an embodiment of the present application; Figure 5 A structural block diagram of a surface printing defect detection device for a handmade cigarette box provided in one embodiment of the present application; Figure 6 This is a schematic block diagram of the internal structure of a terminal device according to an embodiment of the present application.
[0014] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0015] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0016] In addition, if the descriptions of "first", "second", etc. are involved in this application, they are only used for descriptive purposes (such as for distinguishing the same or similar elements), and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0017] In view of this, if Figure 1 As shown, the present application provides a method for detecting surface printing defects of a handmade cigarette box, and the surface printing defect detection method comprises: Step S110, obtaining a first captured image of the handmade cigarette box.
[0018] In this embodiment, various exquisite patterns are printed on the surface of the handmade cigarette box, and a first photographed image of the handmade cigarette box can be obtained by a high-speed camera.
[0019] Step S120 , comparing the first captured image with a preset captured image to determine whether there is a defect, and generating a first determination result.
[0020] Step S130, obtaining a second captured image of the handmade cigarette box.
[0021] Step S140, comparing the second captured image with the preset captured image to determine whether there is a defect, and generating a second determination result.
[0022] Step S150, obtaining a third photographed image of the handmade cigarette box.
[0023] Step S160 , comparing the third captured image with the preset captured image to determine whether there is a defect, and generating a third determination result.
[0024] Step S170: fusing the first captured image, the second captured image, and the third captured image to obtain a fused image.
[0025] Step S180, comparing the fused image with the preset captured image to determine whether there is a defect, and generating a fourth determination result.
[0026] Step S190, when the fourth judgment result is that there is no defect, proceed to step S200; Step S200, determining whether two or more of the first, second and third judgment results indicate that there are defects. If so, proceeding to step S210.
[0027] Step S210, determining whether there are defects in the surface printing of the handmade cigarette box.
[0028] In this embodiment, by acquiring the first photographed image, the second photographed image and the third photographed image, generating a fused image, and comparing them with the preset photographed images respectively, the accuracy and stability of the detection of printing defects on the image surface corresponding to the handmade cigarette box can be improved.
[0029] In one embodiment, Figure 2 As shown, step S170 includes: Step S171 , normalizing the first captured image, the second captured image, and the third captured image respectively to obtain corresponding normalized captured image data.
[0030] Step S172: Use a preset convolutional network to perform feature extraction on the normalized captured image data corresponding to the first captured image to obtain a first image feature value.
[0031] Step S173: Use a preset convolutional network to perform feature extraction on the normalized captured image data corresponding to the second captured image to obtain a second image feature value.
[0032] Step S174: Use a preset convolutional network to perform feature extraction on the normalized captured image data corresponding to the third captured image to obtain a third image feature value.
[0033] Step S175, fusing the first image feature value, the second image feature value and the third image feature value to obtain a fused image.
[0034] In one embodiment, Figure 3 As shown, the preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit, and step S172 includes: Step S172a: extract features from the normalized captured image data corresponding to the first captured image by a pre-convolution processing unit to obtain a first intermediate image feature value.
[0035] Step S172b, performing a convolution operation on the first intermediate image eigenvalue and the Gaussian blur operator layer to obtain a first blurred image eigenvalue.
[0036] Step S172c: input the first blurred image feature value to a post-convolution processing unit for feature extraction to obtain a first image feature value.
[0037] At present, batch normalization is usually used to normalize the image by the mean variance of the channel, and then CNN (convolutional neural network) is used to extract feature values, and the classification model is trained to obtain a feature extraction network model. However, for handmade cigarette boxes with various patterns, there may be pictures with similar outlines but different categories (for example, pictures with cruise ship patterns and pictures with building patterns), which are prone to misrecognition.
[0038] In this embodiment, by improving the misrecognition problem and strengthening the large receptive field feature, a network layer is added to the convolutional neural network using a Gaussian kernel as an operator. Here, when the CNN is downsampled to 64x64 pixels, a Gaussian blur operator layer is added to the network, and the Gaussian kernel is used as an operator to perform a convolution operation with the first intermediate image eigenvalue output by the pre-convolution processing unit to obtain a first blurred image eigenvalue, which is then input into the post-convolution processing unit for convolution, thereby obtaining an enhanced first target eigenvalue. The Gaussian blur operator layer can enhance the extraction of large receptive field features, thereby improving the overall classification and recognition accuracy and reducing the degree of misrecognition.
[0039] Among them, the Gaussian blur operator layer is implemented using the Gaussian blur formula.
[0040] In one embodiment, the preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit, such as Figure 4 As shown, step S173 includes: Step S173a, performing feature extraction on the normalized captured image data corresponding to the second captured image by a pre-convolution processing unit to obtain a second intermediate image feature value; Step S173b, performing a convolution operation on the second intermediate image eigenvalue and the Gaussian blur operator layer to obtain a second blurred image eigenvalue.
[0041] Step S173c, inputting the second blurred image feature value into the post-convolution processing unit for feature extraction to obtain the second image feature value.
[0042] In this embodiment, by improving the misrecognition problem and strengthening the large receptive field feature, a network layer is added to the convolutional neural network using a Gaussian kernel as an operator. Here, when the CNN is downsampled to 64x64 pixels, a Gaussian blur operator layer is added to the network, and the Gaussian kernel is used as an operator to perform a convolution operation with the second intermediate image eigenvalue output by the pre-convolution processing unit to obtain a second blurred image eigenvalue, which is then input into the post-convolution processing unit for convolution, thereby obtaining an enhanced second target eigenvalue. The Gaussian blur operator layer can enhance the extraction of large receptive field features, thereby improving the overall classification and recognition accuracy and reducing the degree of misrecognition.
[0043] In another embodiment, the processing of the third captured image in step S174 is also performed with reference to step S173, and the process is the same.
[0044] In one embodiment, the surface printing defect detection method further includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is that there is a defect. If so, the process proceeds to step S210.
[0045] In one embodiment, when the fourth judgment result is that there is no defect, and there are not more than two judgment results of the first judgment result, the second judgment result and the third judgment result that there is a defect, it is judged that there is no defect in the surface printing of the handmade cigarette box.
[0046] In one embodiment, the surface printing defect detection method further includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is that there is a defect. If not, it is determined that there is no defect in the surface printing of the handmade cigarette box.
[0047] In addition, if Figure 5As shown, a surface printing defect detection device 300 for a handmade cigarette box is also provided, comprising: A first image acquisition unit 310, used to acquire a first captured image of the handmade cigarette box; A first comparison generating unit 320, configured to compare the first captured image with a preset captured image to determine whether a defect exists, and to generate a first determination result; A second image acquisition unit 330, used to acquire a second captured image of the handmade cigarette box; A second comparison unit 340 is used to compare the second captured image with the preset captured image to determine whether there is a defect, and generate a second determination result; A third image acquisition unit 350, used to acquire a third captured image of the handmade cigarette box; A third comparison unit 360, used to compare the third captured image with the preset captured image to determine whether there is a defect, and generate a third determination result; An image fusion unit 370, configured to fuse the first captured image, the second captured image, and the third captured image to obtain a fused image; The fourth comparison unit 380 is used to compare the fused image with the preset captured image to determine whether there is a defect, and generate a fourth determination result; The defect judgment unit 390 is used to judge whether two or more judgment results among the first judgment result, the second judgment result and the third judgment result are defective when the fourth judgment result is that there is no defect. If so, it is judged that there is a defect in the surface printing of the handmade cigarette box.
[0048] In addition, a terminal device is also provided in an embodiment of the present application. The internal structure of the terminal device can be as follows: Figure 6 As shown. The terminal device includes a processor, a memory, a communication interface and a database connected via a system bus. The processor is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the terminal device is used to store data called by the computer program. The communication interface of the terminal device is used to communicate data with an external terminal. The input device of the terminal device is used to receive a signal input by an external device. When the computer program is executed by the processor, a surface printing defect detection method as described in the above embodiment is implemented.
[0049] Those skilled in the art will understand that Figure 6 The structure shown in is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the terminal device to which the solution of the present application is applied.
[0050] In addition, the present application also proposes a storage medium, the storage medium includes a computer program, and when the computer program is executed by a processor, the steps of the surface printing defect detection method described in the above embodiment are implemented. It can be understood that the storage medium in this embodiment can be a volatile storage medium or a non-volatile storage medium.
[0051] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0052] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0053] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for detecting surface printing defects of handmade cigarette boxes, characterized in that: include: Acquire a first captured image of the handmade cigarette box; Comparing the first captured image with a preset captured image to determine whether there is a defect, and generating a first determination result; Acquire a second captured image of the handmade cigarette box; Comparing the second captured image with a preset captured image to determine whether there is a defect, and generating a second determination result; Acquire a third shot image of the handmade cigarette box; Comparing the third captured image with the preset captured image to determine whether there is a defect, and generating a third determination result; fusing the first captured image, the second captured image, and the third captured image to obtain a fused image; Comparing the fused image with the preset captured image to determine whether there is a defect, and generating a fourth determination result; When the fourth judgment result is that there is no defect, it is determined whether two or more of the first judgment result, the second judgment result and the third judgment result are defective. If so, it is determined that there is a defect in the surface printing of the handmade cigarette box.
2. The surface printing defect detection method according to claim 1, characterized in that: The step of fusing the first captured image, the second captured image and the third captured image to obtain a fused image comprises: Normalizing the first captured image, the second captured image, and the third captured image respectively to obtain corresponding normalized captured image data; Using a preset convolutional network to perform feature extraction on normalized captured image data corresponding to the first captured image to obtain a first image feature value; Using the preset convolutional network to perform feature extraction on the normalized captured image data corresponding to the second captured image to obtain a second image feature value; Using the preset convolutional network to perform feature extraction on the normalized captured image data corresponding to the third captured image to obtain a third image feature value; The first image feature value, the second image feature value and the third image feature value are fused to obtain a fused image.
3. The surface printing defect detection method according to claim 2, characterized in that: The preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit. The step of extracting features from the normalized captured image data corresponding to the first captured image using the preset convolution network to obtain a first image feature value includes: Performing feature extraction on the normalized captured image data corresponding to the first captured image by the pre-convolution processing unit to obtain a first intermediate image feature value; Performing a convolution operation on the first intermediate image feature value and the Gaussian blur operator layer to obtain a first blurred image feature value; The first blurred image feature value is input into the post-convolution processing unit for feature extraction to obtain a first image feature value.
4. The surface printing defect detection method according to claim 2, characterized in that: The preset convolution network includes a pre-convolution processing unit, a Gaussian blur operator layer and a post-convolution processing unit. The preset convolution network is used to extract features from the normalized captured image data corresponding to the second captured image, and the step of obtaining the second image feature value includes: Performing feature extraction on the normalized captured image data corresponding to the second captured image by the pre-convolution processing unit to obtain a second intermediate image feature value; Performing a convolution operation on the second intermediate image eigenvalue and the Gaussian blur operator layer to obtain a second blurred image eigenvalue; The second blurred image feature value is input into the post-convolution processing unit for feature extraction to obtain a second image feature value.
5. The surface printing defect detection method according to claim 1, characterized in that: Also includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is that there is a defect. If so, it is determined that there is a defect in the surface printing of the handmade cigarette box.
6. The surface printing defect detection method according to claim 1, characterized in that: When the fourth judgment result is that there is no defect, and no more than two of the first judgment result, the second judgment result and the third judgment result are that there is a defect, it is judged that there is no defect in the surface printing of the handmade cigarette box.
7. The surface printing defect detection method according to claim 5, characterized in that: Also includes: When the fourth judgment result is that there is a defect, it is determined whether at least one of the first judgment result, the second judgment result and the third judgment result is that there is a defect. If not, it is determined that there is no defect in the surface printing of the handmade cigarette box.
8. A device for detecting surface printing defects of handmade cigarette boxes, characterized in that: include: A first image acquisition unit, used to acquire a first captured image of the handmade cigarette box; A first comparison generating unit, used for comparing the first captured image with a preset captured image to determine whether there is a defect, and generating a first determination result; A second image acquisition unit, used to acquire a second captured image of the handmade cigarette box; A second comparison unit, used for comparing the second captured image with a preset captured image to determine whether there is a defect, and generating a second determination result; A third image acquisition unit, used to acquire a third captured image of the handmade cigarette box; A third comparison unit, used for comparing the third captured image with a preset captured image to determine whether there is a defect, and generating a third determination result; an image fusion unit, configured to fuse the first captured image, the second captured image, and the third captured image to obtain a fused image; a fourth comparison unit, configured to compare the fused image with the preset captured image to determine whether a defect exists, and generate a fourth determination result; The defect judgment unit is used to judge whether two or more of the first judgment result, the second judgment result and the third judgment result are defective when the fourth judgment result is that there is no defect, and if so, judge that there is a defect in the surface printing of the handmade cigarette box.
9. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the surface printing defect detection method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the surface printing defect detection method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Packaging bag printing quality detection method and detection system based on image transmission
CN117723564A