Cigarette packet debugging method, electronic equipment and storage medium
By obtaining the cigarette pack image and order information, using the YOLOv8 model to identify the specifications and quantity of cigarettes, establishing a dictionary for comparison, it solves the problem of wrong cigarette packing caused by poor robustness in the existing technology, and realizes the cigarette pack Efficient and accurate error checks and improves production line efficiency.
Patent Information
- Application Number
- CN202411051822.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-12-06
AI Technical Summary
The existing cigarette pack packaging methods are poorly robust, causing some cigarettes to fall into the gap of the packaging machine, causing the packaged cigarette pack to be inconsistent with the order information, resulting in the problem of wrong cigarettes, and it is difficult to check the error in time and accurately after the wrong cigarettes, which affects production efficiency. and customer satisfaction.
By obtaining cigarette pack image and order information, using the YOLOv8 model to extract the end face information of the cigarette, identify the specifications and quantity of cigarettes, establish a dictionary for comparison, determine the error check results, and display the error check results on the upper computer interface to achieve automation The cigarette pack is wrong.
It realizes efficient and accurate cigarette pack error checking, ensures that the cigarette pack information on the sorting and packaging line is consistent with the order information, avoids missed cigarettes, reduces labor costs, improves production line efficiency, and provides intuitive display of error check results.
Smart Images

Figure CN119091364A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of tobacco logistics, and in particular to a cigarette package error checking method, electronic equipment and storage medium. Background Art
[0002] Tobacco products are in great demand around the world, so an effective and accurate logistics system is crucial to the tobacco industry. The existing cigarette packing method is that the cigarette cartons enter the packing machine through the sorting line. The packing machine packs the cigarette cartons of the same order into a cigarette pack according to the order information, and finally transports the cigarette pack to the corresponding store address. However, due to the poor robustness of the common packing machines on the market, some cigarette cartons may fall into the gap of the packing machine, resulting in the packaged cigarette pack not matching the order information.
[0003] When a cigarette pack is misplaced, all subsequent cigarette packs will also be misplaced. When the palletizer finds the misplaced cigarettes, there are often dozens of misplaced cigarette packs. At this time, all the misplaced cigarette packs need to be found from the cage car or pallet, unpacked, and then sent to the packaging machine for repacking, which is time-consuming and laborious. In fact, some misplaced cigarette packs are never discovered by the workers until the customer reports that the cigarette pack they received is different from their order. At this time, other misplaced cigarette packs are even more difficult to trace. It can be seen that if the packaged cigarette packs cannot be checked for errors in a timely and accurate manner, it will lead to more serious consequences.
[0004] In view of this, how to timely and accurately realize cigarette package error detection has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present invention provide a cigarette packet error checking method, electronic equipment and storage medium.
[0006] In a first aspect, an embodiment of the present invention provides a cigarette packet error checking method, comprising:
[0007] Obtain cigarette package images and order information;
[0008] Obtaining a cigarette carton recognition result according to the cigarette pack image;
[0009] The error checking result is determined according to the cigarette carton recognition result and the order information.
[0010] In a possible implementation, the step of obtaining the cigarette package image and order information includes:
[0011] Obtain cigarette package images and order information through socket communication.
[0012] In a possible implementation, obtaining a cigarette carton recognition result according to the cigarette package image includes:
[0013] Extracting first target information of the cigarette pack image, wherein the first target information includes end surface information of a cigarette in the cigarette pack image;
[0014] A cigarette carton recognition result is obtained based on the end face information.
[0015] In a possible implementation, obtaining a cigarette carton recognition result according to the end face information includes:
[0016] According to the end face information, the YOLOv8 model is used to obtain the cigarette carton recognition result.
[0017] In a possible implementation, the cigarette carton recognition result includes second target information, where the second target information is the specifications of each cigarette carton in the end face information and the quantity of cigarette carton of each specification;
[0018] The step of determining the error checking result according to the cigarette carton recognition result and the order information includes:
[0019] Establishing a dictionary find according to the second target information, and establishing a dictionary order according to the order information;
[0020] The error checking result is determined according to the second target information in the dictionary find and the third target information in the dictionary order, wherein the third target information is the specifications of each cigarette carton ordered by the customer and the quantity corresponding to each cigarette carton of the ordered specifications.
[0021] In a possible implementation, determining the error checking result according to the second target information in the dictionary find and the third target information in the dictionary order includes:
[0022] If one of the specifications in the dictionary find does not exist in the dictionary order, first indication information is determined, and the first indication information is used to indicate that the specification is wrong; if it exists, then continue to verify whether the quantity corresponding to the cigarette cartons of the specification in the dictionary find is consistent with the quantity corresponding to the cigarette cartons of the specification in the dictionary order, if not, then determine second indication information, and the second indication information is used to indicate that the quantity is wrong; if they are consistent, then check whether the next specification in the dictionary find is in the dictionary order, and so on, until each specification in the dictionary find and the quantity corresponding to each specification are checked to see if they are consistent with each specification in the dictionary order and the quantity corresponding to each specification;
[0023] determining the error checking result according to the first indication information and / or the second indication information; or,
[0024] If the first indication information and the second indication information are not present, it is determined that the error checking result is that the cigarette package is normal.
[0025] In a possible implementation, the error checking result is displayed on a host computer interface.
[0026] In a possible implementation, the functions on the host computer interface include:
[0027] The cigarette carton recognition result display, error checking result display, program running status display, "Start Recognition" button, "Stop Recognition" button, "Start Saving" button, "Stop Saving" button and / or "Advanced Settings" button.
[0028] In a second aspect, an embodiment of the present invention provides an electronic device, including:
[0029] A memory and a processor, wherein the processor and the memory communicate with each other via a bus; the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method described in the first aspect and each step in various possible implementations.
[0030] In a third aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect and each step in various possible implementations.
[0031] The embodiments of the present invention disclose the following technical effects:
[0032] 1) By comparing the second target information in the dictionary find and the third target information in the dictionary order, the error checking result is determined, and the error checking is automatically identified efficiently and accurately to ensure that the second target information of the cigarette packs on the sorting and packaging line is completely consistent with the order information to avoid wrong cigarettes.
[0033] 2) It can replace the assembly line workers who check the second target information, reduce labor costs and improve the efficiency of the production line.
[0034] 3) The error checking results are displayed on the host computer interface, and users can view the error checking results intuitively.
[0035] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A system architecture diagram applicable to the embodiment of the present invention;
[0038] Figure 2 A schematic flow chart of a cigarette packet error checking method provided by an embodiment of the present invention;
[0039] Figure 3a A schematic diagram of a color camera 1 and a color camera 2 provided in an embodiment of the present invention photographing a cigarette pack;
[0040] Figure 3b A schematic diagram of the color camera 1 and the color camera 2 provided in the embodiment of the present invention photographing another cigarette pack;
[0041] Figure 4 A schematic diagram of the end surface of a cigarette rod provided by an embodiment of the present invention;
[0042] Figure 5 A flowchart of a specific process of checking cigarette packet errors provided by an embodiment of the present invention;
[0043] Figure 6 A functional schematic diagram of a host computer interface provided by an embodiment of the present invention;
[0044] Figure 7 A flow chart of another cigarette packet error checking method provided by an embodiment of the present invention;
[0045] Figure 8 A schematic block diagram of a cigarette packet error checking device provided by an embodiment of the present invention;
[0046] Fig. 9 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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.
[0048] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0049] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0050] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if determining" or "if monitoring (stated condition or event)" may be interpreted as "when determining" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0051] The existing cigarette packing method is that the cigarettes are sent to the packing machine through the sorting line. The packing machine packs the cigarettes of the same order into a cigarette pack according to the order information, and finally transports the cigarette pack to the corresponding store address. However, once the wrong cigarettes are in the cigarette pack, the subsequent cigarette packs will also be wrong.
[0052] In one possible implementation, workers are required to check the specifications and quantity of cigarette cartons when stacking cigarette packs. However, due to the fast pace of cigarette packs on the packaging line, there is not enough time to check whether the specifications and quantity of cigarette cartons in the cigarette packs are consistent with the order information when stacking cigarette packs into cages or pallets.
[0053] In view of this, the embodiment of the present invention provides a new idea. In order to facilitate the understanding of the present application, the system architecture based on the embodiment of the present invention is first described. Figure 1 An exemplary system architecture to which the present invention can be applied is shown. Figure 1 As shown in , the system architecture may include a terminal device and a cigarette package error checking device located at the server end.
[0054] The terminal devices may include, but are not limited to, smart mobile terminals, smart home devices, wearable devices, PCs (Personal Computers), etc. Smart mobile terminals may include mobile phones, tablet computers, laptop computers, PDAs (Personal Digital Assistants), Internet cars, etc. Smart home devices may include smart TVs, smart refrigerators, etc. Wearable devices may include smart watches, smart glasses, virtual reality devices, augmented reality devices, mixed reality devices (i.e., devices that can support virtual reality and augmented reality), etc.
[0055] The cigarette package error checking device can use the cigarette package error checking method provided in the embodiment of the present invention to check the cigarette package errors.
[0056] The cigarette packet error checking device can be set on a single server, a server group consisting of multiple servers, or a cloud server. A cloud server, also known as a cloud computing server or cloud host, is a host product in the cloud computing service system to solve the problems of difficult management and weak service scalability in traditional physical hosts and virtual private servers (VPS). Figure 1 In addition to the shown architecture, the cigarette package error checking device can also be set on a computer terminal with strong computing power.
[0057] Figure 2 A flowchart of a cigarette packet error checking method provided by an embodiment of the present invention, the method can be performed by Figure 1 The cigarette packet error checking device in the system shown in the figure is executed. Figure 2 As shown in , the method may include the following steps:
[0058] Step 201: Obtain cigarette package images and order information.
[0059] Step 202: Obtain cigarette carton recognition results based on the cigarette package image.
[0060] Step 203: Determine the error checking result based on the cigarette carton recognition result and the order information.
[0061] The following describes in detail each step in the above process and the effects that can be further produced in conjunction with the embodiments of the present invention. It should be noted that the limitations such as "first" and "second" involved in the embodiments of the present invention do not have limitations in terms of size, order, and quantity, and are only used to distinguish them in name, for example, "first indication information" and "second indication information" are used to distinguish two different indication information.
[0062] First, the above step 201, namely “obtaining cigarette package images and order information” is described in detail in conjunction with the embodiment of the present invention.
[0063] In the embodiment of the present invention, an image acquisition device is used to acquire the cigarette package image.
[0064] As a possible implementation, the image acquisition device may be a color camera with adjustable focal length. It is understandable that, in order to obtain a more complete cigarette package image, two color cameras with adjustable focal lengths are used to acquire cigarette package images at two angles.
[0065] As a possible implementation, a color camera 1 at one angle captures an image of one side of a cigarette package to obtain a first cigarette package image. Its shooting angle is as perpendicular to one side of the cigarette package as possible without affecting the transportation of the cigarette package by the conveyor belt. A color camera 2 at another angle captures an image of another side of the cigarette package to obtain a second cigarette package image. Its shooting angle is perpendicular to the other side of the cigarette package. Among them, one side of the cigarette package is connected to the other side.
[0066] In the embodiment of the present invention, as a possible implementation, the standard-sized cigarette cartons and the thin-medium-sized cigarette cartons are as follows: Figure 3a Placed as shown. A color camera 1 at one angle captures an image of one side of the cigarette package (the side includes the end face of a standard-sized cigarette rod) to obtain a first cigarette package image. Its shooting angle is as perpendicular to the one side of the photographed cigarette package as possible without affecting the transportation of the cigarette package by the conveyor belt. A color camera 2 at another angle captures an image of the other side of the cigarette package (the side includes the end face of a thin medium-sized cigarette rod) to obtain a second cigarette package image. Its shooting angle is perpendicular to the other side of the cigarette package. At this time, the cigarette package image includes the first cigarette package image and the second cigarette package image. It can also be understood that in order to obtain higher quality cigarette package images, polarizing plates can be placed in front of the lenses of two color cameras with adjustable focal lengths to reduce the influence of the reflection of the packaging film on the surface of the cigarette rod on the shooting quality of the color camera.
[0067] In the embodiment of the present invention, as another possible implementation, all cigarette cartons are standard-sized cigarette cartons, and all standard-sized cigarette cartons are as follows: Figure 3b Placed as shown. At this time, the color camera 1 at one angle captures an image of one side of the cigarette package (this side includes the end faces of all standard-sized cigarette cartons) to obtain a first cigarette package image. Its shooting angle is as perpendicular to the one side of the photographed cigarette package as possible without affecting the transportation of the cigarette package by the conveyor belt. The color camera 2 at another angle captures an image of the other side of the cigarette package (this side does not include the end faces of any standard-sized cigarette cartons) to obtain a second cigarette package image. At this time, the cigarette package image includes the first cigarette package image and the second cigarette package image. Similarly, in order to obtain higher quality cigarette package images, polarizing plates can be placed in front of the lens of the color camera to reduce the influence of the reflection of the packaging film on the surface of the cigarette cartons on the shooting quality of the color camera.
[0068] As a possible implementation method, after the image acquisition device acquires the cigarette package image, it encodes the cigarette package image into jpg format, further converts it into a byte string, obtains the first byte object, and sends it to the cigarette package error checking device. Then, the order information is encoded into a byte string in the form of UTF-8, obtains the second byte object, and sends it to the cigarette package error checking device. After the cigarette package error checking device obtains the first byte object and the second byte object, it decodes them in turn to obtain the cigarette package image and the order information.
[0069] As a possible implementation method, the first byte object and / or the second byte object are sent to the cigarette package error checking device via socket communication. After the cigarette package error checking device obtains the first byte object and the second byte object via socket communication, it decodes them in turn to obtain the cigarette package image and order information.
[0070] The above step 202, namely "obtaining a cigarette carton recognition result based on the cigarette pack image", is described in detail below in conjunction with an embodiment of the present invention.
[0071] In an embodiment of the present invention, first target information of a cigarette pack image is extracted. The first target information includes end face information of a cigarette in the cigarette pack image. The end face information is the specification of each cigarette in the cigarette pack image. Figure 4 As shown, the end face is the smallest face of the cigarette strip.
[0072] As a possible implementation method, if Figure 3a As shown, a color camera 1 at one angle captures an image of one side of a cigarette pack (the side includes the end face of a standard-sized cigarette rod) to obtain a first cigarette pack image. A color camera 2 at another angle captures an image of another side of a cigarette pack (the side includes the end face of a thin-medium-sized cigarette rod) to obtain a second cigarette pack image. At this time, the first target information of the first cigarette pack image and the first target information of the second cigarette pack image are extracted through the YOLOv8 model, that is, the first end face information of the standard-sized cigarette rod and the second end face information of the thin-medium-sized cigarette rod are extracted. The end face information includes the first end face information of the standard-sized cigarette rod and the second end face information of the thin-medium-sized cigarette rod. The first end face information is the specification of each standard-sized cigarette rod in the first cigarette pack image. The second end face information is the specification of each thin-medium-sized cigarette rod in the second cigarette pack image.
[0073] As a possible implementation method, if Figure 3b As shown, a color camera 1 at one angle captures an image of one side of a cigarette package (the side includes the end faces of all standard-sized cigarettes) to obtain a first cigarette package image, and a color camera 2 at another angle captures an image of another side of the cigarette package (the side does not include the end faces of any standard-sized cigarettes) to obtain a second cigarette package image. The first target information of the first cigarette package image and the first target information of the second cigarette package image are extracted through the YOLOv8 model. Since the second cigarette package image does not include the end faces of any standard-sized cigarettes, only the first end face information of all standard-sized cigarettes is extracted through the YOLOv8 model. At this time, the end face information only includes the first end face information, and there is no second end face information.
[0074] In the embodiment of the present invention, the cigarette carton recognition result is obtained based on the end face information.
[0075] As a possible implementation, a first recognition result is obtained according to the first end face information, a second recognition result is obtained according to the second end face information, and a cigarette carton recognition result is determined according to the first recognition result and the second recognition result.
[0076] As a possible implementation method, count the first number of cigarette cartons of each specification in the first end face information; determine the first recognition result based on the first number and the specification of each cigarette cartons in the first end face information. Count the second number of cigarette cartons of each specification in the second end face information; determine the second recognition result based on the second number and the specification of each cigarette cartons in the second end face information. Determine the cigarette cartons recognition result based on the first recognition result and the second recognition result. The cigarette cartons recognition result includes second target information. The second target information is the specification of each cigarette cartons in the end face information and the corresponding quantity of cigarette cartons of each specification, that is, the specification of each cigarette cartons and the first quantity of cigarette cartons of each specification in the first end face information and the specification of each cigarette cartons and the second quantity of cigarette cartons of each specification in the second end face information.
[0077] As a possible implementation method, the YOLOv8 model is used to obtain the cigarette recognition result according to the end face information. It should be noted that the YOLOv8 model is a relatively mature and widely used deep learning method. Its network structure consists of three parts: Backbone, Neck, and Head. Among them, the Backbone part is responsible for feature extraction for the cigarette package image to obtain the first feature. The Neck part is responsible for multi-scale feature fusion for the first feature to obtain the second feature. The Head part consists of a detection head and a classification head, which is responsible for the final target detection and classification task for the second feature. The detection head is responsible for predicting the bounding box regression value of each anchor frame (i.e., segmenting the end face of the cigarette to obtain the position of each cigarette end face in the cigarette package) and the confidence of the target (i.e., the end face of the cigarette in the embodiment of the present invention), and the classification head is responsible for outputting the probability distribution of the category to which each target belongs. The characteristic of YOLOv8 is that it adopts a lightweight network structure, and can accurately and quickly realize target detection and classification through the cascade pyramid structure of the Neck part and the dual path prediction of the Head part. It should also be noted that before using the YOLOv8 model, a large number of labeled training samples are needed (when labeling the cigarette pack image, only the end face (i.e., the smallest face of the cigarette strip) is labeled) to train the YOLOv8 model. The specific training steps are: divide the labeled training samples into training set, test set, and validation set in a ratio of 7:2:1. Further, edit the configuration file as required, select the relatively lightweight YOLOv8s model, and input the training samples in the training set into the model for training. During the training process, the model will continuously optimize the parameters according to the loss function to improve the accuracy of target detection. After the training is completed, the validation set is used to evaluate the trained model, and the performance of the model is evaluated by calculating indicators such as accuracy and recall rate. When the model performance reaches the optimal level, the trained weight file is implanted into the upper computer interface so that the cigarette pack error checking device can directly call the trained model, thereby realizing the segmentation of the cigarette strip end face and the identification of the cigarette strip specifications.
[0078] The above step 203, namely "determining the error checking result according to the cigarette carton recognition result and the order information", is described in detail below in conjunction with an embodiment of the present invention.
[0079] In an embodiment of the present invention, as a possible implementation method, a dictionary find can be established based on the second target information to store the identified specifications of cigarette cartons and the corresponding quantity of cigarette cartons of each specification. A dictionary order is established based on the order information, and the third target information in the order information is extracted. The third target information is the specifications of each cigarette carton reserved by the customer and the corresponding quantity of each predetermined specification of cigarette cartons. The third target information is stored in the dictionary order. According to the second target information in the dictionary find and the third target information in the dictionary order, the error checking result is determined. Specifically, if one of the specifications in the dictionary find does not exist in the dictionary order, the first indication information is determined. The first indication information is used to indicate a specification error; if it exists, it is continued to verify whether the quantity of cigarette cartons of the specification in the dictionary find is consistent with the quantity of cigarette cartons of the specification in the dictionary order. If not, the second indication information is determined. The second indication information is used to indicate a quantity error. If they match, check whether the next specification in the dictionary find exists in the dictionary order, and so on, until each specification and the quantity corresponding to each specification in the dictionary find are checked to see if they match each specification and the quantity corresponding to each specification in the dictionary order; determine the error checking result based on the first indication information and / or the second indication information; or, if there is no first indication information and the second indication information, determine that the error checking result is that the cigarette package is normal. After the error checking of the current cigarette package is completed, the dictionary find and the dictionary order are cleared for comparison with the next cigarette package.
[0080] In one example, Figure 5 The detailed process of checking cigarette pack errors is shown in Figure 1. Figure 5 First, a dictionary find is established according to the second target information, find = {'Specification 1': 'Quantity 1', 'Specification 2': 'Quantity 2', ..., 'Specification N': 'Quantity N'}, and a dictionary order is established according to the order information, order = {'Specification a': 'Quantity a', 'Specification b': 'Quantity b', ... 'Specification n': 'Quantity n'}. Then, in the first step, when i = 1, it is determined whether there is specification i in the order. If not, it is determined that the specification is wrong; in the second step, if there is, it is determined whether the quantity i is equal to the quantity corresponding to specification i in the order; if not, it is determined that the quantity is wrong; in the third step, if it is equal, it is determined whether i is less than N; if i is greater than or equal to N, it is determined that the cigarette package is normal. If i is less than N, i is automatically increased by 1, and the first, second and third steps are repeated until i is greater than or equal to N.
[0081] As a possible implementation method, the error checking results are displayed on the host computer interface. Among them, the functions on the host computer interface are as follows Figure 6As shown, it includes: cigarette recognition result display, error checking result display, program running status display, "Start Recognition" button, "Stop Recognition" button, "Start Saving" button, "Stop Saving" button and / or "Advanced Settings" button.
[0082] It can be understood that by clicking the "Start Recognition" button, the cigarette pack error checking device in the embodiment of the present invention opens the socket communication port, starts receiving data (i.e., cigarette pack images and order information) for transmission, and displays the cigarette strip recognition results in the upper computer interface, and the error checking results are displayed on the right side of the upper computer interface. Click the "Stop Recognition" button, the system closes the socket communication port, stops receiving the sent cigarette pack images and order information, and the upper computer interface displays the last received cigarette pack image and its error checking results. Click the "Start Saving" button to turn on the save function. For each subsequent cigarette pack, save its original image, error checking result image, two jpg files, and order information, first target information, and error checking result three txt files; click the "Stop Saving" button to turn off the save function; click the "Advanced Settings" button to select any YOLOv8 model weight file in the local path, and at the same time, you can also select the confidence of the YOLOv8 model when identifying cigarette packs.
[0083] As can be seen from the above content, the embodiment of the present invention compares the second target information in the dictionary find and the third target information in the dictionary order to determine the error checking result, automatically identify the error checking efficiently and accurately, ensure that the second target information of the cigarette packs on the sorting and packaging line is completely consistent with the order information, avoid the wrong cigarettes, and at the same time, replace the assembly line workers who check the second target information, reduce labor costs, and improve the efficiency of the production line. In addition, the error checking results are displayed on the upper computer interface, and the user can intuitively view the error checking results.
[0084] Based on the same concept as the above method embodiment, the embodiment of the present invention also provides a cigarette package error detection method. Figure 7 The flowchart of the cigarette pack error checking method is shown. Figure 7 , the flowchart includes:
[0085] Step 701: an image acquisition device acquires a cigarette package image.
[0086] In the embodiment of the present invention, the image acquisition device may be a color camera with adjustable focal length. It is understandable that in order to obtain a more complete cigarette package image, two color cameras with adjustable focal lengths are used to acquire cigarette package images at two angles. The shooting angles of the two color cameras are shown in FIG3 , and the specific contents thereof are described in the aforementioned method embodiment, which will not be repeated here.
[0087] Step 702: The cigarette package error checking device obtains the cigarette package image and order information through socket communication.
[0088] Step 703: the cigarette pack error checking device obtains a cigarette carton recognition result based on the cigarette pack image. The cigarette carton recognition result includes the specifications of each cigarette carton and the quantity of cigarette carton of each specification.
[0089] In an embodiment of the present invention, the cigarette pack error checking device extracts the first target information of the cigarette pack image. The first target information includes the end face information of the cigarette carton in the cigarette pack image. The end face information is the specification of each cigarette carton in the cigarette pack image. The cigarette pack error checking device obtains the cigarette carton recognition result based on the end face information. Specifically, the number of cigarette carton of each specification in the end face information is counted; based on the number and the specification of each cigarette carton, the cigarette carton recognition result is determined. The cigarette carton recognition result includes the specification of each cigarette carton and the number of cigarette carton of each specification.
[0090] Step 704: the cigarette pack error checking device extracts the specifications of each cigarette carton ordered by the customer and the quantity of each cigarette carton of each specification ordered in the order information.
[0091] Step 705, compare the specifications of each cigarette carton and the quantity of each cigarette carton with the specifications of each cigarette carton and the quantity of each cigarette carton reserved by the customer in the order information to obtain an error checking result.
[0092] In the embodiment of the present invention, the specific process of step 705 refers to step 203 and will not be repeated here.
[0093] Step 706: The host computer interface displays the error checking result.
[0094] Based on the same concept as the above method embodiment, an embodiment of the present invention further provides a cigarette package error checking device. Figure 8 A schematic block diagram of the cigarette packet error checking device is shown. The device can be arranged at Figure 1 The server side of the architecture shown in Figure 1. Figure 8 As shown, the device 800 may include: an acquisition unit 801, an obtaining unit 802, and a determination unit 803. The main functions of each component unit are as follows:
[0095] The acquisition unit 801 is used to acquire cigarette package images and order information.
[0096] The obtaining unit 802 is used to obtain the cigarette carton recognition result according to the cigarette pack image.
[0097] The determination unit 803 is used to determine the error checking result according to the cigarette carton recognition result and the order information.
[0098] As an achievable method, the acquisition unit 801 is specifically used to acquire the cigarette package image and order information through socket communication.
[0099] As an achievable method, the obtaining unit 802 is specifically used to extract the first target information of the cigarette pack image. The first target information includes the end face information of the cigarette carton in the cigarette pack image. According to the end face information, the cigarette carton recognition result is obtained.
[0100] As an achievable method, the obtaining unit 802 is specifically used to obtain the cigarette carton recognition result using the YOLOv8 model according to the end face information.
[0101] As a feasible method, the cigarette carton recognition result includes the second target information. The second target information is the specifications of each cigarette carton in the end face information and the quantity of each cigarette carton of each specification.
[0102] The determination unit 803 is specifically used to establish a dictionary find according to the second target information, and to establish a dictionary order according to the order information. The error checking result is determined according to the second target information in the dictionary find and the third target information in the dictionary order. The third target information is the specifications of each cigarette carton ordered by the customer and the quantity corresponding to each cigarette carton of the predetermined specifications.
[0103] As a method that can be implemented, the determination unit 803 is specifically used to determine the first indication information if one of the specifications in the dictionary find does not exist in the dictionary order. The first indication information is used to indicate that the specification is wrong; if it exists, continue to verify whether the quantity corresponding to the cigarette cartons of the specification in the dictionary find is consistent with the quantity corresponding to the cigarette cartons of the specification in the dictionary order. If they do not match, determine the second indication information. The second indication information is used to indicate that the quantity is wrong; if they match, check whether the next specification in the dictionary find exists in the dictionary order, and so on, until each specification in the dictionary find and the quantity corresponding to each specification are checked to be consistent with each specification in the dictionary order and the quantity corresponding to each specification. Determine the error checking result based on the first indication information and / or the second indication information. Alternatively, if there is no first indication information and the second indication information, determine that the error checking result is that the cigarette package is normal.
[0104] As a possible implementation, the device further includes a display unit. The display unit is used to display the error checking result on the upper computer interface. The functions on the upper computer interface include: cigarette identification result display, error checking result display, program running status display, "start identification" button, "stop identification" button, "start saving" button, "stop saving" button and / or "advanced settings" button.
[0105] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0106] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of any one of the methods in the aforementioned method embodiments are implemented.
[0107] And an electronic device, comprising:
[0108] one or more processors; and
[0109] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the aforementioned method embodiments.
[0110] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of any one of the methods in the aforementioned method embodiments when executed by a processor.
[0111] in, Fig. 9 The architecture of the electronic device is exemplarily shown, which may specifically include a processor 910, a video display adapter 911, a disk drive 912, an input / output interface 913, a network interface 914, and a memory 920. The processor 910, the video display adapter 911, the disk drive 912, the input / output interface 913, the network interface 914, and the memory 920 may be communicatively connected via a communication bus 930.
[0112] Among them, the processor 910 can be implemented by a general CPU, a microprocessor, an application-specific integrated circuit (ASIC), a GPU (Graphics Processing Unit) or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided by the embodiment of the present invention.
[0113] The memory 920 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 920 can store an operating system 921 for controlling the operation of the electronic device 900, and a basic input and output system (BIOS) 922 for controlling the low-level operation of the electronic device 900. In addition, a web browser 923, a data storage management system 924, and a cigarette package error checking device 925, etc. can also be stored. The above-mentioned cigarette package error checking device 925 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present invention. In short, when the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 920 and is called and executed by the processor 910.
[0114] The input / output interface 913 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0115] The network interface 914 is used to connect to a communication module (not shown) to achieve communication interaction between the device and other devices. The communication module can achieve communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0116] The bus 930 comprises a pathway for transmitting information between the various components of the device (eg, the processor 910, the video display adapter 911, the disk drive 912, the input / output interface 913, the network interface 914, and the memory 920).
[0117] It should be noted that, although the above device only shows a processor 910, a video display adapter 911, a disk drive 912, an input / output interface 913, a network interface 914, a memory 920, a bus 930, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.
[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cigarette package error checking method, characterized in that: include: Obtain cigarette package images and order information; Obtaining a cigarette carton recognition result according to the cigarette pack image; The error checking result is determined according to the cigarette carton recognition result and the order information.
2. The method according to claim 1, characterized in that The obtaining of cigarette package images and order information includes: Obtain cigarette package images and order information through socket communication.
3. The method according to claim 1 or 2, characterized in that: The step of obtaining a cigarette carton recognition result according to the cigarette pack image includes: Extracting first target information of the cigarette pack image, wherein the first target information includes end surface information of a cigarette in the cigarette pack image; A cigarette carton recognition result is obtained based on the end face information.
4. The method according to claim 3, characterized in that: The step of obtaining a cigarette carton recognition result according to the end face information includes: According to the end face information, the YOLOv8 model is used to obtain the cigarette carton recognition result.
5. The method according to claim 3 or 4, characterized in that: The cigarette carton recognition result includes second target information, which is the specifications of each cigarette carton in the end face information and the quantity of cigarette carton of each specification; The step of determining the error checking result according to the cigarette carton recognition result and the order information includes: Establishing a dictionary find according to the second target information, and establishing a dictionary order according to the order information; The error checking result is determined according to the second target information in the dictionary find and the third target information in the dictionary order, wherein the third target information is the specifications of each cigarette carton ordered by the customer and the quantity corresponding to each cigarette carton of the ordered specifications.
6. The method according to claim 5, characterized in that The step of determining the error checking result according to the second target information in the dictionary find and the third target information in the dictionary order includes: If one of the specifications in the dictionary find does not exist in the dictionary order, first indication information is determined, and the first indication information is used to indicate that the specification is wrong; if it exists, then continue to verify whether the quantity corresponding to the cigarette cartons of the specification in the dictionary find is consistent with the quantity corresponding to the cigarette cartons of the specification in the dictionary order, if not, then determine second indication information, and the second indication information is used to indicate that the quantity is wrong; if they are consistent, then check whether the next specification in the dictionary find is in the dictionary order, and so on, until each specification in the dictionary find and the quantity corresponding to each specification are checked to see if they are consistent with each specification in the dictionary order and the quantity corresponding to each specification; determining the error checking result according to the first indication information and / or the second indication information; or, If the first indication information and the second indication information are not present, it is determined that the error checking result is that the cigarette package is normal.
7. The method according to claim 1 or 2, characterized in that: The method further comprises: The error checking result is displayed on the upper computer interface.
8. The method according to claim 7, characterized in that The functions on the host computer interface include: The cigarette carton recognition result display, error checking result display, program running status display, "Start Recognition" button, "Stop Recognition" button, "Start Saving" button, "Stop Saving" button and / or "Advanced Settings" button.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor and the memory communicate with each other via a bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 8 by calling the program instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Tobacco packet error correction and code assignment method and device for tobacco logistics vision and encryption dual verification
CN122174854A
