OCR (Optical Character Recognition) fuzzy recognition method under detection and shielding of medical kit ribbons

Through OCR decoding camera and image processing technology, the problem of packaging label information with occlusion is solved, comprehensive monitoring and accurate identification of medicine box information is realized, and the complete extraction of drug information is ensured.

CN120451536APending Publication Date: 2025-08-08JIN HOUNG FUH (CHUZHOU) CONVEYING EQUIP CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510514705.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

During the packaging process of medicine box, when packaging the label information with a closure of the medicine box, it is difficult for the existing technology to effectively decode and obtain key information.

Method used

The grayscale image of the medicine box is collected by OCR decoding camera, Gaussian filtering and noise reduction and edge detection are performed, the characteristic edges of the packaging tape and medicine box are calculated, the relative position coordinates are established, and the grid image is created to extract the obstructed label information and compare it with the local database.

Benefits of technology

It improves the accuracy and completeness of identification of packaging tape and label information, reduces noise interference, ensures comprehensive monitoring of information on each side of the medicine box, and improves the accuracy and efficiency of label information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451536A_ABST
    Figure CN120451536A_ABST
Patent Text Reader

Abstract

The invention relates to an OCR (Optical Character Recognition) fuzzy recognition method under medical kit binding belt detection and shielding, which relates to the technical field of computer processing, and comprises the following steps: S01, an OCR decoding camera collects continuous frames of gray level images when a medical kit arrives at a packaging station so as to obtain an image data set; s02, preprocessing the grayscale image to extract pixel features of a packing belt and pixel features of a medicine chest, and obtaining coordinates of the pixel features of the packing belt on the pixel features of the medicine chest through a predetermined algorithm; s03, the specific position of the packing belt on the medicine box is obtained through relative position coordinate conversion; and S04, the grayscale image is extracted again through OCR identification, and a label pattern shielded by the packing belt is obtained. According to the method, OCR identification and ribbon identification can be carried out at the same time, when the packing belt shields key information, fuzzy identification is adopted to match a database for reasoning information content, and therefore errors caused by follow-up action implementation of a packing belt cutting machine are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer processing technology, and in particular to a method for detecting a medicine box tie and an OCR fuzzy recognition method under occlusion. Background Art

[0002] Automated production in the medical and pharmaceutical warehousing industry requires effective and very accurate extraction of drug information, including product name, product number, product batch number, production date, expiration date, drug supervision code, etc. Since the sealing of drug transportation has high requirements for packaging, the medicine box will have strapping tape. It is necessary to determine the position of the strapping tape before automatically cutting the strapping tape to avoid the label on the medicine box and avoid obstruction (refer to Chinese patent, publication number CN110589124A, which discloses an intelligent visual packaging system). However, the label on the medicine box is posted randomly, so it is difficult to avoid the strapping tape from obstructing the label. Moreover, when key information is obscured, the obscured label is difficult to decode and obtain information during subsequent scanning and identification.

[0003] Therefore, how to decode and obtain information on the obscured label when the packaging tape obscures the key information on the label is expected to be solved well. Summary of the Invention

[0004] In response to the above technical problems, the technical solution adopted by the present invention is a method for detecting and identifying fuzzy OCR images of medicine box ties under occlusion, comprising the following steps:

[0005] S01, the OCR decoding camera collects grayscale images of consecutive frames when the medicine box arrives at the packaging station to obtain an image data set;

[0006] S02. Preprocessing the grayscale image to extract pixel features of the strapping tape and the medicine box, and obtaining coordinates of the pixel features of the strapping tape on the pixel features of the medicine box using a predetermined algorithm;

[0007] S03. Obtain the specific position of the strapping tape on the medicine box by converting the relative position coordinates;

[0008] S04, re-extracting the grayscale image through OCR recognition to obtain the label pattern blocked by the packaging tape;

[0009] S05. Establish a local database containing all drug information, compare the label pattern obscured by the packaging tape with the information in the database, and if the identification information completely matches a record in the database, the task is completed; if the identification information does not completely match, it is determined to be decoded information obscured by the packaging tape.

[0010] Preferably, each frame in the image data set in step S01 includes grayscale images of four sides and one side of the top of the box collected at the same time.

[0011] Preferably, the preprocessing of the grayscale image in step S02 includes:

[0012] S21, performing noise reduction on the grayscale image using a Gaussian filter;

[0013] S22. For the Gaussian filtered image, calculate the grayscale value difference between each pixel and its neighboring pixels to obtain the characteristic edges of the strapping tape and the medicine box;

[0014] S23: Amplify the grayscale value difference to enhance the characteristic edge of the strapping tape and the characteristic edge of the medicine box, and obtain enhanced pixel features of the strapping tape and the enhanced pixel features of the medicine box.

[0015] Preferably, the noise reduction performed by the Gaussian filter in step S21 is performed by the following formula:

[0016]

[0017] Among them, (x, y) is the relative position of the pixel in the kernel, σ is the standard deviation, and e is the grayscale value of the pixel.

[0018] Preferably, the grayscale value difference between each pixel and its neighboring pixels is calculated in step S22, including:

[0019] S221. Assume that the coordinates of each pixel point are (m,n), and the center pixel of the pixel feature is (i,j), and calculate the grayscale value difference:

[0020] Where I(i,j) is the grayscale value of the center pixel (i,j) (i,j,m,n) = |I(i,j)-I(m,n)|, and I(m,n) is the grayscale value of the other pixels (m,n) in the window.

[0021] S222. Calculate the sum of the grayscale values of all pixels in the window (excluding the center pixel):

[0022]

[0023] S223. Calculate the number of pixels in the window (excluding the center pixel):

[0024] num_neighbors = window_size - 1

[0025] Among them, window_size=9, so num_neighbors=8;

[0026] S224, calculate the average gray value difference:

[0027]

[0028] Preferably, the step S02 of obtaining the coordinates of the pixel features of the strapping tape located on the pixel features of the medicine box by a predetermined algorithm includes:

[0029] S24. Performing edge detection on the image using a one-dimensional plane edge detection algorithm to obtain a pixel feature edge image of the strapping tape and a pixel feature edge image of the medicine box, wherein the one-dimensional plane edge detection algorithm includes Canny edge detection;

[0030] S25. Based on the least squares method, linear fitting is performed on the pixel feature edge image of the strapping tape and the pixel feature edge image of the medicine box respectively, and the straight line segments in the image are identified to obtain the pixel coordinate position of the strapping tape and the pixel coordinate position of the medicine box.

[0031] Preferably, in step S03, the specific position of the strapping tape on the medicine box is obtained by converting the relative position coordinates, including:

[0032] S31, obtaining the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape;

[0033] S32, calculating the offset between the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape;

[0034] S33. Convert the offset into a position offset in actual physical size to obtain the specific position of the strapping tape on the medicine box.

[0035] Preferably, obtaining the label pattern obscured by the packing tape in step S04 includes:

[0036] S41, extracting labels from the grayscale image based on OCR recognition, creating a grid in the grayscale image, and determining the coordinates of the label information within the grid;

[0037] S42: extracting the specific position of the strapping tape on the medicine box based on the grayscale image corresponding to the location of the label, and obtaining a label pattern of multiple exposed labels after being covered.

[0038] The present invention has at least the following beneficial effects:

[0039] 1. Ensure comprehensive monitoring of medicine boxes, especially during the packaging process, and capture the strapping and label information on all sides of the medicine box, which improves the accuracy and completeness of strapping and label identification;

[0040] 2. Using a Gaussian filter for noise reduction can effectively reduce noise interference in the image and improve image quality. Calculating the grayscale difference between each pixel and its neighboring pixels and amplifying it enhances the characteristic edges of the strapping tape and medicine box, making feature extraction more accurate and clear. This helps improve the accuracy of pixel feature matching between the strapping tape and medicine box in subsequent steps. Adjusting the standard deviation σ can also control the degree of noise reduction to accommodate images of varying quality.

[0041] 3. Calculating the grayscale difference between each pixel and its neighboring pixels allows for detailed image capture, particularly the edge features of the strapping tape and medicine box. This helps improve the accuracy and sensitivity of feature extraction, providing strong support for subsequent feature matching and location determination.

[0042] 4. Labels are extracted from the grayscale image using OCR recognition, and a grid is created to determine the coordinates of the label information. The obscured label pattern is then extracted based on the specific location of the strapping tape on the medicine box. This method accurately identifies label information obscured by the strapping tape, providing crucial data support for subsequent information comparison and recognition. Furthermore, the grid-based processing improves the accuracy and efficiency of label information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 This is a flow chart of a method for detecting medicine box tie straps and OCR fuzzy recognition under occlusion provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.

[0046] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] Example 1

[0048] This embodiment provides a method for detecting and recognizing medicine box tie straps under occlusion using OCR fuzzy recognition, including the following steps: Figure 1 As shown:

[0049] S01. The OCR decoding camera collects grayscale images of consecutive frames when the medicine box arrives at the packaging station to obtain an image data set.

[0050] Specifically, each frame in the image dataset contains grayscale images of all four sides and one top of the box, captured simultaneously. In short, images of all five sides of the box are captured. One side, which is in contact with the conveyor belt and therefore not labeled, does not need to be captured.

[0051] S02. Preprocess the grayscale image to extract pixel features of the strapping tape and the medicine box, and obtain the coordinates of the pixel features of the strapping tape on the pixel features of the medicine box through a predetermined algorithm.

[0052] Specifically, preprocessing the grayscale image includes:

[0053] S21, performing noise reduction on the grayscale image using a Gaussian filter;

[0054] S22. For the Gaussian filtered image, calculate the grayscale value difference between each pixel and its neighboring pixels to obtain the characteristic edges of the strapping tape and the medicine box;

[0055] S23: Amplify the grayscale value difference to enhance the characteristic edges of the strapping tape and the medicine box, and obtain enhanced pixel features of the strapping tape and the medicine box.

[0056] Furthermore, in step S21 of the above steps, noise reduction is performed by using a Gaussian filter according to the following formula:

[0057]

[0058] Among them, (x, y) is the relative position of the pixel in the kernel, σ is the standard deviation, and e is the grayscale value of the pixel.

[0059] Furthermore, the grayscale value difference between each pixel and its neighboring pixels is calculated, including:

[0060] S221. Assume that the coordinates of each pixel point are (m,n), and the center pixel of the pixel feature is (i,j), and calculate the grayscale value difference:

[0061] Where I(i,j) is the grayscale value of the center pixel (i,j) (i,j,m,n) = |I(i,j)-I(m,n)|, and I(m,n) is the grayscale value of the other pixels (m,n) in the window.

[0062] S222. Calculate the sum of the grayscale values of all pixels in the window (excluding the center pixel):

[0063]

[0064] S223. Calculate the number of pixels in the window (excluding the center pixel):

[0065] mum_neighbors=window_size-1

[0066] Among them, window_size=9, so num_neighbors=8;

[0067] S224, calculate the average gray value difference:

[0068]

[0069] Furthermore, in the above embodiment, the coordinates of the pixel features of the strapping tape located on the pixel features of the medicine box are obtained by a predetermined algorithm, including:

[0070] S24. Performing edge detection on the image using a one-dimensional plane edge detection algorithm to obtain a pixel feature edge image of the strapping tape and a pixel feature edge image of the medicine box. The one-dimensional plane edge detection algorithm includes a Canny edge detection algorithm.

[0071] S25. Based on the least squares method, linear fitting is performed on the pixel feature edge image of the strapping tape and the pixel feature edge image of the medicine box respectively, and the straight line segments in the image are identified to obtain the pixel coordinate position of the strapping tape and the pixel coordinate position of the medicine box.

[0072] In the above technology,

[0073] Using a Gaussian filter for noise reduction effectively reduces image noise and improves image quality. Calculating the grayscale difference between each pixel and its neighboring pixels and then amplifying it enhances the characteristic edges of the strapping tape and medicine box, making feature extraction more accurate and clear. This helps improve the accuracy of pixel feature matching for the strapping tape and medicine box in subsequent steps. Furthermore, the specific formula for noise reduction using a Gaussian filter ensures the scientific and effective nature of the noise reduction process. By adjusting the standard deviation σ, the degree of noise reduction can be controlled to accommodate images of varying quality. This flexible noise reduction method helps improve the stability and reliability of image processing. Furthermore, calculating the grayscale difference between each pixel and its neighboring pixels meticulously captures image details, particularly the edges of the strapping tape and medicine box. This calculation method improves the accuracy and sensitivity of feature extraction, providing strong support for subsequent feature matching and position determination. Furthermore, edge detection using a one-dimensional plane edge detection algorithm (such as Canny edge detection) accurately identifies the edge features of the strapping tape and medicine box. Using the least squares method to perform linear fitting, we can further extract the pixel coordinates of the strapping tape and medicine box, providing accurate data for subsequent position conversion. This algorithm combination ensures the accuracy and efficiency of feature extraction and position determination.

[0074] S03. Obtain the specific position of the strapping tape on the medicine box through relative position coordinate conversion.

[0075] Specifically, the specific position of the strapping tape on the medicine box is obtained through relative position coordinate conversion, including:

[0076] S31, obtaining the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape;

[0077] S32, calculating the offset between the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape;

[0078] S33. Convert the offset into a position offset in actual physical size to obtain the specific position of the strapping tape on the medicine box.

[0079] This technique accurately determines the exact position of the strapping tape on the medicine box by obtaining the center pixel coordinates of the pixel features of the medicine box and the strapping tape, calculating the offset, and then converting the offset into a physical offset. This conversion method is simple and effective, accurately reflecting the relative position of the strapping tape and the medicine box, providing important positional information for subsequent processing steps.

[0080] S04. Re-extract the grayscale image through OCR recognition to obtain the label pattern blocked by the packaging tape.

[0081] Specifically, obtaining the label pattern obscured by the packaging tape includes:

[0082] S41, extracting labels from the grayscale image based on OCR recognition, creating a grid on the grayscale image, and determining the coordinates of the label information within the grid;

[0083] S42. Extracting the specific position of the strapping tape on the medicine box based on the grayscale image of the corresponding label, and obtaining a label pattern of multiple exposed labels after being covered.

[0084] This technology extracts labels from grayscale images using optical character recognition (OCR) and creates a grid to determine the coordinates of the label information. It then extracts the obscured label pattern based on the specific location of the strapping tape on the medicine box. This method accurately identifies label information obscured by the strapping tape, providing crucial data support for subsequent information comparison and recognition. Furthermore, the grid-based processing improves the accuracy and efficiency of label information extraction.

[0085] S05. Establish a local database containing all drug information, and compare the label pattern obscured by the packaging tape with the information in the database. If the identification information completely matches a record in the database, the task is completed; if the identification information does not completely match, it is determined to be the decoded information obscured by the packaging tape.

[0086] In the above technology, multiple labels of all drug information are created in a local database in advance to generate a subsequent comparison database. Then, based on the extracted label patterns of multiple masked labels, a match is performed with the comparison database. If all the masked labels can be matched to a single label, it is determined that the ambiguous label information has been obtained, and then decoding is performed to obtain the drug information.

[0087] If the exposed label patterns of all the covered labels can be matched with more than one label, it is determined that the fuzzy label analysis has multifunctional possibilities, and then steps S03-S04 are re-executed to obtain the label patterns blocked by the packaging tape again until the exposed label patterns of all the covered labels can be matched with one label.

[0088] This first embodiment ensures comprehensive monitoring of the medicine box, particularly during the packaging process. It captures information about the strapping tape and labels on all sides of the medicine box, improving the accuracy and completeness of strapping tape and label identification. Furthermore, noise reduction processing using a Gaussian filter effectively reduces noise interference in the image, improving image quality. Calculating the grayscale value difference between each pixel and its neighboring pixels and amplifying the image enhances the characteristic edges of the strapping tape and the medicine box, making feature extraction more accurate and clear, and helping to improve the accuracy of pixel feature matching between the strapping tape and the medicine box in subsequent steps. Adjusting the standard deviation σ allows for control over the degree of noise reduction to accommodate images of varying quality. Furthermore, calculating the grayscale value difference between each pixel and its neighboring pixels meticulously captures detailed changes in the image, particularly the edge features of the strapping tape and the medicine box. This helps improve the accuracy and sensitivity of feature extraction, providing strong support for subsequent feature matching and location determination. Furthermore, OCR-based label recognition extracts labels from the grayscale image, creating a grid to determine the coordinates of the label information. The masked label pattern is then extracted based on the specific location of the strapping tape on the medicine box. This method can accurately identify label information obscured by packaging tape, providing important data support for subsequent information comparison and recognition. Furthermore, through grid-based processing, the accuracy and efficiency of label information extraction are improved.

[0089] Example 2

[0090] An embodiment of the present invention provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the steps:

[0091] The OCR decoding camera collects grayscale images of consecutive frames when the medicine box arrives at the packaging station to obtain an image data set;

[0092] Preprocessing the grayscale image to extract pixel features of the strapping tape and the medicine box, and obtaining the coordinates of the pixel features of the strapping tape on the pixel features of the medicine box through a predetermined algorithm;

[0093] By converting the relative position coordinates, the specific position of the strapping tape on the medicine box can be obtained.

[0094] The grayscale image is extracted again through OCR recognition to obtain the label pattern blocked by the packaging tape;

[0095] A local database containing all drug information is established, and the label pattern obscured by the packaging tape is compared with the information in the database. If the identification information completely matches a record in the database, the task is completed; if the identification information does not completely match, it is determined to be the decoded information obscured by the packaging tape.

[0096] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0097] Those skilled in the art will clearly understand that for the sake of convenience and brevity in description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0098] Example 3

[0099] An embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the following steps:

[0100] The OCR decoding camera collects grayscale images of consecutive frames when the medicine box arrives at the packaging station to obtain an image data set;

[0101] Preprocessing the grayscale image to extract pixel features of the strapping tape and the medicine box, and obtaining the coordinates of the pixel features of the strapping tape on the pixel features of the medicine box through a predetermined algorithm;

[0102] By converting the relative position coordinates, the specific position of the strapping tape on the medicine box can be obtained.

[0103] The grayscale image is extracted again through OCR recognition to obtain the label pattern blocked by the packaging tape;

[0104] A local database containing all drug information is established, and the label pattern obscured by the packaging tape is compared with the information in the database. If the identification information completely matches a record in the database, the task is completed; if the identification information does not completely match, it is determined to be the decoded information obscured by the packaging tape.

[0105] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the present profession can make some changes or modifications to equivalent embodiments of the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for detecting and recognizing medicine box tie straps under occlusion using OCR fuzzy recognition, characterized in that: The steps include: S01, the OCR decoding camera collects grayscale images of consecutive frames when the medicine box arrives at the packaging station to obtain an image data set; S02. Preprocessing the grayscale image to extract pixel features of the strapping tape and the medicine box, and obtaining coordinates of the pixel features of the strapping tape on the pixel features of the medicine box using a predetermined algorithm; S03. Obtain the specific position of the strapping tape on the medicine box by converting the relative position coordinates; S04, re-extracting the grayscale image through OCR recognition to obtain the label pattern blocked by the packaging tape; S05. Establish a local database containing all drug information, compare the label pattern obscured by the packaging tape with the information in the database, and if the identification information completely matches a record in the database, the task is completed; if the identification information does not completely match, it is determined to be decoded information obscured by the packaging tape.

2. The method for detecting and recognizing medicine box tie straps and occluded OCR fuzzy images according to claim 1, characterized in that: Each frame in the image data set in step S01 includes grayscale images of four sides and one side of the top of the box collected at the same time.

3. The method for detecting and recognizing medicine box tie straps under occlusion according to claim 1 is characterized in that: The pre-processing of the grayscale image in step S02 includes: S21, performing noise reduction on the grayscale image using a Gaussian filter; S22. For the Gaussian filtered image, calculate the grayscale value difference between each pixel and its neighboring pixels to obtain the characteristic edges of the strapping tape and the medicine box; S23: Amplify the grayscale value difference to enhance the characteristic edge of the strapping tape and the characteristic edge of the medicine box, and obtain enhanced pixel features of the strapping tape and the enhanced pixel features of the medicine box.

4. The method for detecting and recognizing medicine box tie straps under occlusion according to claim 3 is characterized in that: In step S21, the noise reduction is performed by using a Gaussian filter according to the following formula: Among them, (x, y) is the relative position of the pixel in the kernel, σ is the standard deviation, and e is the grayscale value of the pixel.

5. The method for detecting and recognizing medicine box tie straps under occlusion according to claim 3 is characterized in that: Calculating the grayscale value difference between each pixel and its neighboring pixels in step S22 includes: S221. Assume that the coordinates of each pixel point are (m,n), and the center pixel of the pixel feature is (i,j), and calculate the grayscale value difference: (i,j,m,n)=|I(i,j)-I(m,n)| Among them, I(i,j) is the grayscale value of the center pixel (i,j), and I(m,n) is the grayscale value of other pixels (m,n) in the window; S222. Calculate the sum of the grayscale values of all pixels in the window (excluding the center pixel): S223. Calculate the number of pixels in the window (excluding the center pixel): num_neighbors = window_size - 1 Among them, window_size=9, so num_neighbors=8; S224, calculate the average gray value difference:

6. The method for detecting and recognizing medicine box tie straps and occluded OCR fuzzy images according to claim 1, characterized in that: The step S02 of obtaining the coordinates of the pixel features of the strapping tape located on the pixel features of the medicine box by a predetermined algorithm includes: S24. Performing edge detection on the image using a one-dimensional plane edge detection algorithm to obtain a pixel feature edge image of the strapping tape and a pixel feature edge image of the medicine box, wherein the one-dimensional plane edge detection algorithm includes Canny edge detection; S25. Based on the least squares method, linear fitting is performed on the pixel feature edge image of the strapping tape and the pixel feature edge image of the medicine box respectively, and the straight line segments in the image are identified to obtain the pixel coordinate position of the strapping tape and the pixel coordinate position of the medicine box.

7. The method for detecting and recognizing medicine box tie straps under occlusion according to claim 1 is characterized in that: In step S03, the specific position of the strapping tape on the medicine box is obtained by converting the relative position coordinates, including: S31, obtaining the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape; S32, calculating the offset between the center pixel coordinates of the pixel features of the medicine box and the center pixel coordinates of the pixel features of the packing tape; S33. Convert the offset into a position offset in actual physical size to obtain the specific position of the strapping tape on the medicine box.

8. The method for detecting and recognizing medicine box tie straps under occlusion according to claim 1 is characterized in that: The step S04 of obtaining the label pattern obscured by the packing tape includes: S41, extracting labels from the grayscale image based on OCR recognition, creating a grid in the grayscale image, and determining the coordinates of the label information within the grid; S42: extracting the specific position of the strapping tape on the medicine box based on the grayscale image corresponding to the location of the label, and obtaining a label pattern of multiple exposed labels after being covered.

9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the medicine box tie detection and OCR fuzzy recognition method under occlusion as described in any one of claims 1-8.

10. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the medicine box tie detection and occluded OCR fuzzy recognition method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Intelligent visual packing system

    CN110589124A