Packaging bag intelligent warehouse management method and system based on two-dimensional code
By preprocessing and filtering the abnormality degree of filtering on the QR code images, the problem of poor QR code images resulting in low recognition rate is solved, and more efficient warehousing management is achieved.
Patent Information
- Application Number
- CN202510191718.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2045-02-21
AI Technical Summary
When identifying QR code images in the prior art, there are problems such as low contrast, blur, background interference or damage, resulting in low recognition rate.
By preprocessing the unrecognized QR code image, a grayscale image containing only the QR code area is obtained, and the first abnormality degree of the pixel point and the second abnormality degree of the target edge are calculated, and filtered according to the abnormality degree, and finally, the QR code recognition is performed through gamma transformation enhancement image contrast.
The quality and recognition rate of QR code images are improved, and the efficiency of warehousing management is improved.
Smart Images

Figure CN119671462A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image data processing, and more specifically, to a packaging bag intelligent storage management method and system based on a two-dimensional code. Background Art
[0002] Intelligent warehouse management systems are widely used in the logistics industry. These systems make warehouse management more intelligent and automated by introducing advanced technologies such as the Internet of Things, big data, and artificial intelligence. For example, intelligent warehouse management systems collect real-time information such as the quantity, location, and status of items in the warehouse, and then optimize the storage and retrieval of goods, personnel scheduling, etc. based on technologies such as artificial intelligence. Among them, the QR code on the goods can be identified to achieve rapid identification, tracking and positioning of the goods, so that the goods can be automatically sorted and scheduled. QR code technology increases the visibility of the logistics process and helps the warehouse management system to manage the goods.
[0003] When recognizing a two-dimensional code image, if the two-dimensional code image has problems such as low contrast, blur, background interference or damage, it will be difficult to be recognized. For the problem of poor quality of the two-dimensional code image, the two-dimensional code image is generally enhanced to improve the success rate of two-dimensional code recognition. For example, a Chinese patent application document with publication number CN112580383A discloses a two-dimensional code recognition method, device, electronic device and storage medium. The method uses the image enhancement method used by the two-dimensional code that can be successfully recognized to enhance the image of the unrecognizable two-dimensional code to improve the success rate of two-dimensional code recognition. However, the above method is to enhance the image of the entire two-dimensional code image indiscriminately, and does not selectively enhance the image of the two-dimensional code according to the image characteristics of the two-dimensional code itself. Therefore, the effect of the two-dimensional code image enhancement is general, which leads to a low recognition rate of the two-dimensional code. Summary of the invention
[0004] In order to solve the technical problem that the poor enhancement effect of the two-dimensional code image leads to a low two-dimensional code recognition rate, the present invention provides solutions in the following aspects.
[0005] In a first aspect, the present invention provides a method for intelligent warehousing management of packaging bags based on a two-dimensional code, comprising: preprocessing a packaging bag image that cannot identify a two-dimensional code to obtain a grayscale image containing only a two-dimensional code area; determining a first abnormality degree of a pixel point in the grayscale image, wherein the calculation expression of the first abnormality degree is: ; In the formula, represents the first abnormal value of the pixel, , , Respectively represent the gray value, gradient value and gradient direction of the pixel point, , , Respectively represent the reference grayscale value, reference gradient value and reference gradient direction of the pixel point; perform edge detection on the grayscale image, and calculate the second abnormality degree of the target edge, wherein the second abnormality degree is positively correlated with the average curvature of the pixel points on the target edge and the mean of the first abnormality degree; when the second abnormal value is greater than a preset threshold, filter the target edge; perform QR code recognition based on the image obtained after filtering, and perform warehouse management based on the information obtained by recognition.
[0006] Beneficial effect: By filtering abnormal edges according to the characteristics of the QR code, the quality of the QR code image is improved, thereby improving the recognition rate of the QR code and further improving the efficiency of warehouse management.
[0007] Furthermore, the packaging bag image whose QR code cannot be identified is preprocessed, including: converting the packaging bag image whose QR code cannot be identified into a grayscale image, and segmenting the grayscale image according to a semantic segmentation network.
[0008] Beneficial effect: By segmenting a grayscale image containing only the QR code area, the interference of the background area on the QR code recognition is avoided, thereby improving the success rate of QR code recognition.
[0009] Furthermore, edge detection is performed on the grayscale image to calculate a second abnormality degree of the target edge, including: performing abnormality detection on the first abnormality degree of pixels on the target edge and marking the abnormal pixels; obtaining the curvature of unmarked pixels, and determining the second abnormality degree based on the mean of the curvature of the unmarked pixels and the mean of the first abnormality degree.
[0010] Beneficial effect: By not involving abnormal pixels when calculating the second abnormality degree, the accuracy of calculating the second abnormality degree is improved, thereby improving the accuracy of determining the abnormal edge.
[0011] Furthermore, the calculation expression of the second abnormality degree is as follows: ; In the formula, Indicates the second abnormality degree of the target edge, represents the total number of unmarked pixels on the edge of the target, Indicates the unmarked first The curvature of a pixel, represents the unmarked first The first abnormality degree of each pixel.
[0012] Furthermore, filtering the target edge includes: taking the perpendicular line of the line connecting the two pixel points on the target edge that are farthest apart as the search direction; taking the target pixel point on the target edge as the starting point, searching to both sides according to the search direction, and stopping the search when an edge pixel point is encountered or the search distance is greater than a preset distance; forming a filtering window of the target pixel point with all the searched pixel points, and performing mean filtering on the target pixel point.
[0013] Beneficial effect: By performing mean filtering on abnormal edges, the quality of the two-dimensional code image is improved, thereby improving the success rate of two-dimensional code recognition.
[0014] Furthermore, it also includes: all the pixel points used as the filtering window are collectively formed into an area covering the edge of the target, and the area is mean filtered according to a preset window.
[0015] Beneficial effect: By performing mean filtering on the area where the abnormal edge is located, the problem of uneven connection between the abnormal edge and other surrounding pixels caused by the first mean filtering is avoided, thereby improving the quality of the QR code image and further improving the success rate of QR code recognition.
[0016] Furthermore, before performing the two-dimensional code recognition, the method further includes: enhancing the contrast of the filtered image.
[0017] Further, enhancing the contrast of the filtered image includes: performing a gamma transform on the filtered image: ; In the formula, represents the grayscale value of the grayscale image before enhancement, represents the grayscale value of the grayscale image after enhancement, and They represent the two grayscale values with the largest proportion among all the grayscale values of the grayscale image before filtering, where .
[0018] Beneficial effect: By specifically enhancing the contrast of the two-dimensional code image, the quality of the two-dimensional code image is improved, thereby improving the success rate of two-dimensional code recognition.
[0019] In a second aspect, the present invention provides a QR code-based intelligent warehouse management system for packaging bags, comprising: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the QR code-based intelligent warehouse management method for packaging bags described in any one of the first aspects is implemented.
[0020] The beneficial effects of the present invention are as follows: the present invention improves the quality of the two-dimensional code image by performing mean filtering on abnormal edges in the two-dimensional code image, thereby improving the success rate of two-dimensional code recognition. In addition, by enhancing the contrast of the two-dimensional code image, the quality of the two-dimensional code image is further improved, thereby improving the recognition rate of the two-dimensional code, and further improving the efficiency of warehouse management. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 is a flow chart schematically illustrating a packaging bag intelligent warehousing management method according to an embodiment of the present invention; Figure 2 It is a structural block diagram schematically showing an intelligent storage management system for packaging bags according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0023] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0024] Figure 1 FIG. 4 is a flow chart schematically illustrating a method for intelligent warehousing management of packaging bags according to an embodiment of the present invention.
[0025] In a first aspect, the present invention provides a packaging bag intelligent storage management method based on a QR code, such as Figure 1 As shown, the method of the present invention comprises: S101, pre-processing the packaging bag image whose two-dimensional code cannot be identified to obtain a grayscale image containing only the two-dimensional code area.
[0026] In one embodiment, the goods in the warehouse can be placed in a consistent manner so that the QR codes on the goods packaging bags face outward, thereby improving the efficiency of simultaneously photographing multiple goods, and further improving the efficiency of obtaining the QR code images on the goods packaging bags.
[0027] Furthermore, the acquired two-dimensional code image is recognized, and for the packaging bag image with unrecognizable two-dimensional code, it is preprocessed to obtain a grayscale image containing only the two-dimensional code area. Specifically, the packaging bag image with unrecognizable two-dimensional code is grayscaled to obtain a grayscale image of the two-dimensional code, and then the grayscale image is input into a trained semantic segmentation network, and the semantic segmentation network outputs a binary image of the grayscale image, wherein in the binary image, the pixel points belonging to the two-dimensional code area are set to 1, and the pixel points belonging to the background area are set to 0. Furthermore, the binary image is multiplied with its corresponding grayscale image to obtain a grayscale image containing only the two-dimensional code area.
[0028] By graying the bag image, the contrast and brightness of the unrecognizable bag image are preliminarily adjusted, which can improve the recognition rate of the QR code. Furthermore, by segmenting the grayscale image containing only the QR code area, the interference of the background area on the QR code recognition is avoided, thereby improving the recognition rate of the QR code and further improving the efficiency of warehouse management.
[0029] In one embodiment, the loss function of the semantic segmentation network is a cross entropy loss function.
[0030] S102: Determine a first abnormality degree of a pixel in the grayscale image.
[0031] Ideally, a QR code only contains black and white, corresponding to the grayscale values of 0 and 255 respectively. However, in the actual shooting process, due to the existence of light, shadows, folds, etc., other grayscale values may exist in the captured QR code image, which causes certain interference to the recognition of the QR code. In addition, ideally, there are four gradient directions in the QR code image, that is, four mutually perpendicular directions, namely horizontal to the right (i.e. 0°), horizontal to the left (i.e. 180°), vertical upward (i.e. 90°) and vertical downward (i.e. 270°). However, in the actual QR code image, these four gradient directions may not be completely vertical, which also causes certain interference to the recognition of the QR code.
[0032] It should be noted that the gradient direction of the pixel point mentioned in the present invention is represented by the angle to the right with the horizontal.
[0033] In view of the fact that the QR code has only two grayscale values under ideal conditions, the grayscale value of each pixel in the QR code is counted to obtain the grayscale histogram of the grayscale image, and the two peaks with the largest values in the grayscale histogram are marked, and the grayscale values of the two peaks are taken as the main grayscale values. It can be understood that under ideal conditions, the two main grayscale values of the QR code image should be 0 and 255, that is, among all the grayscale values of the grayscale image, the two grayscale values with the largest proportion are 0 and 255.
[0034] It can be understood that in the grayscale histogram, the horizontal axis represents the grayscale value and the vertical axis represents the probability or frequency. Therefore, the difference between the two main grayscale values reflects the contrast of the grayscale image. Specifically, if the difference between the two main grayscale values is large, it indicates that there are obvious bright and dark parts in the grayscale image, that is, the contrast of the grayscale image is high, and when the contrast of the image is subsequently enhanced, the degree of enhancement required is low; if the difference between the two main grayscale values is small, it indicates that the difference between the bright and dark parts in the grayscale image is not obvious, that is, the contrast of the grayscale image is low, and when the contrast of the image is subsequently enhanced, the degree of enhancement required is high.
[0035] In one embodiment, the gradient value and gradient direction of each pixel in the grayscale image are obtained according to the Sobel operator, and a gradient value histogram and a gradient direction histogram are drawn respectively, wherein in the gradient value histogram, the horizontal axis is the gradient value of the pixel, and the vertical axis is the frequency or probability; in the gradient direction histogram, the horizontal axis is the gradient direction of the pixel, and the vertical axis is the frequency or probability. Further, the gradient values corresponding to the two peaks with the largest values in the gradient value histogram are taken as the main gradient values; the gradient directions corresponding to the four peaks with the largest values in the gradient direction histogram are taken as the main gradient directions. It can be understood that in a grayscale image, there should be two main grayscale values, two main gradient values, and four main gradient directions.
[0036] Furthermore, the grayscale value of any pixel is obtained, and then the difference between the grayscale value of the pixel and the two main grayscale values is calculated respectively, and the main grayscale value with the smallest difference is used as the reference grayscale value of the pixel; the gradient value of the pixel is obtained, and then the difference between the gradient value of the pixel and the two main gradient values is calculated respectively, and the main gradient value with the smallest difference is used as the reference gradient value of the pixel; the gradient direction of the pixel is obtained, and then the difference between the gradient direction of the pixel and the four main gradient directions is calculated respectively, and the main gradient direction with the smallest difference is used as the reference gradient direction of the pixel. For example, if the gradient direction of a pixel is 3°, the four main gradient directions are 0°, 91°, 178° and 270° respectively, since the difference between the main gradient direction 0° and the gradient direction 3° of the pixel is the smallest, the reference gradient direction of the pixel is 0°.
[0037] Further, according to the gray value, gradient value, gradient direction, reference gray value, reference gradient value and reference gradient direction of the pixel point, the first abnormality degree of the pixel point is calculated. Specifically, the calculation expression of the first abnormality degree is as follows: ; In the formula, Indicates the first abnormality degree of the pixel, , , They represent the grayscale value, gradient value and gradient direction of the pixel respectively. , , They respectively represent the reference grayscale value, reference gradient value and reference gradient direction of the pixel.
[0038] From the above expressions, we can see that the greater the difference between the grayscale value, gradient value and gradient direction of the pixel and the reference grayscale value, reference gradient value and reference gradient direction, that is, , , The larger the value, the higher the first abnormality of the pixel. The bigger.
[0039] It should be noted here that The value range is between 0 and 90°. This is because ideally, the four main gradient directions should be 0°, 90°, 180° and 270°, and the angle between two adjacent main gradient directions is 90°. Therefore, the angle between the gradient direction of the pixel point and its reference gradient direction is The value range is between 0 and 45°. However, due to the influence of the shooting angle, the angle between two adjacent main gradient directions may be greater than or less than 90°. When the angle is greater than 90°, its maximum value will not reach 180°. Therefore, the angle between the gradient direction of the pixel point and its reference gradient direction is The value range is between 0 and 90°.
[0040] Similarly, according to the calculation expression of the first abnormality degree mentioned above, the first abnormality degree of all pixels in the grayscale image is obtained.
[0041] S103: Perform edge detection on the grayscale image, and calculate a second abnormality degree of the target edge.
[0042] In one embodiment, the canny edge detection algorithm is used to perform edge detection on the grayscale image, and each detected edge is analyzed, and the edge being analyzed is called the target edge. The first abnormality degree of all pixels on the target edge is detected by the isolation forest algorithm, and the abnormal pixels are marked.
[0043] Furthermore, the curvature of the unmarked pixel points on the target edge is obtained, and the absence of curvature is recorded as 0; the second abnormality degree of the target edge is determined according to the mean value of the curvature of the unmarked pixel points on the target edge and the mean value of the first abnormality degree, wherein the second abnormality degree is positively correlated with the average curvature of the pixel points on the target edge and the mean value of the first abnormality degree. Specifically, the calculation expression of the second abnormality degree is as follows: ; In the formula, Indicates the second abnormality degree of the target edge, Represents the total number of unmarked pixels on the edge of the target. represents the unmarked first The curvature of a pixel, represents the unmarked first The first abnormality degree of each pixel.
[0044] in, Indicates the average curvature of the target edge. If the average curvature of the target edge is small and close to 0, it means that the target edge is a straight line or the edge where the black and white areas of the QR code meet. This is because the edge of the QR code is regular, usually rectangular, so except for the turning points on the edge, the curvature of the remaining pixels should be 0. In addition, The larger the value, the greater the second abnormality of the target edge. The larger it is, the more curved the target edge is, and the less it conforms to the edge characteristics of a QR code.
[0045] Further, Indicates the mean of the first abnormality degree of all unmarked pixels on the target edge. The larger the value, the higher the second abnormality degree of the target edge. The bigger.
[0046] Since the pixels on the same edge have the same or similar features, when the first abnormality degree of most pixels on the edge is large, a few pixels with a small first abnormality degree may be caused by noise or coincidence; in addition, when the first abnormality degree of most pixels on the edge is small, a few pixels with a large first abnormality degree may be caused by noise or corner points on the edge. These abnormal pixels cannot represent edge features and will affect the accuracy of subsequent calculation of the second abnormality degree. Therefore, when calculating the second abnormality degree of the target edge, by only involving normal pixels, that is, unmarked pixels, the accuracy of calculating the second abnormality degree of the target edge is improved, thereby improving the accuracy of subsequent determination of abnormal edges, and further improving the recognition rate of the QR code.
[0047] S104: When the second abnormal value is greater than a preset threshold, filter the target edge.
[0048] Since shadows, foreign objects, light spots, etc. may cause abnormal edges, thus affecting the recognition of the QR code, the abnormal edges and their areas may be filtered to eliminate the abnormal edges, thereby improving the quality of the QR code image. Specifically, it may be determined whether the second abnormal value of the target edge is greater than a preset threshold. If so, it indicates that the target edge is an abnormal edge, and the target edge is filtered. If not, it indicates that the target edge is a normal edge, and the target edge is not filtered.
[0049] In one embodiment, the preset threshold may be 0.6. In other optional embodiments, the preset threshold may also be 0.7.
[0050] Specifically, the abnormal edge can be filtered again by means of mean filtering, median filtering or Gaussian filtering. In one embodiment, the abnormal edge is filtered twice by mean filtering to achieve the purpose of eliminating the abnormal edge, that is, to transform the abnormal edge into a normal edge. By transforming the abnormal edge into a normal edge, the quality of the two-dimensional code image is improved, thereby improving the recognition rate of the two-dimensional code.
[0051] In one embodiment, during the first mean filtering, the perpendicular line connecting the two pixels on the abnormal edge that are farthest apart is used as the search direction; any pixel on the abnormal edge is used as the target pixel, and the target pixel is used as the starting point to search in both directions according to the search direction, and the search is stopped when an edge pixel is encountered or the search distance is greater than a preset distance; all the searched pixels are combined into a filtering window for the target pixel (excluding the searched edge pixel), and then the target pixel is mean filtered.
[0052] In the first mean filtering, by using the pixels on the non-edge to filter the pixels on the abnormal edge, the abnormal edge can be eliminated, thereby improving the quality of the grayscale image and further improving the recognition rate of the two-dimensional code. In one embodiment, the preset distance can be set to 20.
[0053] According to the above process, mean filtering is performed on each pixel on the abnormal edge.
[0054] After the first mean filtering is completed, all the pixels previously used as the filtering window together form an area covering the abnormal edge, and mean filtering is performed in the area according to the preset window. In one embodiment, the preset window can be set to a 3×3 window or a 5×5 window.
[0055] Through the second mean filtering operation, the problem of uneven connection between abnormal edges and surrounding pixels that appeared after the first mean filtering is solved, making the QR code locally smoother without affecting the edge features existing in the QR code itself. Therefore, through two mean filterings, the abnormal edges are eliminated and the unevenness caused by eliminating the abnormal edges is avoided, ensuring that the abnormal edges are eliminated while the grayscale image is intact, improving the quality of the QR code image, and thus improving the recognition rate of the QR code.
[0056] S105: Enhance the contrast of the filtered image.
[0057] In an optional embodiment, the success rate of two-dimensional code recognition can be improved by enhancing the contrast of the filtered image. Specifically, in this embodiment, the contrast of the filtered image can be improved by performing a gamma transformation on the filtered image.
[0058] In one embodiment, the expression of gamma change is as follows: ; In the formula, Represents the grayscale value before grayscale image enhancement, Represents the grayscale value of the grayscale image after enhancement. and Respectively represent the two main grayscale values of the grayscale image, where .
[0059] It should be noted that for The normalized result is for Normalized results.
[0060] In addition, when the difference between the two main gray values The smaller it is, the lower the contrast of the QR code area is, and the higher the degree of enhancement is needed. The smaller, the The greater the enhancement degree. The larger the value, the higher the contrast of the QR code area, and the lower the degree of enhancement required. The bigger, yes The greater the distance between the gray value and the nearest main gray value, the greater the abnormality of the gray value, because ideally, the gray value should be equal to the nearest main gray value.
[0061] When the gray value is greater than When , it indicates that the gray value is larger and the main gray value closest to the gray value is , at this time, the gamma coefficient is less than 1, which can increase the gray value and thus enhance the contrast of the image. Further, from the above expression, we can see that: The larger the gray value is, the greater the degree of increase of the gray value is, so that the gray value is closer to the main gray value H2, and the better the effect of enhancing the filtered image is.
[0062] When the gray value is less than When , it indicates that the gray value is small and the main gray value closest to the gray value is If you want to enhance the contrast of the grayscale image, you need to reduce the grayscale value. At this time, the gamma coefficient If it is greater than 1, the gray value can be reduced, thereby enhancing the contrast of the image. Further, from the above expression, we can see that: The larger the value, the greater the reduction of the gray value, so that the gray value is consistent with the main gray value. The more the distance is reduced, the better the effect of enhancing the filtered image is.
[0063] Through the above gamma transformation, the contrast of the filtered image can be effectively enhanced, so that the image can be made clearer, and the two-dimensional code in the image can be better recognized, thereby improving the recognition rate of the two-dimensional code.
[0064] S106: Perform QR code recognition based on the enhanced image, and perform warehouse management based on the information obtained by the recognition.
[0065] After identifying the QR code on the image of the goods packaging bag, the information of the goods can be obtained, and then the goods can be tracked and dispatched in real time, ensuring high transparency of logistics and improving the efficiency of warehouse management. Specifically, by identifying the information obtained from the QR code, the situation of goods entering and leaving the warehouse is clarified, and automated inventory management is realized, which reduces human errors and reduces operating costs; by identifying the information obtained, the storage of goods is guided, etc., which optimizes the warehouse operation process, and at the same time combines anti-counterfeiting functions to strengthen the safety control of goods. In addition, whether it is entering the warehouse, leaving the warehouse or moving goods, it can respond and update information quickly, support real-time inventory counting, generate detailed data analysis and reports, optimize inventory structure and entry and exit strategies, and comprehensively improve the efficiency and accuracy of warehouse management.
[0066] Figure 2 It is a block diagram schematically showing the structure of the intelligent warehouse management system for packaging bags based on QR codes according to this embodiment.
[0067] The present invention also provides a packaging bag intelligent storage management system based on QR codes. Figure 2As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a QR code-based intelligent warehousing management method for packaging bags according to the first aspect of the present invention is implemented.
[0068] The system also includes other components well known to those skilled in the art, such as a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.
[0069] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0070] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A packaging bag intelligent storage management method based on QR code, characterized in that: include: Preprocess the packaging bag image that cannot recognize the QR code to obtain a grayscale image containing only the QR code area; Determine a first abnormality degree of a pixel in the grayscale image, where the calculation expression of the first abnormality degree is: ; In the formula, represents the first abnormal value of the pixel, , , Respectively represent the gray value, gradient value and gradient direction of the pixel point, , , respectively represent the reference grayscale value, reference gradient value and reference gradient direction of the pixel point; Performing edge detection on the grayscale image, and calculating a second abnormality degree of the target edge, wherein the second abnormality degree is positively correlated with an average curvature of pixels on the target edge and a mean value of the first abnormality degree; When the second abnormal value is greater than a preset threshold, filtering the target edge; The QR code is recognized based on the filtered image, and warehouse management is performed based on the recognized information.
2. The intelligent storage management method for packaging bags based on QR codes according to claim 1 is characterized in that: The packaging bag image whose QR code cannot be identified is preprocessed, including: converting the packaging bag image whose QR code cannot be identified into a grayscale image, and segmenting the grayscale image according to a semantic segmentation network.
3. The intelligent storage management method for packaging bags based on QR codes according to claim 1 is characterized in that: Performing edge detection on the grayscale image and calculating a second abnormality degree of the target edge includes: Performing anomaly detection on a first abnormality degree of pixel points on the target edge, and marking the obtained abnormal pixel points; The curvature of the unmarked pixel points is obtained, and the second abnormality degree is determined according to the average value of the curvature of the unmarked pixel points and the average value of the first abnormality degree.
4. The intelligent storage management method for packaging bags based on QR codes according to claim 3 is characterized in that: The calculation expression of the second abnormality degree is as follows: ; In the formula, Indicates the second abnormality degree of the target edge, represents the total number of unmarked pixels on the edge of the target, Indicates the unmarked first The curvature of a pixel, represents the unmarked first The first abnormality degree of each pixel.
5. The intelligent storage management method for packaging bags based on QR codes according to claim 1 is characterized in that: Filtering the target edge includes: The perpendicular line connecting the two pixels with the largest distance on the target edge is used as the search direction; Taking the target pixel point on the target edge as the starting point, searching in both directions according to the search direction, and stopping the search when an edge pixel point is encountered or the search distance is greater than a preset distance; All searched pixels form a filtering window of the target pixel, and mean filtering is performed on the target pixel.
6. The intelligent storage management method for packaging bags based on QR codes according to claim 5 is characterized in that: Also includes: All the pixel points serving as the filtering window are collectively formed into an area covering the edge of the target, and the area is subjected to mean filtering according to a preset window.
7. The intelligent storage management method for packaging bags based on QR codes according to claim 1 is characterized in that: Before performing the two-dimensional code recognition, the method further includes: enhancing the contrast of the filtered image.
8. The intelligent storage management method for packaging bags based on QR codes according to claim 7 is characterized in that: Enhancing the contrast of the filtered image includes: performing a gamma transformation on the filtered image: ; In the formula, represents the grayscale value of the grayscale image before enhancement, represents the grayscale value of the grayscale image after enhancement, and They represent the two grayscale values with the largest proportion among all the grayscale values of the grayscale image before filtering, where .
9. An intelligent storage management system for packaging bags based on QR codes, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the intelligent warehousing management method for packaging bags based on QR codes according to any one of claims 1-8 is implemented.
Citation Information
Patent Citations
Two-dimensional code recognition method and device, electronic equipment and storage medium
CN112580383A
Fold distortion QR code correcting method
CN108629221A
Two-dimensional code correction identification method and device
CN113935909A
Image processing apparatus and image processing method
US20140008442A1