Packaging material detection method and device
By obtaining the image of the packaging material and using multiple shooting devices and preset material identification code to detect the size, the automated monitoring and management of packaging material is realized, and the problem of lack of automation of identification and supervision in the prior art is solved, and the detection accuracy is improved. Reduced human intervention.
Patent Information
- Application Number
- CN202010985006.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-18
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2040-09-18
AI Technical Summary
In the prior art, the identification and supervision of packaging materials lack automation, resulting in increased human intervention, low detection accuracy, and prone to abuse and waste.
By obtaining images of packaging materials and using multiple shooting devices and preset material identification codes to detect sizes, we can automatically detect the material type of packaging materials, reduce human intervention, and improve detection accuracy.
It realizes automatic monitoring and management of packaging materials, reduces human intervention, improves detection accuracy, and avoids the problems of abuse and waste.
Smart Images

Figure CN114202041B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a packaging material detection method and device. Background Art
[0002] In recent years, due to the substantial increase in domestic pulp costs, the prices of commonly used packaging materials in the express delivery industry, such as cartons and document seals, have risen accordingly, causing the cost of express delivery to rise all the way. Due to the lack of supervision of packaging materials such as cartons, it is often the case that the actual amount of packaging materials used on site is less than the amount applied to the headquarters, resulting in abuse and waste, further increasing the cost of express delivery. The traditional material identification code recognition method is to identify through manual handheld barcode readers, which needs to be completed by site staff and lacks third-party supervision. Summary of the invention
[0003] The embodiments of the present application provide a packaging material detection method and device. On the one hand, the material type of the packaging material can be automatically detected by acquiring the packaging material image, so as to realize the monitoring and management of the packaging material and reduce human intervention. On the other hand, by setting m shooting devices and the material identification code on the packaging material, the m shooting devices can definitely capture the material identification code image, thereby avoiding the situation where the material identification code cannot be automatically detected, and improving the detection accuracy of the packaging material detection.
[0004] In one aspect, the present application provides a packaging material detection method, the packaging material detection method comprising:
[0005] Acquire at least one packaging material image of the packaging material on the transmission device, the at least one packaging material image is an image of the packaging material photographed by m shooting devices, the packaging material is in a polyhedral shape, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating a material type is set on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers;
[0006] Based on a plurality of preset material identification code detection sizes, performing material identification code image detection on the at least one packaging material image to determine the material identification code image of the packaging material;
[0007] The material identification code image is detected to determine the material type of the packaging material.
[0008] In some embodiments of the present application, m=1, a material identification code indicating a material type is provided on each configurable surface of the packaging material, and the at least one packaging material image includes a first packaging material image;
[0009] The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material includes:
[0010] Based on a plurality of preset material identification code detection sizes, material identification code image detection is performed on the first packaging material image to determine the material identification code image of the packaging material.
[0011] In some embodiments of the present application, m>1, the at least one packaging material image includes a plurality of packaging material images taken by the m photographing devices, the m photographing devices include a first photographing device, and the plurality of packaging material images include a second packaging material image taken by the first photographing device;
[0012] The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material includes:
[0013] detecting whether there is a material identification code image in the second packaging material image;
[0014] If a material identification code image exists in the second packaging material image, material identification code image detection is performed on the second packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0015] In some embodiments of the present application, the m photographing devices include a second photographing device, the multiple packaging material images include a third packaging material image photographed by the second photographing device, and the second photographing device is different from the first photographing device;
[0016] The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material further includes:
[0017] If the material identification code image does not exist in the second packaging material image, detecting whether the material identification code image exists in the third packaging material image;
[0018] If a material identification code image exists in the third packaging material image, material identification code image detection is performed on the third packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0019] In some embodiments of the present application, the material identification code image detection is performed on the second packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, including:
[0020] Taking one material identification code detection size among the multiple material identification code detection sizes as the target detection size;
[0021] Detecting an object whose size matches the target detection size from the second packaging material image, and obtaining a target object image corresponding to the target detection size;
[0022] After the target object images corresponding to the plurality of material identification code detection sizes are obtained, the material identification code image of the packaging material is determined from the obtained target object image.
[0023] In some embodiments of the present application, the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, including:
[0024] The second packaging material image is input into a preset packaging material detection model, and a material identification code image of the packaging material is output, wherein the multiple material identification code detection sizes are multiple material identification code anchor frame sizes preset in the packaging material detection model.
[0025] In some embodiments of the present application, before inputting the second packaging material image into a preset packaging material detection model and outputting a material identification code image of the packaging material, the method further includes:
[0026] Get the initial yolov3 network model;
[0027] The anchor frame size of the yolov3 network model is set to the detection size of the multiple material identification codes, and the loss function of the yolov3 network model is set to the GIoU loss function to obtain a modified yolov3 network model;
[0028] The modified yolov3 network model is trained using the pre-collected packaging material images to obtain the packaging material detection model.
[0029] In some embodiments of the present application, the multiple material identification code anchor frames are all rectangular frames, and the sizes of the multiple material identification code anchor frames include {37,41}, {84,86}, {30,29}, {44,42}, {21,22}, {63,64}, {36,32}, {41,36}, {51,52}.
[0030] In some embodiments of the present application, the detecting the material identification code image to determine the material type of the packaging material includes:
[0031] Performing image preprocessing on the material identification code image to improve image quality, to obtain a processed material identification code image;
[0032] Detecting the processed material identification code image to obtain material type information of the packaging material in the processed material identification code image;
[0033] Based on the material type information of the packaging material, the material type of the packaging material is determined.
[0034] In some embodiments of the present application, the performing image preprocessing on the material identification code image for improving image quality to obtain a processed material identification code image includes:
[0035] Determining whether the size information of the material identification code image meets the preset size requirements;
[0036] If the size information of the material identification code image does not meet the preset size requirement, the material identification code image is adjusted to the preset size to obtain a first material identification code image;
[0037] Determining whether the brightness information of the first material identification code image meets a preset brightness requirement;
[0038] If the brightness information of the first material identification code image does not meet the average decoding brightness requirement, adjusting the first material identification code image to a preset brightness to obtain a second material identification code image;
[0039] The second material identification code image is converted into a grayscale image, and the grayscale image is binarized and then opened to obtain the processed material identification code image.
[0040] On the other hand, the present application provides a packaging material detection device, the packaging material detection device comprising:
[0041] an acquisition unit, used for acquiring at least one packaging material image of the packaging material on the transmission device, wherein the at least one packaging material image is an image of the packaging material taken by m photographing devices, the packaging material is in a polyhedral shape, the packaging material has a faces, the a faces include b settable faces, each of the m photographing devices is arranged corresponding to a settable face of the packaging material, a material identification code indicating a material type is arranged on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers;
[0042] A first determining unit, configured to perform material identification code image detection on the at least one packaging material image based on a plurality of preset material identification code detection sizes, and determine the material identification code image of the packaging material;
[0043] The second determining unit is used to detect the material identification code image to determine the material type of the packaging material.
[0044] In some embodiments of the present application, m=1, a material identification code indicating a material type is provided on each configurable surface of the packaging material, and the at least one packaging material image includes a first packaging material image;
[0045] The first determining unit is specifically configured to: perform material identification code image detection on the first packaging material image based on a plurality of preset material identification code detection sizes, and determine the material identification code image of the packaging material.
[0046] In some embodiments of the present application, m>1, the at least one packaging material image includes a plurality of packaging material images taken by the m photographing devices, the m photographing devices include a first photographing device, and the plurality of packaging material images include a second packaging material image taken by the first photographing device;
[0047] The first determining unit is specifically configured to:
[0048] detecting whether there is a material identification code image in the second packaging material image;
[0049] If a material identification code image exists in the second packaging material image, material identification code image detection is performed on the second packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0050] In some embodiments of the present application, the m photographing devices further include a second photographing device, the plurality of packaging material images include a third packaging material image photographed by the second photographing device, and the second photographing device is different from the first photographing device;
[0051] The first determining unit is further configured to:
[0052] If the material identification code image does not exist in the second packaging material image, detecting whether the material identification code image exists in the third packaging material image;
[0053] If a material identification code image exists in the third packaging material image, material identification code image detection is performed on the third packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0054] In some implementations of the present application, the first determining unit is specifically configured to:
[0055] Taking one material identification code detection size among the multiple material identification code detection sizes as the target detection size;
[0056] Detecting an object whose size matches the target detection size from the second packaging material image, and obtaining a target object image corresponding to the target detection size;
[0057] After the target object images corresponding to the plurality of material identification code detection sizes are obtained, the material identification code image of the packaging material is determined from the obtained target object image.
[0058] In some implementations of the present application, the first determining unit is specifically configured to:
[0059] The second packaging material image is input into a preset packaging material detection model, and a material identification code image of the packaging material is output, wherein the multiple material identification code detection sizes are multiple material identification code anchor frame sizes preset in the packaging material detection model.
[0060] In some embodiments of the present application, the multiple material identification code anchor frames are all rectangular frames, and the sizes of the multiple material identification code anchor frames include {37,41}, {84,86}, {30,29}, {44,42}, {21,22}, {63,64}, {36,32}, {41,36}, {51,52}.
[0061] In some embodiments of the present application, the device further includes a training unit, which is specifically used to:
[0062] Get the initial yolov3 network model;
[0063] The anchor frame size of the yolov3 network model is set to the detection size of the multiple material identification codes, and the loss function of the yolov3 network model is set to the GIoU loss function to obtain a modified yolov3 network model;
[0064] The modified yolov3 network model is trained using the pre-collected packaging material images to obtain the packaging material detection model.
[0065] In some implementations of the present application, the second determining unit is specifically configured to:
[0066] Performing image preprocessing on the material identification code image to improve image quality, to obtain a processed material identification code image;
[0067] Detecting the processed material identification code image to obtain material type information of the packaging material in the processed material identification code image;
[0068] Based on the material type information of the packaging material, the material type of the packaging material is determined.
[0069] In some implementations of the present application, the second determining unit is specifically configured to:
[0070] Determining whether the size information of the material identification code image meets the preset size requirements;
[0071] If the size information of the material identification code image does not meet the preset size requirement, the material identification code image is adjusted to the preset size to obtain a first material identification code image;
[0072] Determining whether the size information of the first material identification code image meets the preset brightness requirement;
[0073] If the brightness information of the first material identification code image does not meet the average decoding brightness requirement, adjusting the first material identification code image to a preset brightness to obtain a second material identification code image;
[0074] The second material identification code image is converted into a grayscale image, and the grayscale image is binarized and then opened to obtain the processed material identification code image.
[0075] On the other hand, the present application also provides a computer device, the computer device comprising:
[0076] one or more processors;
[0077] Memory; and
[0078] One or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the processor to implement the packaging material detection method according to any one of the first aspects.
[0079] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is loaded by a processor to execute the steps in the packaging material detection method described in any one of the first aspects.
[0080] The present application obtains at least one packaging material image of the packaging material on the transmission device, and based on the preset multiple material identification code detection sizes, performs material identification code image detection on at least one packaging material image to determine the material identification code image of the packaging material; and detects the material identification code image to determine the material type of the packaging material. The present application is based on the traditional method of manually scanning the material identification code through the material identification code scanning device without third-party supervision. On the one hand, the material type of the packaging material can be automatically detected by obtaining the packaging material image, which can realize the monitoring and management of the packaging material and reduce human intervention. On the other hand, through the setting of m shooting devices and the material identification code on the packaging material, the m shooting devices can definitely capture the material identification code image, thereby avoiding the situation where the material identification code cannot be automatically detected, and improving the detection accuracy of the packaging material detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0082] Figure 1 is a schematic diagram of a scenario of a packaging material detection system provided in an embodiment of the present application;
[0083] Figure 2 It is a schematic diagram of an embodiment of a packaging material detection method provided in an embodiment of the present application;
[0084] Figure 3 This is a flowchart of an embodiment of step 202 in the embodiment of the present application;
[0085] Figure 4 This is a flowchart of an embodiment of step 203 in the embodiment of the present application;
[0086] Figure 5 is a schematic structural diagram of an embodiment of a packaging material detection device provided in an embodiment of the present application;
[0087] Figure 6 It is a schematic diagram of the structure of an embodiment of a computer device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0088] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0089] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0090] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0091] It should be noted that since the method of the embodiment of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for processing by the computer device. The details will not be repeated here.
[0092] The embodiments of the present application provide a packaging material detection method and device, which are described in detail below.
[0093] See also Figure 1 , Figure 1 Schematic diagram of a packaging material detection system provided in an embodiment of the present application. The packaging material detection system may include a computer device 100, in which a packaging material detection device is integrated. Figure 1 Computer equipment in.
[0094] In the embodiment of the present application, the computer device 100 is mainly used to obtain at least one packaging material image of the packaging material on the transmission device, the at least one packaging material image is an image of the packaging material taken by m shooting devices, the packaging material is a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face on the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; based on the preset multiple material identification code detection sizes, material identification code image detection is performed on the at least one packaging material image to determine the material identification code image of the packaging material; the material identification code image is detected to determine the material type of the packaging material.
[0095] In the embodiment of the present application, the computer device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0096] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or less computer equipment as shown in Figure 1 Only one computer device is shown in the figure. It can be understood that the packaging material detection system can also include one or more other computer devices, which are not specifically limited here.
[0097] In addition, if Figure 1As shown, the packaging material detection system may further include a memory 200 for storing data, such as packaging material data, for example, packaging material images, preset detection dimensions of multiple material identification codes, material type information of packaging materials, etc.
[0098] It should be noted that Figure 1 The scenario diagram of the packaging material detection system shown is merely an example. The packaging material detection system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the packaging material detection system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.
[0099] First, a packaging material detection method is provided in an embodiment of the present application. The execution subject of the packaging material detection method is a packaging material detection device, and the packaging material detection device is applied to a computer device. The packaging material detection method includes: obtaining at least one packaging material image of the packaging material on the transmission device, the at least one packaging material image is an image of the packaging material captured by m shooting devices, the packaging material is a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face on the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; based on a plurality of preset material identification code detection sizes, performing material identification code image detection on the at least one packaging material image to determine the material identification code image of the packaging material; and detecting the material identification code image to determine the material type of the packaging material.
[0100] like Figure 2 FIG. 1 is a flow chart of an embodiment of a packaging material detection method in an embodiment of the present application, and the packaging material detection method includes:
[0101] 201. Acquire at least one packaging material image of the packaging material on a transmission device.
[0102] In the embodiments of the present application, the packaging materials may be packaging boxes and packaging bags, the packaging bags may be document envelopes, document bags or parcel bags, etc., the packaging boxes may be polyhedral packaging boxes, the polyhedral shapes may be regular shapes, such as regular polyhedrons, cylinders, etc., such as cube shapes in regular hexahedrons, rectangular shapes, and in special applications, such as packaging specific items, they may also be irregular shapes, which are not specifically limited here.
[0103] In the embodiment of the present application, packaging materials such as packaging boxes will be printed with special material identification codes when leaving the factory. When parcels are sorted at logistics outlets such as transfer stations, they will be divided into ordinary pieces and small pieces. Ordinary pieces include slightly larger parcels such as packaging boxes and soft plastic bags, and small pieces include small parcels such as document envelopes. These two types of parcels will pass through the transmission devices of different sorting lines.
[0104] Among them, the at least one packaging material image is an image of the packaging material taken by m shooting devices, the packaging material is a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers.
[0105] In the embodiment of the present application, the packaging material image is an image of a configurable surface of the packaging material captured by the camera. The packaging material identification code is preset with basic information of the packaging material, such as the material type information of the packaging material, the storage time information of the packaging material, etc., wherein the material type information of the packaging material can be the material type of the packaging material or the code corresponding to the material type of the packaging material, such as a packaging box, or the number 001 corresponding to the packaging box, etc.
[0106] In the embodiment of the present application, the material identification code may include coding information of the material type. The material identification code described may be a barcode or a QR code, wherein the barcode may be an EAN barcode, a UPC barcode, a Codabar barcode, a 39 barcode, a 25 barcode, a cross 25 barcode or a matrix 25 barcode, etc., and the QR code may be PDF417, QR Code, Code 49, Code16K, Code One, etc. The above-mentioned material identification codes are only examples. It can be understood that the material identification code may also be other types of barcodes or QR codes, or new barcodes or QR codes that will appear in the future, as well as other types of material identification codes, which are not specifically limited here.
[0107] The settable surface is a surface on the packaging material on which a material identification code of a preset size can be set, that is, a surface in the packaging material whose size is not less than the material identification code is a settable surface. Specifically, the length of the settable surface is not less than the length of the material identification code, and the width of the settable surface is not less than the width of the material identification code. The material identification code can be set on the settable surface. When the packaging material is a packaging box, the sum of m and n is greater than the number of faces of the packaging material. Taking the packaging box as a cube as an example, the packaging box has 6 faces, that is, a=6. Assuming that the sizes of these six faces can all be used to set material identification codes, these six faces are all settable faces, that is, there are 6 settable faces, b=6. The sorting line for ordinary pieces can be equipped with 6 shooting devices (such as industrial cameras) corresponding to the six faces of the packaging box, that is, m=6. The shooting device will shoot the six faces of the package once when the package passes, generating six pictures. At this time, since each side of the packaging box is provided with a corresponding camera, it is only necessary to ensure that one of the six configurable sides of the packaging box is provided with a material identification code, that is, n≥1. At this time, m+n>6, and there is always one camera device among the six cameras that can capture the side with the material identification code. Similarly, five cameras can be provided, that is, m=5, and it is necessary to ensure that at least two of the six configurable sides of the packaging box are provided with a material identification code, n≥2. At this time, m+n>6, and there is always one camera device among the five cameras that can capture the side with the material identification code. By analogy, as long as m+n>6, it can be ensured that there is always one camera device among the m cameras that can capture the side with the material identification code.
[0108] When the packaging material is a packaging bag, since the packaging bag has small surfaces except two wide surfaces, the material identification code cannot be set. Therefore, the settable surfaces of the packaging bag are two wide surfaces, that is, the number of settable surfaces of the packaging bag is 2, and the n settable surfaces of the packaging material can be at least one of the two wide surfaces of the packaging material, and the sum of m and n is greater than 2.
[0109] For example, a photographing device (such as an industrial camera) is installed above the sorting line through which the packaging bag passes, that is, m=1, corresponding to one of the two wide sides of the packaging bag, and the two configurable sides of the packaging bag are both provided with material identification codes, that is, n=2, m+n>2, then the photographing device will always photograph the side with the material identification code. For another example, a photographing device (such as an industrial camera) is installed above and below the sorting line through which the packaging bag passes, respectively, m=2. At this time, only at least one of the two configurable sides of the packaging bag needs to be provided with a material identification code, n≥1, m+n>2, then one of the two photographing devices will always photograph the side with the material identification code.
[0110] It should be noted that the camera installed below the sorting line can be achieved by digging a hole or setting a transparent shooting area on the conveying device. The camera is set at the hole or the transparent shooting area so that when the packaging material is transmitted on the conveying device through the hole or the transparent shooting area, the image of the bottom surface of the packaging material can be captured.
[0111] 202. Based on a plurality of preset material identification code detection sizes, perform material identification code image detection on the at least one packaging material image to determine a material identification code image of the packaging material.
[0112] Among them, the packaging material image can be taken by a high-speed industrial camera, that is, the shooting device is an industrial camera. Due to the poor lighting in the logistics site, the overall image captured by the shooting device is relatively dark in color, and the backgrounds of different sites are inconsistent, which will lead to low detection efficiency of the material identification code. In order to improve the detection efficiency of the material identification code, for the packaging materials of concern, the style and size of the material identification code printed on the packaging material are redesigned in the embodiment of the present application. The style is a material identification code with low complexity, and the size varies from 30 mm * 30 mm, 35 mm * 35 mm and 54 mm * 54 mm depending on the size of the carton.
[0113] In an embodiment of the present application, when the material identification code is a two-dimensional code, the detection sizes of the various material identification codes are the sizes of two-dimensional code detection suitable for packaging logistics in the logistics field that the inventors have found in advance through the K-means algorithm. In a typical application scenario, the multiple material identification code anchor frames are all universal rectangular frames, and the multiple material identification code anchor frame sizes include the following universal categories: {37,41}, {84,86}, {30,29}, {44,42}, {21,22}, {63,64}, {36,32}, {41,36}, {51,52}. By setting and identifying the above-mentioned multiple material identification code detection sizes as a standard for judging whether it is an identification code rectangular frame, the accuracy of two-dimensional code detection can be significantly improved.
[0114] 203. Detect the material identification code image to determine the material type of the packaging material.
[0115] After the material identification code image is determined in step 202, the material identification code image can be directly decoded and detected to determine the material type of the packaging material, such as a packaging carton, a soft plastic bag, and a document envelope.
[0116] The present application obtains at least one packaging material image of the packaging material on the transmission device, and based on the preset multiple material identification code detection sizes, performs material identification code image detection on at least one packaging material image to determine the material identification code image of the packaging material; and detects the material identification code image to determine the material type of the packaging material. The present application is based on the traditional method of manually scanning the material identification code through the material identification code scanning device, without third-party supervision. On the one hand, the material type of the packaging material can be automatically detected by obtaining the packaging material image, which can realize the monitoring and management of the packaging material and reduce human intervention. On the other hand, through the setting of m shooting devices and the material identification code on the packaging material, the m shooting devices can definitely capture the material identification code image, thereby avoiding the situation where the material identification code cannot be automatically detected, and improving the detection accuracy of the packaging material detection.
[0117] In the embodiment of the present application, based on the preset multiple material identification code detection sizes, the material identification code image detection is performed on the at least one packaging material image, and the implementation method of determining the material identification code image of the packaging material is based on the number of shooting devices and the number of material identification codes set on the settable surface of the packaging material. There are multiple implementation methods, which are described below with examples in combination with specific scenarios:
[0118] (1) m=1. If m+n>b is to be satisfied, a material identification code indicating the material type is provided on each configurable surface of the packaging material.
[0119] When m=1, it means that there is 1 photographing device, and a material identification code indicating the material type is set on each settable surface of the packaging material. Since each photographing device only photographs the image of the corresponding surface of the packaging material, the first packaging material image corresponding to the settable surface of the photographing device can be obtained. Only one first packaging material image taken by the photographing device is needed to ensure that there must be a material identification code on the first packaging material image, that is, the material identification code image can be determined directly based on the packaging material image. Of course, in actual applications, multiple first packaging material images of the settable surface corresponding to the photographing device can also be collected, and one of the images with the best quality (for example, the image with the clearest boundary) is selected for subsequent material identification code recognition.
[0120] At this time, the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, which may include: based on the preset multiple material identification code detection sizes, the material identification code image detection is performed on the first packaging material image to determine the material identification code image of the packaging material.
[0121] (2) m>1, the at least one packaging material image includes a plurality of packaging material images photographed by the m photographing devices.
[0122] When m>1, it indicates that there are multiple photographing devices, and the at least one packaging material image includes multiple packaging material images photographed by the m photographing devices (respectively, images of different configurable surfaces of the same packaging material photographed by the multiple photographing devices). Since there are multiple packaging material images of different configurable surfaces of the packaging material, each image is required to determine whether the material identification code is included.
[0123] There are m photographing devices, each of which photographs an image of a configurable surface of the packaging material, and there are m images. The n configurable surfaces of the packaging material are set with identification codes, so some of the packaging material images photographed by the multiple photographing devices may not have material identification codes. Since m+n is greater than b, it is guaranteed that there is a material identification code in the image taken by at least one photographing device, so it is necessary to judge and detect the packaging material images taken by each photographing device separately.
[0124] Therefore, when the m photographing devices include a first photographing device, and the plurality of packaging material images include a second packaging material image photographed by the first photographing device, the second packaging material image may be firstly judged and detected to determine whether the second packaging material image includes a material identification code. Figure 3 As shown, the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, including:
[0125] 301. Detect whether a material identification code image exists in the second packaging material image.
[0126] 302. If a material identification code image exists in the second packaging material image, perform material identification code image detection on the second packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0127] Further, when the m shooting devices include a second shooting device, the multiple packaging material images include a third packaging material image shot by the second shooting device, the second shooting device is different from the first shooting device, the first shooting device has a first shooting angle of view, and the second shooting device has a second shooting angle of view, the first shooting angle of view and the second shooting angle of view are different, for example, the first shooting angle of view may be a angle of view from directly above the transmission device to the transmission area of the transmission device, and the second shooting angle of view may be a angle of view from the side of the transmission device to the top of the transmission area of the transmission device.
[0128] At this time, when the second packaging material image does not include the material identification code, it is necessary to further determine whether the third packaging material image includes the material identification code. Figure 3 As shown, the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, and may also include:
[0129] 303. If the material identification code image does not exist in the second packaging material image, detect whether the material identification code image exists in the third packaging material image.
[0130] 304. If a material identification code image exists in the third packaging material image, perform material identification code image detection on the third packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0131] Specifically, the material identification code image detection is performed on the second packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, including: taking one material identification code detection size among the multiple material identification code detection sizes as the target detection size; detecting an object matching the target detection size from the second packaging material image to obtain a target object image corresponding to the target detection size; after obtaining the target object images corresponding to each of the multiple material identification code detection sizes, determining the material identification code image of the packaging material from the obtained target object images.
[0132] For example, assuming that the material identification code detection size includes {37, 41}, {84, 86}, {30, 29}, {44, 42}, {21, 22}, {63, 64}, {36, 32}, {41, 36}, {51, 52}, the target object images of these sizes are detected from the second packaging material image respectively to obtain the target object image. Since there are some backgrounds near the packaging material (such as a transmission device for placing the packaging material, a wall or other accumulations, etc.), after obtaining the target object images corresponding to the various material identification code detection sizes, the material identification code image of the packaging material can be further determined from the obtained target object image. Among them, the method of further determining the material identification code image of the packaging material from the obtained target object image can be identified and determined by using a pre-trained packaging material recognition model. The packaging material recognition model can be obtained by using packaging material image samples to train an initial neural network model. The initial neural network model can be a convolutional neural network (CNN). For example, a VGG network model, a GoogleNet network model, etc.
[0133] In some embodiments of the present application, the material identification code image detection is performed on the second packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material. It can also be performed directly based on a pre-trained neural network model as a whole. Specifically, the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material may include: inputting the second packaging material image into a preset packaging material detection model, and outputting the material identification code image of the packaging material, wherein the packaging material detection model is a target detection model, and the multiple material identification code detection sizes are multiple material identification code anchor frame sizes preset in the packaging material detection model.
[0134] In the embodiment of the present application, the packaging material detection model can be a yolov3 network model. Yolov3 is the most commonly used target detection algorithm, which can quickly and efficiently identify objects of different sizes. Since most material identification codes are small targets, yolov3 is more friendly to this scenario than other algorithms.
[0135] For the material identification code detection task on the packaging material, since the detection target is relatively small, the anchor box size of the yolov3 network model is not suitable for this application. Therefore, before inputting the second packaging material image into the preset packaging material detection model and outputting the material identification code image of the packaging material, the method also includes: obtaining the initial yolov3 network model; setting the anchor box size of the yolov3 network model to the multiple material identification code detection sizes, and setting the loss function of the yolov3 network model to the GIoU loss function to obtain a modified yolov3 network model; using the pre-collected packaging material image to train the modified yolov3 network model to obtain the packaging material detection model.
[0136] Specifically, when the material identification code is a two-dimensional code, the inventor finds the multiple material identification code anchor frame sizes suitable for two-dimensional code detection through the K-means algorithm, and the multiple material identification code anchor frame sizes include {37, 41}, {84, 86}, {30, 29}, {44, 42}, {21, 22}, {63, 64}, {36, 32}, {41, 36}, {51, 52}. In addition, in the embodiment of the present application, the loss function in the training of the packaging material detection model (such as the yolov3 model) adopts the GIoU (generalizedIoU) loss function to replace the original loss function calculated by the distance of the detection frame. The GIoU loss function not only considers the overlapping area between the two detection frames, but also considers the overlapping mode of the two detection frames, and its expression is shown in Formula 1. Among them, A and B are the detection frame (material identification code anchor frame) and the real detection frame identified by the packaging material detection model, respectively, and C is the minimum convex set that can cover A and B. Compared with simple IoU, the GIoU value can describe whether the two boxes are well aligned, and it also has a value when the two boxes do not overlap, so it can better describe the degree of fit between the recognition box and the real box. The training results show that the accuracy of the packaging material detection model is 90% and the recall rate is 96%.
[0137]
[0138] The material identification code image segmented out in step 202 can be further decoded and detected in step 203 to extract the material coding information in the material identification code. For example, when the material identification code is a QR code, the open source decoding rate zbar can be used in the embodiment of the present application to perform QR code decoding. ZBar is an open source library for scanning and reading QR codes and barcodes. The supported QR codes include: EAN QR code, UPC QR code, QR code, etc.
[0139] In order to improve the decoding rate, the embodiment of the present application can perform image preprocessing before decoding the two-dimensional code. Specifically, Figure 4 As shown, in some embodiments of the present application, the detecting the material identification code image to determine the material type of the packaging material includes:
[0140] 401. Perform image preprocessing on the material identification code image to improve image quality, to obtain a processed material identification code image.
[0141] Specifically, the image preprocessing for improving the image quality of the material identification code image to obtain the processed material identification code image includes: determining whether the size information of the material identification code image meets the preset size requirement; if the size information of the material identification code image does not meet the preset size requirement, adjusting the material identification code image to the preset size to obtain the first material identification code image; determining whether the size information of the first material identification code image meets the preset brightness requirement; if the brightness information of the first material identification code image does not meet the average decoding brightness requirement, adjusting the first material identification code image to the preset brightness to obtain the second material identification code image; converting the second material identification code image into a grayscale image, binarizing the grayscale image and then performing an opening operation to obtain the processed material identification code image.
[0142] In a specific embodiment, the first step of image preprocessing for improving image quality is to enlarge the too small picture to an image with a long side of 400 mm. Since there are many very dark pictures collected by industrial cameras, this embodiment can detect the brightness of the picture and improve the brightness of the pictures in need. Specifically, in the second step, the RGB image can be converted into an HSV color map. If the average brightness (V) of the two-dimensional code image is less than 100, it is regarded as an image that is too dark. It is increased to 100 and then converted into a grayscale image. Next, the image is thresholded by the Otsu algorithm, and the binary image is opened to filter out small impurities. After the image preprocessing for improving image quality in this embodiment, the decoding library zbar is used for decoding, and the decoding rate is greatly improved.
[0143] Among them, the Otsu algorithm, also known as the maximum inter-class difference method, was proposed by Otsu in 1979 and is considered to be the best algorithm for threshold selection in image segmentation. It is simple to calculate and is not affected by image brightness and contrast. Therefore, it has been widely used in digital image processing. It divides the image into two parts, background and foreground, according to the grayscale characteristics of the image. Because variance is a measure of the uniformity of grayscale distribution, the larger the inter-class variance between the background and foreground, the greater the difference between the two parts of the image. When part of the foreground is mistakenly divided into the background or part of the background is mistakenly divided into the foreground, the difference between the two parts will become smaller. Therefore, the segmentation that maximizes the inter-class variance means the minimum probability of misclassification.
[0144] 402. Detect the processed material identification code image to obtain material type information of the packaging material in the processed material identification code image.
[0145] After obtaining the processed material identification code image in step 401, the processed material identification code image may be directly detected to obtain the material type information of the packaging material in the processed material identification code image.
[0146] 403. Determine the material type of the packaging material based on the material type information of the packaging material.
[0147] Since packaging boxes, soft plastic bags and document envelopes have different material type codes, the material type of the packaging material can be confirmed and classified according to the material type code.
[0148] In some embodiments of the present application, after determining the material type of the packaging material, the packaging material detection method may further include: obtaining express delivery information corresponding to the packaging material, and determining whether there is any abuse in the packaging of the packaging material based on the express delivery information corresponding to the packaging material and the material type.
[0149] Specifically, the express delivery information corresponding to the packaging material may include one or more of the express delivery size information, express delivery weight information or express delivery type information corresponding to the packaging material, such as 20*20cm, etc. For example, assuming that the packaging material is a packaging box, but the actual express delivery information corresponding to the packaging material shows that the express delivery type is a document and the weight is 0.5kg, which proves that it is a small document and there is abuse of the use of the packaging box.
[0150] In addition, in some embodiments of the present application, the usage data of packaging materials can be regularly counted to verify the declaration of packaging materials and the discrepancy between the actual usage and the actual usage. In this case, the packaging material detection method can further include: counting the first data of packaging materials of different material types at the target logistics outlets within the target time period; obtaining the second data of the packaging materials used within the target time period declared by the target logistics outlets, and comparing the first data and the second data to determine whether there is false declaration or abuse at the target logistics outlets.
[0151] The target logistics outlet may be a transfer station or a delivery outlet, etc. The target time period may be any time period, such as one day, one week, or one month, etc., and may be set according to the actual application scenario, and is not specifically limited here.
[0152] For example, suppose logistics outlet A declared the use of 1,000 packaging boxes and 100 document envelopes on a certain day, but based on automatic statistical data, it is determined that logistics outlet A actually used 500 packaging boxes and 100 document envelopes on that day. It can be estimated that the declared packaging boxes are inconsistent with actual usage, and it can be determined that logistics outlet A has made false declarations or abused packaging boxes, and personnel can handle it as appropriate.
[0153] In order to better implement the packaging material detection method in the embodiment of the present application, based on the packaging material detection method, the embodiment of the present application also provides a packaging material detection device, such as Figure 5As shown, the packaging material detection device 500 includes an acquisition unit 501, a first determination unit 502 and a second determination unit 503, which are specifically as follows:
[0154] An acquisition unit 501 is used to acquire at least one packaging material image of the packaging material on the transmission device, wherein the at least one packaging material image is an image of the packaging material taken by m photographing devices, the packaging material is in a polyhedral shape, the packaging material has a faces, the a faces include b settable faces, each of the m photographing devices is arranged corresponding to a settable face of the packaging material, a material identification code indicating a material type is arranged on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers;
[0155] A first determining unit 502 is configured to perform material identification code image detection on the at least one packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material;
[0156] The second determining unit 503 is used to detect the material identification code image to determine the material type of the packaging material.
[0157] The present application manually scans the material identification code through the material identification code scanning device in the traditional way without the supervision of a third party. On the one hand, it can automatically detect the material type of the packaging material by obtaining the image of the packaging material, thereby realizing the monitoring and management of the packaging material and reducing human intervention. On the other hand, through the setting of m shooting devices and the material identification code on the packaging material, the m shooting devices can definitely capture the material identification code image, thereby avoiding the situation where the material identification code cannot be automatically detected, and improving the detection accuracy of packaging material detection.
[0158] In some embodiments of the present application, m=1, a material identification code indicating a material type is provided on each configurable surface of the packaging material, and the at least one packaging material image includes a first packaging material image;
[0159] The first determining unit 502 is specifically configured to perform material identification code image detection on the first packaging material image based on a plurality of preset material identification code detection sizes, and determine the material identification code image of the packaging material.
[0160] In some embodiments of the present application, m>1, the at least one packaging material image includes a plurality of packaging material images taken by the m photographing devices, the m photographing devices include a first photographing device, and the plurality of packaging material images include a second packaging material image taken by the first photographing device;
[0161] The first determining unit 502 is specifically configured to:
[0162] detecting whether there is a material identification code image in the second packaging material image;
[0163] If a material identification code image exists in the second packaging material image, material identification code image detection is performed on the second packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0164] In some embodiments of the present application, the m photographing devices include a second photographing device, the multiple packaging material images include a third packaging material image photographed by the second photographing device, and the second photographing device is different from the first photographing device;
[0165] The first determining unit 502 is further specifically configured to:
[0166] If the material identification code image does not exist in the second packaging material image, detecting whether the material identification code image exists in the third packaging material image;
[0167] If a material identification code image exists in the third packaging material image, material identification code image detection is performed on the third packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
[0168] In some implementations of the present application, the first determining unit is specifically configured to:
[0169] Taking one material identification code detection size among the multiple material identification code detection sizes as the target detection size;
[0170] Detecting an object whose size matches the target detection size from the second packaging material image, and obtaining a target object image corresponding to the target detection size;
[0171] After the target object images corresponding to the plurality of material identification code detection sizes are obtained, the material identification code image of the packaging material is determined from the obtained target object image.
[0172] In some implementations of the present application, the first determining unit 502 is specifically configured to:
[0173] The second packaging material image is input into a preset packaging material detection model, and a material identification code image of the packaging material is output, wherein the multiple material identification code detection sizes are multiple material identification code anchor frame sizes preset in the packaging material detection model.
[0174] In some embodiments of the present application, the sizes of the multiple material identification code anchor frames include {37, 41}, {84, 86}, {30, 29}, {44, 42}, {21, 22}, {63, 64}, {36, 32}, {41, 36}, and {51, 52}.
[0175] In some embodiments of the present application, the device further includes a training unit, which is specifically used to:
[0176] Get the initial yolov3 network model;
[0177] The anchor frame size of the yolov3 network model is set to the detection size of the multiple material identification codes, and the loss function of the yolov3 network model is set to the GIoU loss function to obtain a modified yolov3 network model;
[0178] The modified yolov3 network model is trained using the pre-collected packaging material images to obtain the packaging material detection model.
[0179] In some implementations of the present application, the second determining unit 503 is specifically configured to:
[0180] Performing image preprocessing on the material identification code image to improve image quality, to obtain a processed material identification code image;
[0181] Detecting the processed material identification code image to obtain material type information of the packaging material in the processed material identification code image;
[0182] Based on the material type information of the packaging material, the material type of the packaging material is determined.
[0183] In some implementations of the present application, the second determining unit 503 is specifically configured to:
[0184] Determining whether the size information of the material identification code image meets the preset size requirements;
[0185] If the size information of the material identification code image does not meet the preset size requirement, the material identification code image is adjusted to the preset size to obtain a first material identification code image;
[0186] Determining whether the size information of the first material identification code image meets the preset brightness requirement;
[0187] If the brightness information of the first material identification code image does not meet the average decoding brightness requirement, adjusting the first material identification code image to a preset brightness to obtain a second material identification code image;
[0188] The second material identification code image is converted into a grayscale image, and the grayscale image is binarized and then opened to obtain the processed material identification code image.
[0189] The embodiment of the present application further provides a computer device, which integrates any packaging material detection device provided in the embodiment of the present application, and the computer device includes:
[0190] one or more processors;
[0191] Memory; and
[0192] One or more applications, wherein the one or more applications are stored in the memory and are configured to cause the processor to execute the steps of the packaging material detection method described in any of the above packaging material detection method embodiments.
[0193] The present application also provides a computer device that integrates any packaging material detection device provided in the present application. Figure 6 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0194] The computer device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that Figure 6 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0195] The processor 601 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 602 and calling data stored in the memory 602, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 601.
[0196] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0197] The computer device also includes a power supply 603 for supplying power to various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 603 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0198] The computer device may further include an input unit 604, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0199] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 601 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 601 will run the application programs stored in the memory 602, thereby realizing various functions, as follows:
[0200] At least one packaging material image of the packaging material on the transmission device is acquired, the at least one packaging material image is an image of the packaging material taken by m shooting devices, the packaging material is in the shape of a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; based on a plurality of preset material identification code detection sizes, material identification code image detection is performed on the at least one packaging material image to determine the material identification code image of the packaging material; the material identification code image is detected to determine the material type of the packaging material.
[0201] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0202] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any packaging material detection method provided in the embodiment of the present application. For example, the computer program can be loaded by a processor to execute the following steps:
[0203] At least one packaging material image of the packaging material on the transmission device is acquired, the at least one packaging material image is an image of the packaging material taken by m shooting devices, the packaging material is in the shape of a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face of the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; based on a plurality of preset material identification code detection sizes, material identification code image detection is performed on the at least one packaging material image to determine the material identification code image of the packaging material; the material identification code image is detected to determine the material type of the packaging material.
[0204] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0205] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0206] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0207] The above is a detailed introduction to a packaging material detection method and device provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A packaging material detection method, characterized in that: The method comprises: Acquire at least one packaging material image of the packaging material on the transmission device, the at least one packaging material image is an image of the packaging material taken by m shooting devices, the packaging material is a polyhedron, the packaging material has a faces, the a faces include b settable faces, each of the m shooting devices is set corresponding to a settable face of the packaging material, and a material identification code indicating the material type is set on the n settable faces of the packaging material, the settable face is a face on the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; the material types include packaging cartons, soft plastic bags, and document envelopes; Based on a plurality of preset material identification code detection sizes, performing material identification code image detection on the at least one packaging material image to determine the material identification code image of the packaging material; Detecting the material identification code image to determine the material type of the packaging material; Wherein, after determining the material type of the packaging material, the method further includes: The express delivery information corresponding to the packaging material is obtained, and based on the express delivery information corresponding to the packaging material and the material type, it is determined whether there is any abuse in the packaging of the packaging material.
2. The packaging material detection method according to claim 1, characterized in that: m=1, each configurable surface of the packaging material is provided with a material identification code indicating the material type, and the at least one packaging material image includes a first packaging material image; The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material includes: Based on a plurality of preset material identification code detection sizes, material identification code image detection is performed on the first packaging material image to determine the material identification code image of the packaging material.
3. The packaging material detection method according to claim 1, characterized in that: m>1, the at least one packaging material image includes a plurality of packaging material images photographed by the m photographing devices, the m photographing devices include a first photographing device, and the plurality of packaging material images include a second packaging material image photographed by the first photographing device.
4. The packaging material detection method according to claim 3, wherein the material identification code image detection is performed on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material, comprising: detecting whether there is a material identification code image in the second packaging material image; If a material identification code image exists in the second packaging material image, material identification code image detection is performed on the second packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
5. The packaging material detection method according to claim 4, characterized in that: The m photographing devices further include a second photographing device, the plurality of packaging material images include a third packaging material image photographed by the second photographing device, and the second photographing device is different from the first photographing device; The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material further includes: If the material identification code image does not exist in the second packaging material image, detecting whether the material identification code image exists in the third packaging material image; If a material identification code image exists in the third packaging material image, material identification code image detection is performed on the third packaging material image based on a plurality of preset material identification code detection sizes to determine the material identification code image of the packaging material.
6. The packaging material detection method according to claim 4 or 5, characterized in that: The method of performing material identification code image detection on the second packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material includes: Taking one material identification code detection size among the multiple material identification code detection sizes as the target detection size; Detecting an object whose size matches the target detection size from the second packaging material image, and obtaining a target object image corresponding to the target detection size; After the target object images corresponding to the plurality of material identification code detection sizes are obtained, the material identification code image of the packaging material is determined from the obtained target object image.
7. The packaging material detection method according to claim 3, characterized in that: The method of performing material identification code image detection on the at least one packaging material image based on the preset multiple material identification code detection sizes to determine the material identification code image of the packaging material includes: The second packaging material image is input into a preset packaging material detection model, and a material identification code image of the packaging material is output, wherein the multiple material identification code detection sizes are multiple material identification code anchor frame sizes preset in the packaging material detection model.
8. The packaging material detection method according to claim 7, characterized in that: Before inputting the second packaging material image into a preset packaging material detection model and outputting a material identification code image of the packaging material, the method further includes: Get the initial yolov3 network model; The anchor frame size of the yolov3 network model is set to the detection size of the multiple material identification codes, and the loss function of the yolov3 network model is set to the GIoU loss function to obtain a modified yolov3 network model; The modified yolov3 network model is trained using the pre-collected packaging material images to obtain the packaging material detection model.
9. The packaging material detection method according to claim 1, characterized in that: The detecting the material identification code image to determine the material type of the packaging material includes: Determining whether the size information of the material identification code image meets the preset size requirements; If the size information of the material identification code image does not meet the preset size requirement, the material identification code image is adjusted to the preset size to obtain a first material identification code image; Determining whether the size information of the first material identification code image meets the preset brightness requirement; If the brightness information of the first material identification code image does not meet the average decoding brightness requirement, adjusting the first material identification code image to a preset brightness to obtain a second material identification code image; Converting the second material identification code image into a grayscale image, performing a binarization process on the grayscale image and then performing an opening operation to obtain a processed material identification code image; Based on the material type information of the packaging material, the material type of the packaging material is determined.
10. A packaging material detection device, characterized in that: The device comprises: an acquisition unit, for acquiring at least one packaging material image of the packaging material on the transmission device, wherein the at least one packaging material image is an image of the packaging material taken by m photographing devices, the packaging material is in a polyhedral shape, the packaging material has a faces, the a faces include b settable faces, each of the m photographing devices is arranged corresponding to a settable face of the packaging material, a material identification code indicating a material type is arranged on the n settable faces of the packaging material, the settable face is a face on the packaging material on which a material identification code of a preset size can be set, m≤b, n≤b≤a, the sum of m and n is greater than b, and a, b, m, and n are all positive integers; the material types include packaging cartons, soft plastic bags, and document envelopes; A first determining unit, configured to perform material identification code image detection on the at least one packaging material image based on a plurality of preset material identification code detection sizes, and determine the material identification code image of the packaging material; A second determination unit, configured to detect the material identification code image to determine the material type of the packaging material; After determining the material type of the packaging material, the second determination unit is further used to obtain express delivery information corresponding to the packaging material, and determine whether there is any abuse in the packaging of the packaging material based on the express delivery information corresponding to the packaging material and the material type.
Citation Information
Patent Citations
Self-service cash registering method and device of commodity
CN110264645A
Identification code identification method, device and equipment
CN111310507A