Packing box text information accurate verification system based on COR error processing

By constructing a text gradient color parameter analysis mechanism and extracting accuracy parameters, the interference of text color gradient on OCR recognition under the influence of lighting was solved, achieving high-precision and complete text information extraction and ensuring the reliability of text information verification on packaging boxes.

CN120877263APending Publication Date: 2025-10-31HANGZHOU PEART PACKAGING CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510965732.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing technologies have failed to effectively address the interference of color gradients in packaging text under illumination on OCR recognition and segmentation extraction, resulting in reduced accuracy and completeness of text extraction.

Method used

By constructing a text gradient color parameter analysis mechanism, calculating the color deviation value of the time interval and the background color deviation value, generating text gradient color parameters, and comparing them with the text gradient threshold determined by experiments, the text extraction threshold is dynamically optimized. An extraction accuracy parameter and vector dot product comparison mechanism are introduced to ensure the accuracy and completeness of text extraction.

Benefits of technology

It significantly improves the recognition accuracy and integrity of gradient text under complex lighting conditions, ensures the reliability of text information verification, and provides accurate data support for product quality traceability, supply chain management, and regulatory compliance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120877263A_ABST
    Figure CN120877263A_ABST
Patent Text Reader

Abstract

The invention discloses a packaging box text information accurate verification system based on COR error processing, and relates to the technical field of information verification, the packaging box text information accurate verification system comprises three modules: an image data acquisition module acquires image data containing the number of pixel points, coordinates and RGB values in real time through a camera; the data preprocessing module performs noise reduction on the image data; the central calculation processing module extracts characters through the OCR technology and character extraction threshold values (including contour area and color threshold values) to obtain an information array, gradual change and accuracy parameters are obtained through standardized calculation, whether the characters are gradually changed or not and the extraction accuracy are analyzed according to the parameters, threshold value reanalysis is corrected if necessary, and verification is ended until the accuracy is high or no gradual change is confirmed. According to the method, firstly, a character gradient color parameter analysis mechanism is constructed, the interference of character gradient caused by illumination on OCR is solved, and the recognition precision and integrity are improved; and secondly, an extraction accuracy parameter is introduced to be compared with a vector dot product, the extraction integrity is quantitatively verified, and the verification reliability is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information verification technology, specifically to a system for accurate verification of text information on packaging boxes based on COR error processing. Background Technology

[0002] Verifying the text information on packaging boxes is an indispensable part of product lifecycle management, and OCR technology is the core tool for achieving this. The text on the packaging box serves as a direct carrier of product identity, quality, and compliance. It needs to be accurately extracted from the image into digital information through OCR technology. This information is not only related to consumers' right to know and safety of use, but also a key basis for enterprise quality traceability and supply chain management. Furthermore, it is a hard indicator to meet regulatory requirements. Once there is a deviation in OCR recognition or subsequent verification, it may trigger a series of chain risks.

[0003] For example, Chinese Patent Publication No. CN113221936A provides a method for extracting information from erroneous OCR results. This method includes obtaining the text extracted from the image via OCR; post-processing the OCR results and merging them into rows; defining an extraction template based on the information extraction target; using the global sequence alignment algorithm optimized by this invention to perform fuzzy matching between the template and all OCR rows; optimizing the matching alignment result using a similar-looking character library; and extracting the target information based on the matching alignment result. Simultaneously, this invention also provides a method for generating a similar-looking character library using a neural network recognition model. Utilizing this library allows for more effective use of information provided by misspelled characters in OCR recognition, improving the accuracy of information extraction. Compared with existing technologies, the information extraction method provided by this invention effectively addresses OCR result errors and significantly improves information extraction performance in cases of missing characters, extra characters, or misspelled characters.

[0004] However, the above solution did not take into account the influence of lighting. The gradual change in the color of the text on the packaging box would interfere with the OCR technology's recognition and segmentation of the text, reducing the accuracy and completeness of the text extraction. Summary of the Invention

[0005] Technical problems to be solved

[0006] To address the shortcomings of existing technologies, this invention provides a precise verification system for packaging box text information based on COR error processing. This system solves the problem that the gradual change in text color on the packaging box due to lighting conditions interferes with the OCR technology's recognition, segmentation, and extraction of text, thus reducing the accuracy and completeness of text extraction.

[0007] Technical solution

[0008] To achieve the above objectives, this invention provides the following technical solution: a packaging box text information accuracy verification system based on COR error processing, comprising the following specific modules: an image data acquisition module: initially acquiring image data in real time via a camera, the image data including the number of pixels, pixel coordinates, pixel brightness value, and pixel RGB color value; a data preprocessing module: performing noise reduction processing on the image data; and a central computing processing module: extracting the text from the packaging box using OCR technology and text extraction thresholds, the text extraction thresholds including a text outline area threshold and a text color threshold. The information array, including the text outline, is standardized and calculated to obtain text gradient parameters and extraction accuracy parameters. The text gradient parameters are used to analyze whether the text undergoes a gradient. If a gradient is detected, the extraction accuracy parameters are used to further analyze the text extraction accuracy. If the accuracy is low, the text extraction threshold is adjusted, and the accuracy is re-analyzed using the extraction accuracy parameters until a high accuracy is found. If high accuracy is achieved, the verification ends. If no gradient is detected, the verification ends directly.

[0009] Further, the specific method for obtaining the text information array is as follows: Image data is processed using an image contour segmentation algorithm and an image contour tracking algorithm to obtain image contours. A first matching contour is set for a given image contour and assigned a value of zero. The pixel coordinates within this image contour are summed according to the number of pixels within this image contour to obtain the contour area. The contour area is iteratively matched with the text contour area threshold. If a match is found, the first matching contour is assigned a value of M; if no match is found, the matching continues until the matching ends. A second matching contour is set for a given image contour and assigned a value of zero. The RGB color values ​​of the pixels within this image contour are summed according to the number of pixels within this image contour. The quantities are summed and then averaged to obtain the average RGB color value of the contour. The average RGB color value of the contour is matched with the text color threshold. If a match is found, the second matching contour is assigned a value of N. If no match is found, the matching continues until the matching ends. The values ​​of the first and second matching contours are summed and assigned to this image contour. The value of the image contour is compared with M+N. If the value of the image contour is equal to M+N, then this image contour is a text contour and is recorded and stored to obtain a text information array. That is, the image contours in the text information array are text contours. If the value of the image contour is not equal to M+N, the comparison continues until the comparison ends.

[0010] Furthermore, the specific method for traversing and matching the outline area with the text outline area threshold is as follows: calculate the difference between a certain outline area and a certain text outline area threshold, and take the absolute value to obtain the area deviation value. Compare the area deviation value with zero. If the area deviation value is equal to zero, it means that a match has been made. If the area deviation value is greater than zero, it means that a match has not been made.

[0011] Furthermore, the specific method for matching the average RGB color value of the outline with the text color threshold is as follows: Since the RGB color value of a pixel includes red channel value, green channel value, and blue channel value, the average RGB color value of the outline includes average red channel value, average green channel value, and average blue channel value. The text color threshold includes red channel threshold, green channel threshold, and blue channel threshold. The difference between the average red channel value and the red channel threshold is calculated, and the absolute value is taken to obtain the red deviation value. The difference between the average green channel value and the green channel threshold is calculated, and the absolute value is taken to obtain the green deviation value. The difference between the average blue channel value and the blue channel threshold is calculated, and the absolute value is taken to obtain the blue deviation value. The red deviation value, green deviation value, and blue deviation value are all compared with zero. If the red deviation value, green deviation value, and blue deviation value are all equal to zero, then a match is found. If the red deviation value, green deviation value, or blue deviation value are not equal to zero, then a match is not found.

[0012] Further, the specific method for obtaining the text gradient color parameters is as follows: A text gradient detection time period is set. The average RGB color value of the text outline at the previous moment and the average RGB color value of the outline at the next moment are comprehensively calculated to obtain the time interval color deviation value. The image outline of the packaging box is recorded and stored according to historical experiments to obtain the packaging box outline. The RGB color values ​​of the pixels within the packaging box outline are summed and averaged according to the number of pixels within this image outline to obtain the packaging box outline color value. The packaging box outline color value includes the packaging box red channel value, packaging box green channel value, and packaging box blue channel value. Within the text gradient detection time period, the average RGB color values ​​of the text outline are summed and averaged according to the time series to obtain the text gradient average color value. The text gradient average color value includes the average red channel value, the average green channel value, and the average blue channel value of the detection time period. The text gradient average color value and the packaging box outline color value are comprehensively calculated to obtain the background color deviation value. The time interval color deviation value and the background color deviation value are comprehensively calculated to obtain the text gradient color parameters. Where JC represents the text gradient color parameter, YP represents the time interval color deviation value, JP represents the background color deviation value, and k is a positive real number to avoid the text gradient color parameter being meaningless when the background color deviation value is zero.

[0013] Furthermore, the specific method for obtaining the time interval color deviation value is as follows: calculate the difference between the average RGB color value of the text outline at the previous moment and the average RGB color value of the outline at the next moment, take the absolute value to obtain the individual color deviation value. Let the time series within the text gradient detection time period be n, then the number of individual color deviation values ​​is n-1. Sum the individual color deviation values ​​according to the number of individual color deviation values ​​to obtain the time interval color deviation value. Where YP represents the color deviation value over a time interval, and n-1 represents the number of individual color deviation values, Y 前 This represents the average RGB color value of the text outline at the moment before the outline appears. 后 Represents the average RGB color value of the outline at the next moment, |Y 前 -Y 后 | indicates a single color deviation value.

[0014] Furthermore, the specific method for analyzing whether text undergoes a gradient using text gradient color parameters is as follows: set a text gradient threshold, compare the text gradient color parameters with the text gradient threshold, if the text gradient color parameters are greater than the text gradient threshold, it indicates that the text has undergone a gradient, and if the text gradient color parameters are less than or equal to the text gradient threshold, it indicates that the text has not undergone a gradient.

[0015] Furthermore, the specific setting method for the text gradient threshold is as follows: Under experimental lighting, the background color deviation value between the average color value of the text gradient and the color value of the packaging box outline is recorded to obtain a background color deviation set, that is, the background color deviation set includes different background color deviation values ​​under experimental lighting, denoted as JP. 模版 When the text color does not change gradient, the color deviation value over the time interval is zero, and the lighting conditions are equal to the experimental lighting conditions, then the text gradient color parameters are... That is, the text gradient threshold is

[0016] Furthermore, the specific method for obtaining the extraction accuracy parameter is as follows: The extracted text contours are labeled with IDs according to the extraction order, indicating the uniqueness of the text contour in the extraction order, and the IDs are converted into vectors to obtain text vectors. Since the IDs are unique, the text vectors are also unique. The number of text vectors is counted to obtain the number of text vectors. The sum of the text vectors is calculated based on the number of text vectors to obtain the sum of the text vectors, which is recorded as the accuracy parameter.

[0017] Furthermore, the specific method for continuing to analyze the accuracy of text extraction by extracting accuracy parameters is as follows: set an accuracy threshold, which is the sum of standard text vectors obtained under experimental conditions, and calculate the cosine value by combining the accuracy parameters and the accuracy threshold using the vector dot product method. Where cosα represents the cosine value, and it is between -1 and 1. Indicates the accuracy parameter. Indicates the accuracy threshold. The modulus representing the accuracy parameter The modulus of the accuracy threshold is represented by the cosine value. The cosine value is compared with one. If the cosine value is equal to one, it means that the accuracy parameter is equal to the accuracy threshold. If the cosine value is not equal to one, it means that the accuracy parameter is not equal to the accuracy threshold.

[0018] Beneficial effects

[0019] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0020] 1. By constructing a text gradient color parameter analysis mechanism, the interference problem of text color gradient caused by illumination on OCR recognition is effectively solved. It generates text gradient color parameters by calculating the color deviation value of the time interval and the background color deviation value, and compares them with the text gradient threshold determined by experiments to accurately determine whether the text has undergone gradient. When a gradient is detected, the text extraction threshold is adjusted to dynamically optimize the text extraction process until high accuracy is achieved, which significantly improves the recognition accuracy and completeness of gradient text under complex lighting conditions.

[0021] 2. By introducing an extraction accuracy parameter and a vector dot product comparison mechanism, the completeness of text extraction is quantitatively verified. Each extracted text outline is assigned a unique ID and converted into a vector. The sum of the vectors is used as the accuracy parameter, and a cosine value is calculated with the accuracy threshold of the experimental standard. If the cosine value is 1, it indicates that the extracted text is completely consistent with the standard in terms of order, quantity, and outline, ensuring the integrity of the text information. If they are inconsistent, the threshold is adjusted and the text is re-extracted, ultimately ensuring the reliability of the verification of the text information on the packaging box and providing accurate data support for product quality traceability, supply chain management, and regulatory compliance.

[0022] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0023] Figure 1 This invention provides a flowchart of a method for accurate verification of text information on packaging boxes based on COR error processing.

[0024] Figure 2This invention relates to a structural diagram of a packaging box text information accurate verification system based on COR error processing. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.

[0027] Example 1:

[0028] like Figures 1-2 As shown, this embodiment of the invention provides a system for accurate verification of text information on packaging boxes based on COR error processing, comprising the following specific modules:

[0029] Image data acquisition module: Starts to acquire image data in real time through the camera. The image data includes the number of pixels, pixel coordinates, pixel brightness value, and pixel RGB color value.

[0030] Data preprocessing module: Performs noise reduction on image data to improve image quality.

[0031] The central computing and processing module uses OCR technology and a text extraction threshold to extract the text from the packaging box of the denoised image data, resulting in a text information array. This array is then standardized to eliminate dimensional differences and convert values ​​of different orders of magnitude to a unified value. Finally, it performs comprehensive calculations to obtain text gradient parameters and extraction accuracy parameters. The module analyzes whether the text undergoes a gradient. If a gradient is detected, the extraction accuracy is further analyzed using the extraction accuracy parameters. If the accuracy is low, the text extraction threshold is adjusted, and the accuracy is re-analyzed using the extraction accuracy parameters until a high accuracy is achieved. If high accuracy is found, the verification process ends. If no gradient is detected, the verification process ends directly.

[0032] The specific method for obtaining the text information array is as follows:

[0033] Image data is processed using image contour segmentation and image contour tracking algorithms. Image contour segmentation algorithms, such as the Sobel algorithm, first convert the image data to grayscale to simplify calculations. Then, they use 3×3 convolution kernels in the horizontal and vertical directions to obtain the horizontal and vertical gradient matrices. Next, they calculate the gradient magnitude and direction, with the former determining the edge and the latter determining the edge extension direction. Finally, they use threshold binarization to mark pixels above the threshold as contours, thus obtaining the image contour. Image contour tracking algorithms, such as the Lucas-Kanade optical flow method, establish optical flow constraint equations based on the assumption that the brightness values ​​of pixels in adjacent frames are constant. They calculate the spatial and temporal gradients using the Sobel algorithm and frame difference. Assuming that the neighborhood motion is consistent, they construct an overdetermined system of equations and solve for the optical flow velocity using the least squares method. Finally, they perform tracking and position updates to track the image contour.

[0034] The text extraction threshold includes the text outline area threshold and the text color threshold. The text outline area threshold is obtained by recording and storing the outline area of ​​the text to be extracted based on historical experiments. The RGB color value of the pixel includes the red channel value, green channel value and blue channel value. The red channel value, green channel value and blue channel value of the text to be extracted are recorded and stored sequentially based on historical experiments to obtain the text color threshold. That is, the text color threshold includes the red channel threshold, green channel threshold and blue channel threshold.

[0035] Set a first matching contour for a certain image contour and assign it a value of zero. Sum the coordinates of the pixels in this image contour according to the number of pixels in this image contour to obtain the contour area. Iterate and match the contour area with the text contour area threshold. If a match is found, assign the value M to the first matching contour. If no match is found, continue matching until the matching ends.

[0036] Set a second matching contour for a certain image contour and assign it a value of zero. Sum the RGB color values ​​of the pixels in this image contour according to the number of pixels in this image contour and then take the average to obtain the average RGB color value of the contour. Match the average RGB color value of the contour with the text color threshold. If a match is found, assign N to the second matching contour. If no match is found, continue matching until the matching ends.

[0037] The values ​​of the first and second matching contours are summed and assigned to the image contour. The image contour value is then compared with M+N. If the image contour value is equal to M+N, the image contour is a text contour and is recorded and stored to obtain a text information array. That is, the image contours in the text information array are text contours. If the image contour value is not equal to M+N, the comparison continues until the comparison ends.

[0038] The specific method for iterating and matching the outline area with the text outline area threshold is as follows:

[0039] The area of ​​a certain outline is calculated by subtracting the area threshold of a certain text outline and taking the absolute value to obtain the area deviation value. The area deviation value is compared with zero. If the area deviation value is equal to zero, it means that there is a match. If the area deviation value is greater than zero, it means that there is no match.

[0040] The specific method for matching the average RGB color value of the outline with the text color threshold is as follows:

[0041] Since the RGB color values ​​of a pixel include red, green, and blue channel values, the average RGB color values ​​of the outline include average red, average green, and average blue channel values. The text color threshold includes red, green, and blue channel thresholds. Therefore, the difference between the average red channel value and the red channel threshold is calculated, and the absolute value is taken to obtain the red deviation value. Similarly, the difference between the average green channel value and the green channel threshold is calculated, and the absolute value is taken to obtain the green deviation value. The difference between the average blue channel value and the blue channel threshold is calculated, and the absolute value is taken to obtain the blue deviation value. All three values ​​are then compared to zero. If all three values ​​are equal to zero, a match is found. If none of these values ​​are equal to zero, a match is not found.

[0042] The specific method for obtaining the text gradient color parameters is as follows:

[0043] A text gradient detection time period is set to detect color changes in text within a certain time frame. Within this time period, the average RGB color value of the text outline at the previous moment and the average RGB color value at the next moment are combined to calculate the time interval color deviation value, which reflects the color change of the text outline. Based on historical experiments, the image outline of the packaging box is recorded and stored to obtain the packaging box outline. The RGB color values ​​of the pixels within the packaging box outline are summed according to the number of pixels within this image outline, and then averaged to obtain the packaging box outline color value. The packaging box outline color value includes the red channel value, green channel value, and blue channel value of the packaging box. Within the text gradient detection time period, the average RGB color value of the text outline is calculated based on the time series. Then, the summation and averaging are performed to obtain the average color value of the text gradient. The average color value of the text gradient includes the average red channel value, the average green channel value, and the average blue channel value of the detection time period. It is used to reflect the average color of the text outline within the text gradient detection time period. The average color value of the text gradient is combined with the color value of the packaging box outline to obtain the background color deviation value. It is used to reflect the convergence of the color of the gradient text and the background color of the packaging box within the text gradient detection time period. Because the illumination of light will make the reflective intensity of each part of the gradient text approach the background, the original color contrast is weakened, resulting in visual color convergence, which also indicates the color gradient of the text. The time interval color deviation value and the background color deviation value are combined to obtain the text gradient color parameters.

[0044]

[0045] Where JC represents the text gradient color parameter, YP represents the time interval color deviation value. The larger the time interval color deviation value, the larger the text gradient color parameter. JP represents the background color deviation value. The smaller the background color deviation value, the more similar the text color is to the background color of the packaging box. k is a positive real number to avoid the text gradient color parameter being meaningless when the background color deviation value is zero.

[0046] The specific method for obtaining the color deviation value over the time interval is as follows:

[0047] The difference between the average RGB color value of the text outline at the previous moment and the average RGB color value of the outline at the next moment is calculated, and the absolute value is taken to obtain the individual color deviation value. Let the time series within the text gradient detection time period be n, then the number of individual color deviation values ​​is n-1. The individual color deviation values ​​are summed according to the number of individual color deviation values ​​to obtain the time interval color deviation value.

[0048]

[0049] Where YP represents the color deviation value over a time interval, and n-1 represents the number of individual color deviation values, Y 前 This represents the average RGB color value of the text outline at the moment before the outline appears. 后 Represents the average RGB color value of the outline at the next moment, |Y 前 -Y 后 | indicates a single color deviation value.

[0050] The specific method for obtaining the background color deviation value is as follows:

[0051] The difference between the average color value of the text gradient and the color value of the packaging box outline is calculated, and the absolute value is taken to obtain the background color deviation value;

[0052] BC = |WY 红 -HY 红 |+|WY 绿 -HY 绿 |+|WY 蓝 -HY 蓝 |;

[0053] Where BC represents the background color deviation value, and WY 红 HY represents the average red channel value over the detection period. 红 This indicates the red channel value of the packaging box, WY. 绿 HY represents the average green channel value over the detection period. 绿 Indicates the green channel value of the packaging box, WY 蓝 HY represents the average blue channel value over the detection period. 蓝 This indicates the blue channel value of the packaging box.

[0054] The specific method for analyzing whether text undergoes a gradient using text gradient color parameters is as follows:

[0055] Set a text gradient threshold. Compare the text gradient color parameter with the text gradient threshold. If the text gradient color parameter is greater than the text gradient threshold, it means that the text has a gradient. If the text gradient color parameter is less than or equal to the text gradient threshold, it means that the text has no gradient.

[0056] The specific method for setting the text gradient threshold is as follows:

[0057] Under experimental lighting, the background color deviation values ​​between the average color value of the text gradient and the color value of the packaging box outline were recorded, resulting in a background color deviation set. This set includes different background color deviation values ​​under experimental lighting, denoted as JP. 模版 If the text color does not change gradually, then the color deviation value over the time interval is zero, and the lighting conditions are equal to the experimental lighting conditions. Therefore, the text gradient color parameters are... That is, the text gradient threshold is

[0058] Example 2 differs from Example 1 in that:

[0059] The specific methods for obtaining the accuracy parameters are as follows:

[0060] The extracted text contours are labeled with IDs according to the extraction order, indicating the uniqueness of the text contour in the extraction order. The IDs are then converted into vectors to obtain text vectors. Since the IDs are unique, the text vectors are also unique. The number of text vectors is counted to obtain the number of text vectors. The sum of the text vectors is calculated based on the number of text vectors and is recorded as the accuracy parameter.

[0061] The specific method for further analyzing the accuracy of text extraction by extracting accuracy parameters is as follows:

[0062] Set an accuracy threshold, which is the sum of standard text vectors obtained in the experiment. Calculate the cosine value by combining the accuracy parameter and the accuracy threshold using the vector dot product method.

[0063]

[0064] Where cosα represents the cosine value, and it is between -1 and 1. Indicates the accuracy parameter. Indicates the accuracy threshold. The modulus representing the accuracy parameter The modulus representing the accuracy threshold;

[0065] The cosine value is compared with 1. If the cosine value is equal to 1, it means that the accuracy parameter is equal to the accuracy threshold. That is, the text contours actually extracted according to the extraction order are the same as the text contours extracted experimentally according to the extraction order. This indicates that the extraction order is not disordered and the extracted text contours are complete. If the cosine value is not equal to 1, it means that the accuracy parameter is not equal to the accuracy threshold. That is, the text contours actually extracted according to the extraction order are not the same as the text contours extracted experimentally according to the extraction order. This indicates that the extraction order is disordered and the extracted text contours are incomplete.

[0066] The specific method for correcting the text extraction threshold is as follows:

[0067] Because the actual light source is different from the experimental light source, the text outline gradient is different from the experimental result, and the background color deviation value is also different. Through machine learning, the text outline area threshold is gradually adjusted to be the same as the outline area, and the text color threshold is gradually adjusted to be the same as the average RGB color value of the outline. In this process, the text extraction accuracy is further analyzed by extracting accuracy parameters until the text accuracy is high.

[0068] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A system for accurate verification of text information on packaging boxes based on COR error processing, characterized in that: Includes the following specific modules: Image data acquisition module: Starts to acquire image data in real time through the camera. The image data includes the number of pixels, pixel coordinates, pixel brightness value and pixel RGB color value; Data preprocessing module: performs noise reduction processing on the image data; The central computing and processing module uses OCR technology and text extraction thresholds (including text outline area and text color thresholds) to extract the text from the packaging box, resulting in a text information array. This array includes text outlines. The text information array is then standardized and comprehensively calculated to obtain text gradient parameters and extraction accuracy parameters. The text gradient parameters are used to analyze whether the text undergoes a gradient. If a gradient is detected, the extraction accuracy is further analyzed using the extraction accuracy parameters. If the accuracy is low, the text extraction threshold is adjusted, and the accuracy is re-analyzed using the extraction accuracy parameters until a high accuracy is found. If high accuracy is found, the verification ends. If no gradient is found, the verification ends directly.

2. The packaging box text information accurate verification system based on COR error processing according to claim 1, characterized in that: The specific method for obtaining the text information array is as follows: Image data is processed by image contour segmentation algorithm and image contour tracking algorithm to obtain image contour. A first matching contour is set for a certain image contour and assigned a value of zero. The coordinates of the pixels in this image contour are summed according to the number of pixels in this image contour to obtain the contour area. The contour area is traversed and matched with the text contour area threshold. If a match is found, the first matching contour is assigned a value of M. If no match is found, the matching continues until the matching ends. Set a second matching contour for a certain image contour and assign it a value of zero. Sum the RGB color values ​​of the pixels in this image contour according to the number of pixels in this image contour and then take the average to obtain the average RGB color value of the contour. Match the average RGB color value of the contour with the text color threshold. If a match is found, assign N to the second matching contour. If no match is found, continue matching until the matching ends. The values ​​of the first and second matching contours are summed and assigned to the image contour. The image contour value is then compared with M+N. If the image contour value is equal to M+N, the image contour is a text contour and is recorded and stored to obtain a text information array. That is, the image contours in the text information array are text contours. If the image contour value is not equal to M+N, the comparison continues until the comparison ends.

3. The packaging box text information accurate verification system based on COR error processing according to claim 2, characterized in that: The specific method for iterating and matching the outline area with the text outline area threshold is as follows: The area of ​​a certain outline is calculated by subtracting the area threshold of a certain text outline and taking the absolute value to obtain the area deviation value. The area deviation value is compared with zero. If the area deviation value is equal to zero, it means that there is a match. If the area deviation value is greater than zero, it means that there is no match.

4. The packaging box text information accurate verification system based on COR error processing according to claim 2, characterized in that: The specific method for matching the average RGB color value of the outline with the text color threshold is as follows: Since the RGB color values ​​of a pixel include red, green, and blue channel values, the average RGB color values ​​of the outline include average red, average green, and average blue channel values. The text color threshold includes red, green, and blue channel thresholds. Therefore, the difference between the average red channel value and the red channel threshold is calculated, and the absolute value is taken to obtain the red deviation value. Similarly, the difference between the average green channel value and the green channel threshold is calculated, and the absolute value is taken to obtain the green deviation value. The difference between the average blue channel value and the blue channel threshold is calculated, and the absolute value is taken to obtain the blue deviation value. All three values ​​are then compared to zero. If all three values ​​are equal to zero, a match is found. If none of these values ​​are equal to zero, a match is not found.

5. A packaging box text information accurate verification system based on COR error processing according to any one of claims 1 or 2, characterized in that: The specific method for obtaining the text gradient color parameters is as follows: A text gradient detection time period is set. The average RGB color value of the text outline at the previous moment and the average RGB color value of the outline at the next moment are combined to calculate the time interval color deviation value. The image outline of the packaging box is recorded and stored according to historical experiments to obtain the packaging box outline. The RGB color values ​​of the pixels in the packaging box outline are summed and averaged according to the number of pixels in this image outline to obtain the packaging box outline color value. The packaging box outline color value includes the red channel value, green channel value, and blue channel value of the packaging box. During the text gradient detection time period, the average RGB color values ​​of the text outline are summed and averaged according to the time series to obtain the text gradient average color value. The text gradient average color value includes the average red channel value, average green channel value, and average blue channel value of the detection time period. The text gradient average color value and the packaging box outline color value are combined to calculate the background color deviation value. The time interval color deviation value and the background color deviation value are combined to calculate the text gradient color parameters. Where JC represents the text gradient color parameter, YP represents the time interval color deviation value, JP represents the background color deviation value, and k is a positive real number to avoid the text gradient color parameter being meaningless when the background color deviation value is zero.

6. The packaging box text information accurate verification system based on COR error processing according to claim 5, characterized in that: The specific method for obtaining the color deviation value of the time interval is as follows: The difference between the average RGB color value of the text outline at the previous moment and the average RGB color value of the outline at the next moment is calculated, and the absolute value is taken to obtain the individual color deviation value. Let the time series within the text gradient detection time period be n, then the number of individual color deviation values ​​is n-1. The individual color deviation values ​​are summed according to the number of individual color deviation values ​​to obtain the time interval color deviation value. Where YP represents the color deviation value over a time interval, and n-1 represents the number of individual color deviation values, Y 前 This represents the average RGB color value of the text outline at the moment before the outline appears. 后 Represents the average RGB color value of the outline at the next moment, |Y 前 -Y 后 | indicates a single color deviation value.

7. The packaging box text information accurate verification system based on COR error processing according to claim 1, characterized in that: The specific method for analyzing whether text undergoes a gradient using text gradient color parameters is as follows: Set a text gradient threshold. Compare the text gradient color parameter with the text gradient threshold. If the text gradient color parameter is greater than the text gradient threshold, it means that the text has a gradient. If the text gradient color parameter is less than or equal to the text gradient threshold, it means that the text has no gradient.

8. A packaging box text information accurate verification system based on COR error processing according to claim 7, characterized in that: The specific method for setting the text gradient threshold is as follows: Under experimental lighting, the background color deviation values ​​between the average color value of the text gradient and the color value of the packaging box outline were recorded, resulting in a background color deviation set. This set includes different background color deviation values ​​under experimental lighting, denoted as JP. 模版 When the text color does not change gradient, the color deviation value over the time interval is zero, and the lighting conditions are equal to the experimental lighting conditions, then the text gradient color parameters are... That is, the text gradient threshold is 9. A system for accurate verification of text information on packaging boxes based on COR error processing according to claim 1, characterized in that: The specific method for obtaining the extraction accuracy parameter is as follows: The extracted text contours are labeled with IDs according to the extraction order, indicating the uniqueness of the text contour in the extraction order. The IDs are then converted into vectors to obtain text vectors. Since the IDs are unique, the text vectors are also unique. The number of text vectors is counted to obtain the number of text vectors. The sum of the text vectors is calculated based on the number of text vectors and is recorded as the accuracy parameter.

10. A packaging box text information accurate verification system based on COR error processing according to any one of claims 1 or 9, characterized in that: The specific method for further analyzing the accuracy of text extraction by extracting accuracy parameters is as follows: Set an accuracy threshold, which is the sum of standard text vectors obtained in the experiment. Calculate the cosine value by combining the accuracy parameter and the accuracy threshold using the vector dot product method. Where cosα represents the cosine value, and it is between -1 and 1. Indicates the accuracy parameter. Indicates the accuracy threshold. The modulus representing the accuracy parameter The modulus representing the accuracy threshold; The cosine value is compared with one. If the cosine value is equal to one, it means that the accuracy parameter is equal to the accuracy threshold. If the cosine value is not equal to one, it means that the accuracy parameter is not equal to the accuracy threshold.

Citation Information

Patent Citations

  • Method for extracting information from error OCR result

    CN113221936A