A Method and System for Intelligent Conversion of Unformatted Weighbridge Slips Based on Image Recognition

By employing techniques such as weighted average method, Otsu algorithm and multi-level rule verification, the problems of tilt angle detection and noise removal in unformatted weighbridge slips have been solved, achieving high-accuracy text recognition and data verification, and improving processing efficiency and compliance.

CN120913230BActive Publication Date: 2025-12-02RONGCHENG ZHIYUN TECHNOLOGY (TIANJIN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511453146.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2025-12-02
Estimated Expiration
2045-10-13

AI Technical Summary

Technical Problem

Existing technologies for processing unformatted weighbridge slips suffer from low accuracy in tilt angle detection, and limitations in noise filtering and contrast enhancement due to scene constraints. This results in unstable OCR recognition accuracy, and the lack of unified verification standards makes it difficult to fully cover industry norms and corporate policies, leading to excessive manual intervention and low processing efficiency.

Method used

We employ a weighted average method and the Otsu algorithm for grayscale conversion and threshold calculation, combined with probabilistic Hough transform and median filtering for tilt correction and noise removal, dynamically switching between PaddleOCR and Tesseract engines for text recognition, constructing a list-specific dictionary, and using multi-level rule verification for data validation, including basic, relational, and compliance verification.

Benefits of technology

It improves the accuracy of text recognition for unformatted weighbridge slips, enhances adaptability in complex scenarios, reduces manual intervention, ensures data accuracy and compliance, and improves processing efficiency and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120913230B_ABST
    Figure CN120913230B_ABST
Patent Text Reader

Abstract

This invention discloses an intelligent conversion method and system for unformatted weight slips based on image recognition. This invention relates to the field of intelligent text recognition technology, solving the technical problems of low accuracy in tilt angle detection and scene-dependent noise filtering and contrast enhancement, leading to unstable OCR recognition accuracy. This invention improves tilt angle detection accuracy by employing table line detection and text line analysis for structured / unformatted weight slips respectively. Layered denoising and adaptive contrast enhancement improve text recognition accuracy in complex scenes. PaddleOCR is dynamically switched based on the proportion of Chinese characters, combined with a low-confidence region re-examination mechanism to reduce the recognition error rate. A weight slip domain dictionary and relationship graph are constructed to achieve intelligent terminology matching and error correction, solving the problem of recognizing rare words and industry-specific vocabulary. A layered rule system of basic verification, association verification, and compliance verification is adopted, covering all dimensions of format, logic, and industry / enterprise compliance, improving verification coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent text recognition technology, specifically to an intelligent conversion method and system for non-formatted bills based on image recognition. Background Technology

[0002] In logistics, freight, warehousing and other fields, weighbridge slips serve as core credentials for cargo weight, transaction amount, and transportation information. Their processing efficiency and data accuracy directly affect business operations and financial settlements.

[0003] With the development of OCR technology and automated systems, some enterprises have introduced image preprocessing and text recognition tools. However, existing solutions mostly use a single engine for recognition and fixed rule verification, which is difficult to cope with the actual needs of diverse weighbridge slip types, mixed information, and complex business scenarios. A lot of manual intervention is still required, which restricts the improvement of automation processing level. Traditional weighbridge slip processing relies heavily on manual input and review, which has the following limitations:

[0004] First, manual recognition of handwritten or blurry weighbridge slips takes a long time, and is prone to backlog, especially when dealing with batch processing.

[0005] Secondly, the accuracy is low: due to limitations of human experience, data deviations are easily caused by text recognition errors and oversights in format verification.

[0006] Thirdly, the lack of unified verification standards makes it difficult to fully cover industry norms, corporate systems, and policies and regulations.

[0007] Fourth, weighbridge images are often difficult to identify due to shooting conditions, and existing preprocessing methods are not adaptable to complex scenes. Summary of the Invention

[0008] To address the shortcomings of existing technologies, this invention provides an intelligent conversion method and system for unformatted weight slips based on image recognition, which solves the problems of low accuracy in tilt angle detection, noise filtering and contrast enhancement effects being limited by the scene, leading to unstable accuracy of subsequent OCR recognition.

[0009] To achieve the above objectives, the present invention provides the following technical solution: an intelligent conversion method for unformatted weight slips based on image recognition, which specifically includes the following steps:

[0010] Step 1: Collect unformatted weighbridge slip images from the on-board terminal of the logistics transport vehicle or the terminal uploaded manually via HTTP protocol, or receive weighbridge slip image files via FTP server.

[0011] Step 2: Convert the RGB three-color channels of the collected weighbridge image to grayscale values ​​using a weighted average method. At the same time, use the Otsu algorithm to calculate the global threshold and local threshold to obtain the grayscale image.

[0012] Step 3: Apply probabilistic Hough transform to the obtained grayscale image for tilt correction, and perform noise reduction through median filtering. At the same time, automatically calculate the Gamma value of the overall image brightness to obtain the preprocessed bill image.

[0013] Step 4: Select different recognition engines based on the text ratio in the preprocessed weighbridge image, and build a weighbridge domain dictionary by combining historical data;

[0014] Step 5: Use multi-level rule verification to verify the structured data in the preprocessed weighbridge image, generate error reasons, classify the error reasons, and generate corresponding processing information.

[0015] As a further aspect of the present invention, the specific method for obtaining the grayscale image is as follows:

[0016] The RGB three-color channels are converted to grayscale values ​​using a weighted average method. The formula is grayscale value = 0.299 × R + 0.587 × G + 0.114 × B, where R, G, and B represent the red, green, and blue channel values, respectively. For weighbridge slips containing red or blue stamps, the blue channel is extracted, and the B channel is blended with the base grayscale image at a 7:3 ratio.

[0017] The global threshold T1 is calculated using the Otsu algorithm. The image is divided into 8×8 sub-blocks. The local threshold T2 is calculated by subtracting an offset of 2-5 from the Gaussian weighted average of the pixels in the sub-block. If T2 < 0.8 × T1, T2 is used for verification. If T2 > 1.2 × T1, T1 is used for verification. In other cases, a weighted threshold of T = 0.6 × T1 + 0.4 × T2 is used.

[0018] As a further aspect of the present invention, the specific method for obtaining the preprocessed weight slip image is as follows:

[0019] For structured order sheets, table lines are extracted using probabilistic Hough transform, line segments shorter than 50 pixels are filtered out, and the angle with the highest frequency of occurrence is taken as the tilt angle. For order sheets without tables, the MSER algorithm is used to locate the text area, effective areas with an area exceeding 200 pixels are selected, the main direction of the text lines is fitted, and outliers are removed to determine the tilt angle. The image is rotated according to the tilt angle, and after cropping the edges, bilinear interpolation is selected to optimize the image quality based on the resolution.

[0020] Random noise is cleaned using 3×3 median filtering combined with morphological opening operation; Gaussian noise is cleaned using bilateral filtering or nonlocal mean filtering; distinctive noise is cleaned using nonlocal mean filtering and iterative repair. The Gamma value is calculated based on the average image brightness, and histogram equalization is performed on the image blocks.

[0021] As a further aspect of the present invention, the specific method for constructing the list domain dictionary is as follows:

[0022] The preprocessed weighbridge image is subjected to text recognition, and the text in the image is converted into editable text. The proportion of Chinese characters in the weighbridge text is detected. When the proportion is >60%, PaddleOCR is used, and when the proportion is ≤60%, Tesseract is used. The image region is divided and the recognition confidence is calculated. For regions with a confidence of <85%, another engine is triggered for re-examination.

[0023] Based on historical data, industry documents, and enterprise knowledge bases, a rule-based dictionary containing entity relationships is constructed after data cleaning, terminology extraction, classification, and word vector clustering.

[0024] As a further aspect of the present invention, the multi-level rule verification includes basic verification, correlation verification, and compliance verification. The basic verification includes format verification and value range verification, the correlation verification includes the relationship between numerical values ​​and entities, and the compliance verification includes industry and enterprise rules.

[0025] As a further aspect of the present invention, the specific method for classifying the causes of errors is as follows:

[0026] The cause of the error is identified and the severity of the error is classified. If the error seriously violates business logic or regulatory requirements, resulting in completely invalid data, it must be dealt with immediately and is classified as a fatal error. If the error affects critical business processes but can be remedied with temporary measures and does not affect business operations, and there are potential risks or room for optimization, it is classified as a repairable error.

[0027] As a further aspect of the present invention, the specific method for generating the corresponding processing information is as follows:

[0028] To handle fatal errors, suspend all subsequent business processes, lock data modification permissions, highlight the error field in the structured data report with a specific description of the violation, and automatically associate the data source.

[0029] The system handles warning errors, allowing the data to proceed to subsequent stages, but marks it with an orange warning label on the interface, automatically generates a risk warning form, lists the deviation content, and pushes it to the business auditor;

[0030] For recoverable errors, the system will correct the errors according to preset rules, indicate that the system automatically corrected the errors in the data report, record the original value and the corrected value, and automatically trigger the basic rule verification after the correction.

[0031] An image recognition-based intelligent conversion system for unformatted weight slips includes:

[0032] The image acquisition module is used to acquire unformatted weighbridge images via HTTP or FTP.

[0033] The image preprocessing module uses OpenCV combined with a custom algorithm to convert color images into grayscale images, then uses binarization to highlight text regions and identify noise. Small noise is removed by value filtering, and residual noise is cleaned up by morphological operations. The tilted baggage image is rotated and corrected, and the contrast is enhanced by grayscale histogram equalization to obtain a preprocessed baggage image. PaddleOCR is then used to recognize text in the preprocessed baggage image and convert the text in the image into editable text.

[0034] The structured parsing module uses regular expressions combined with natural language processing technology to parse the editable text obtained by OCR recognition, extract key data and understand its semantics;

[0035] The data validation module uses the Drools rule engine to validate the parsed structured data, ensuring its accuracy and compliance.

[0036] This invention provides a method and system for intelligent conversion of unformatted weight slips based on image recognition. Compared with existing technologies, it has the following advantages:

[0037] This invention improves tilt angle detection accuracy by employing table line detection and text line analysis for structured / tableless weight slips, respectively. Layered denoising and adaptive contrast enhancement improve text recognition accuracy in complex scenarios. Based on the proportion of Chinese characters, it dynamically switches between PaddleOCR and Tesseract engines, combined with a low-confidence region re-examination mechanism to reduce the recognition error rate. It constructs a weight slip domain dictionary and relationship graph to achieve intelligent terminology matching and error correction, solving the problem of recognizing rare words and industry-specific terms.

[0038] This invention employs a layered rule system encompassing basic verification, correlation verification, and compliance verification, covering all dimensions of format, logic, and industry / enterprise compliance. This improves verification coverage, while the modular rule engine supports on-demand loading, avoiding invalid verification and enhancing processing efficiency. Errors are handled in a tiered manner, categorized as fatal, warning, and repairable, enabling immediate blocking of fatal errors, timely handling of warning errors, and automatic correction of repairable errors, reducing manual intervention. A secondary review mechanism for key fields, combined with real-time data, ensures dynamic compliance, reducing business disputes caused by data errors. It is compatible with structured, tableless, and multi-industry scenarios and enterprise customization needs. Rules can be dynamically updated without system interruption, improving the solution's scalability. Attached Figure Description

[0039] Figure 1 This is a diagram illustrating the steps and methods of the present invention;

[0040] Figure 2 This is a system block diagram of the present invention. Detailed Implementation

[0041] 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.

[0042] Example 1

[0043] Please see Figure 1 This application provides an intelligent conversion method for unformatted weight slips based on image recognition, which specifically includes the following steps:

[0044] Step 1: Collect unformatted weighbridge slip images from the onboard terminal of the logistics transport vehicle or from a manually uploaded terminal via the HTTP protocol. Specifically, this means that the information transmission and processing are performed based on the HTTP protocol when transmitting the images. Alternatively, the weighbridge slip image files can be received via an FTP server to ensure complete acquisition of image information.

[0045] Step 2: The collected weighbridge images are processed using the OpenCV library combined with a self-developed custom algorithm. The processing operations include grayscale conversion and binarization. The specific processing methods are as follows:

[0046] The RGB three-color channels are converted to grayscale values ​​using a weighted average method. According to the formula grayscale value = 0.299×R + 0.587×G + 0.114×B, where R represents the red channel value, G represents the green channel value, and B represents the blue channel value, channel separation technology is used to reduce interference for the red / blue stamps commonly found on weighbridge slips. The blue channel (B channel) is extracted and then blended with the base grayscale image at a 7:3 ratio to enhance the contrast of the text area.

[0047] Next, the grayscale image is converted into an image containing only black and white. The Otsu algorithm is used to automatically calculate the optimal threshold, denoted as the global threshold T1. The image is divided into 8×8 or 16×16 sub-blocks, and the threshold of each sub-block is calculated separately. Specifically, the Gaussian weighted average of the pixels in the sub-block is used as a reference, and the offset (usually 2-5) is subtracted to obtain the threshold, denoted as the local threshold T2. The obtained thresholds are then compared.

[0048] If the local threshold T2 < the global threshold T1x0.8, then the local threshold T2 is used as the standard (dark area enhancement). If the local threshold T2 > the global threshold T1x1.2, then the global threshold T1 is used as the standard (bright area suppression). For other cases, a weighted average is used for calculation, specifically T = T1x0.6 + T2x0.4.

[0049] Step 3: Correct the obtained grayscale image. Obtain the grayscale image and classify it. If the grayscale image corresponds to a structured list, specifically with obvious table lines (horizontal / vertical lines accounting for ≥30%), then it is a structured list. Use probabilistic Hough transform to extract the table lines, filter out short line segments with a length <50 pixels, calculate the angle distribution of all valid lines, and take the angle value with the highest frequency as the tilt angle to determine the tilt angle of the list. If the grayscale image corresponds to a list without a table, specifically with text lines as the main distribution and irregular lines, use the MSER algorithm to locate the text region, filter connected components with an area >200 pixels, perform minimum bounding rectangle fitting on the text region, extract the long side direction of the rectangle as the main direction of the text line, remove outliers (such as tilted single characters) using the RANSAC algorithm, and fit the overall tilt angle.

[0050] The rotation transformation is performed based on the tilt angle to ensure that the text lines are horizontal or the table lines are vertical. The effective content area is identified through boundary detection, and the black edges generated by the rotation are automatically cropped. Then, bilinear interpolation or Lanczos interpolation algorithm is used for interpolation optimization. Specifically, bilinear interpolation is used for general scenarios, and Lanczos interpolation is used for high-resolution images (≥300dpi) to obtain an angle-corrected image.

[0051] Next, the angle-corrected image is denoised to obtain all corresponding noise points, which are then classified into random noise (manifested as scattered black and white dots, usually generated by the shooting device or transmission process), Gaussian noise (presented as a blurring effect on the image, commonly seen in low-light environments) and characteristic noise (such as stamp interference (blocky color blocks), creases (linear interference), stains (irregular dark areas)). The random noise is cleaned by removing small noise points through 3×3 median filtering, and then residual noise is cleaned through morphological operations (opening operation). Gaussian noise is cleaned by bilateral filtering or nonlocal mean filtering. Characteristic noise is cleaned by nonlocal mean filtering and iterative repair.

[0052] Next, the processed grayscale image undergoes contrast enhancement. The Gamma value is automatically calculated based on the overall brightness of the image. The Gamma value is a parameter in image processing and printing technology that describes the non-linear relationship between the input signal and the output brightness. For overly dark images (mean brightness < 100), Gamma < 1 is used to increase brightness; for overly bright images (mean brightness > 200), Gamma > 1 is used to decrease brightness. The image is then divided into blocks (e.g., an 8×8 grid), and histogram equalization is performed on each block to improve the contrast of local details.

[0053] Step 4: Use PaddleOCR (text recognition and document parsing) or Tesseract (open-source text recognition engine) as the OCR recognition engine to perform text recognition on the preprocessed weighing list image, and convert the text in the image into editable text. The specific processing method is as follows:

[0054] Obtain the preprocessed weighing list image and its corresponding language detection result, and switch the engine according to the obtained language detection result. Specifically, if the proportion of Chinese in the language detection result is > 60%, select PaddleOCR as the recognition engine; conversely, if the proportion of Chinese is ≤ 60%, select Tesseract as the recognition engine. At the same time, divide the weighing list image into regions, obtain the divided regions, and obtain the recognition confidence corresponding to the divided regions. Here, the recognition confidence is recognized through the CRNN model of PaddleOCR and the LSTM model of Tesseract. This is prior art and will not be elaborated here. Then, judge the obtained recognition confidence. If the recognition confidence of the divided region is < 85%, automatically trigger a recheck by another engine;

[0055] Next, construct a weighing list domain dictionary. First, obtain historical weighing list data, industry standard documents, and the enterprise's internal knowledge base, and clean the obtained data, specifically including removing duplicates, unifying case, standardizing units, extracting information through regular expressions, and classifying material names using the BERT model. At the same time, discover semantically related terms through word vector clustering. Then, construct a corresponding relationship graph based on the obtained terms to generate a weighing list domain dictionary.

[0056] Step 5: Obtain the structured data in the weighing list image, and verify its format and value range through preset rules. Specifically, for format verification, for example, the license plate number needs to match the combination of "province abbreviation + letter + 5-digit number / letter" (such as "粤A8B7C6"), the date needs to conform to the format of "year-month-day" or "year / month / day", the weight value needs to retain 1 - 3 decimal places and be a positive number. For value range verification, for example, "net weight" needs to be greater than 0 and less than "gross weight", "unit price" needs to match the reasonable range of the goods type (such as steel unit price ≥ 3000 yuan / ton, coal unit price ≥ 500 yuan / ton), and "transportation time" needs to be after "weighing time";

[0057] Based on the business logic relationship between multiple fields, identify data contradictions or logical loopholes, numerical associations: such as "net weight = gross weight - tare weight" (allowable error ≤ 0.1 ton), "total amount = net weight × unit price" (allowable error ≤ 0.5%), and "vehicle approved load" needs to be greater than "net weight" (overloading needs to be specially marked);<0000​Entity association: For example, the "shipping unit" and the "receiving unit" cannot be the same enterprise; the "license plate number location" must match the "starting point / end point of the transportation route" (e.g., a Hebei license plate corresponds to the Hebei region); and the "cargo type" must match the "packaging unit" (e.g., the unit for liquid cargo should be "liter" or "cubic meter").

[0059] By combining industry standards, corporate policies, and external regulations, we achieve in-depth compliance verification, and the specific verification methods are as follows:

[0060] Industry-specific rules: For example, weighbridge slips for dangerous goods must include the "dangerous goods number" and "transportation permit number," and the permit's validity period must cover the transportation time; weighbridge slips for imported goods must be linked to the "customs declaration number" and their format validity must be verified.

[0061] Customized rules for enterprises: For example, weighbridge slips for core customers (such as "XX Automobile Factory") must include "order number" and "batch number". When the daily transportation volume exceeds the enterprise's threshold (such as ≥5000 tons), a multi-level approval process will be automatically triggered.

[0062] Meanwhile, different types of verification rules are split into independent modules (such as "basic format module", "steel industry module", and "dangerous goods special module"). The corresponding module is automatically loaded according to the weighbridge type (such as road freight, rail freight, and customs declaration) to avoid invalid rule execution. The rules are executed in the order of basic verification, related verification, and business compliance. If the previous layer of verification fails, the subsequent process is terminated directly and the specific error reason is returned (such as "Tare weight format error: should be positive"). A "secondary verification" mechanism is set for key fields (such as "net weight" and "total amount"): after the first verification passes, the rule engine is called again after an interval of 5-10 seconds (simulating the delay of manual review) to review the data in combination with the latest business data (such as real-time exchange rate and price fluctuation) to ensure dynamic compliance.

[0063] Based on the verification results, the corresponding error causes are obtained, and the errors are classified according to their severity into fatal errors, warning errors, and recoverable errors. Specifically, errors that severely violate business logic or regulatory requirements, rendering the data completely invalid and requiring immediate handling, are classified as fatal errors. Errors that affect critical business processes but can be remedied with temporary measures and do not affect business operations, but may pose potential risks or have room for optimization, are classified as recoverable errors. Each type of error is then verified and processed accordingly, with the specific verification and processing methods as follows:

[0064] To handle fatal errors, suspend all subsequent business processes, lock data modification permissions, highlight the error field in the structured data report with a specific description of the violation, and automatically associate the data source.

[0065] The system handles warning errors, allowing the data to proceed to subsequent stages (such as OCR recognition and system archiving), but marks it with an orange warning label on the interface, automatically generates a risk warning form, lists the deviation details (such as "unit price deviates from the average by 12%, it is recommended to verify the market situation"), and pushes it to the business auditor.

[0066] For correctable errors, the system will process them according to preset rules, mark "system automatically corrected" in the data report, record the original value and the corrected value, and automatically trigger basic rule verification after the correction to confirm that the correction result meets the standard.

[0067] Example 2

[0068] Please see Figure 2 This application provides an intelligent conversion system for unformatted weight slips based on image recognition, including an image acquisition module, an image preprocessing module, a structured parsing module, and a data verification module, and combines... Figure 2 It can be seen that the information between the above functional modules is transmitted in one direction only.

[0069] The image acquisition module is used to acquire unformatted weighbridge images via HTTP or FTP.

[0070] The image preprocessing module uses OpenCV combined with a custom algorithm to perform grayscale conversion, binarization, noise removal, tilt correction, and contrast enhancement on the acquired baggage slip images to obtain preprocessed baggage slip images. Then, PaddleOCR or Tesseract is used to perform text recognition on the preprocessed baggage slip images to convert the text in the images into editable text.

[0071] The structured parsing module uses regular expressions combined with natural language processing (NLP) technology to parse the editable text obtained by OCR recognition, extract key data and understand its semantics;

[0072] The data validation module uses the Drools rule engine to validate the parsed structured data, ensuring its accuracy and compliance.

[0073] The data in the above formulas are all calculated using numerical values, without substituting the units of the parameters. In addition, the contents not described in detail in this specification are all prior art known to those skilled in the art.

[0074] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. An intelligent conversion method for unformatted weight slips based on image recognition, characterized in that: The method specifically includes the following steps: Step 1: Collect unformatted weighbridge slip images from the on-board terminal of the logistics transport vehicle or the terminal uploaded manually via HTTP protocol, or receive weighbridge slip image files via FTP server. Step 2: Convert the RGB three-color channels of the collected weighbridge image to grayscale values ​​using a weighted average method. Simultaneously, use the Otsu algorithm to calculate global and local thresholds to obtain a grayscale image. The specific processing method is as follows: The RGB three-color channels are converted to grayscale values ​​using a weighted average method. The formula is grayscale value = 0.299 × R + 0.587 × G + 0.114 × B, where R, G, and B represent the red, green, and blue channel values, respectively. For the bill containing red, the blue channel is extracted, and the B channel is blended with the base grayscale image at a 7:3 ratio. The global threshold T1 is calculated using the Otsu algorithm. The image is divided into 8×8 sub-blocks. The local threshold T2 is calculated by subtracting an offset of 2-5 from the Gaussian weighted average of the pixels in the sub-block. If T2 < 0.8 × T1, T2 is used for verification; if T2 > 1.2 × T1, T1 is used for verification; otherwise, a weighted threshold of T = 0.6 × T1 + 0.4 × T2 is used. Step 3: Apply probabilistic Hough transform to the obtained grayscale image for tilt correction, and perform noise reduction using median filtering. Simultaneously, automatically calculate the Gamma value of the overall image brightness to obtain the preprocessed billing image. The specific processing method is as follows: For structured order sheets, table lines are extracted using probabilistic Hough transform, line segments shorter than 50 pixels are filtered out, and the angle with the highest frequency of occurrence is taken as the tilt angle. For order sheets without tables, the MSER algorithm is used to locate the text area, effective areas with an area exceeding 200 pixels are selected, the main direction of the text lines is fitted, and outliers are removed to determine the tilt angle. The image is rotated according to the tilt angle, and after cropping the edges, bilinear interpolation is selected to optimize the image quality based on the resolution. Random noise is cleaned using 3×3 median filtering combined with morphological opening operation; Gaussian noise is cleaned using bilateral filtering or nonlocal mean filtering; distinctive noise is cleaned using nonlocal mean filtering and iterative repair, the Gamma value is calculated based on the average image brightness, and histogram equalization is performed on the image blocks. Step 4: Select different recognition engines based on the text proportion in the preprocessed weight list image, and simultaneously construct a weight list domain dictionary based on historical data. The specific processing method is as follows: The preprocessed weighbridge image is subjected to text recognition, and the text in the image is converted into editable text. The proportion of Chinese characters in the weighbridge text is detected. When the proportion is >60%, PaddleOCR is used, and when the proportion is ≤60%, Tesseract is used. The image region is divided and the recognition confidence is calculated. For regions with a confidence of <85%, another engine is triggered for re-examination. Based on historical data, industry documents, and enterprise knowledge bases, a rule-based dictionary containing entity relationships is constructed after data cleaning, terminology extraction, classification, and word vector clustering. Step 5: Use multi-level rule validation to validate the structured data in the preprocessed weight slip image, generate error reasons, classify the error reasons, and generate corresponding processing information. The specific processing method is as follows: To handle fatal errors, suspend all subsequent business processes, lock data modification permissions, highlight the error field in the structured data report with a specific description of the violation, and automatically associate the data source. The system handles warning errors, allowing the data to proceed to subsequent stages, but marks it with an orange warning label on the interface, automatically generates a risk warning form, lists the deviation content, and pushes it to the business auditor; For recoverable errors, the system will correct the errors according to preset rules, indicate that the system automatically corrected the errors in the data report, record the original value and the corrected value, and automatically trigger the basic rule verification after the correction.

2. The intelligent conversion method for unformatted weight slips based on image recognition according to claim 1, characterized in that, The multi-level rule verification includes basic verification, correlation verification, and compliance verification. Basic verification includes format verification and value range verification, correlation verification includes the relationship between numerical values ​​and entities, and compliance verification includes industry and enterprise rules.

3. The intelligent conversion method for unformatted weight slips based on image recognition according to claim 1, characterized in that, The specific method for classifying error causes is as follows: The cause of the error is identified and the severity of the error is classified. If the error seriously violates business logic or regulatory requirements, resulting in completely invalid data, it must be dealt with immediately and is classified as a fatal error. If the error affects critical business processes but can be remedied with temporary measures and does not affect business operations, and there are potential risks or room for optimization, it is classified as a repairable error.

4. An image recognition-based intelligent conversion system for unformatted weight slips, used to execute the intelligent conversion method for unformatted weight slips as described in any one of claims 1-3, characterized in that, include: The image acquisition module is used to acquire unformatted weighbridge images via HTTP or FTP. The image preprocessing module uses OpenCV combined with a custom algorithm to convert color images into grayscale images, then uses binarization to highlight text regions and identify noise. Small noise is removed by value filtering, and residual noise is cleaned up by morphological operations. The tilted baggage image is rotated and corrected, and the contrast is enhanced by grayscale histogram equalization to obtain a preprocessed baggage image. PaddleOCR is then used to recognize text in the preprocessed baggage image and convert the text in the image into editable text. The structured parsing module uses regular expressions combined with natural language processing technology to parse the editable text obtained by OCR recognition, extract key data and understand its semantics; The data validation module uses the Drools rule engine to validate the parsed structured data, ensuring its accuracy and compliance.

Citation Information

Patent Citations

  • OCR (Optical Character Recognition)-based scrap steel recycling scale sheet automatic recognition system

    CN115862028A

  • Image tilt correction method and device, electronic equipment and readable medium

    CN117934807A