Parsing and vectorization processing method and system for unstructured documents

CN122416475BActive Publication Date: 2026-10-27LANYUN NET
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610539045.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-22
Publication Date
2026-10-27
Estimated Expiration
2046-04-22

AI Technical Summary

Technical Problem

[0003]然而,实际应用场景中,文档来源的多样性导致图像质量存在显著波动,包括不同年代文件的老化程度差异、扫描设备性能参差以及保存环境条件变化;同时,文档内容的复杂性表现为小字号密集排版、低对比度打印、手写批注干扰以及页面倾斜等现象普遍

Benefits of technology

本发明依据获取的字号大小和文本密度,计算得到表征字符辨识难易程度的文本可读性系数;依据获取的文本颜色与背景对比度以及环境光照,计算得到表征图像采集质量的成像质量系数;依据获取的分辨率和模糊度,以及文本可读性系数和成像质量系数,计算得到表征清晰度满足文本识别需求程度的清晰匹配度;依据获取的倾斜角度,计算得到表征文档倾斜角度对几何校正需求的几何端正系数;依据几何端正系数和清晰匹配度,计算得到OCR置信度阈值并调节当前OCR置信度阈值至目标OCR置信度阈值;本发明通过综合考虑文本自身属性和成像环境条件,动态调节置信度阈值,解决了自适应调整问题,具有通过动态调节光学字符识别置信度阈值,在保证识别准确率的同时最大化信息保留,有效避免传统固定阈值导致的过度删除或错误字符引入问题,从而提升非结构化文档解析与向量化处理的整体效能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122416475B_ABST
    Figure CN122416475B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of optical character recognition, and discloses a parsing and vectorization processing method and system for unstructured documents, which comprises the following steps: calculating a text readability coefficient according to the font size and the text density; calculating an imaging quality coefficient according to the contrast between the text color and the background and the ambient light; calculating a clear matching degree according to the resolution, the blurriness, the text readability coefficient and the imaging quality coefficient; calculating a geometric end-right coefficient according to the inclination angle; and dynamically adjusting an OCR confidence threshold to a target threshold according to the clear matching degree and the geometric end-right coefficient. Through multi-dimensional quantification of the text attributes, the imaging environment, the image clarity and the geometric regularity of the document, the application realizes adaptive adjustment of the OCR confidence threshold, solves the problem that the traditional fixed threshold strategy is difficult to balance the accuracy and the recall rate when processing unstructured documents with uneven quality, and effectively avoids the loss of key information or the introduction of error characters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optical character recognition technology, and in particular relates to a method and system for parsing and vectorizing unstructured documents. Background Technology

[0002] As enterprises deepen their digital transformation, massive amounts of unstructured documents (such as scanned documents, contracts, reports, faxes, etc.) need to be efficiently converted into machine-readable structured data to support knowledge base construction, retrieval enhancement generation systems, and deep semantic analysis. Optical character recognition (OCR) is the core technology for achieving this conversion, and its output quality directly restricts the reliability of subsequent text segmentation, vectorization representation, and semantic retrieval.

[0003] However, in real-world applications, the diversity of document sources leads to significant fluctuations in image quality, including differences in the aging of documents from different eras, varying scanning equipment performance, and changes in storage conditions. Simultaneously, the complexity of document content manifests in common phenomena such as small font sizes, dense typesetting, low-contrast printing, handwritten annotations, and page tilt. Traditional optical character recognition systems generally use fixed confidence thresholds for result filtering. This static strategy exhibits significant limitations when facing dynamically changing document quality: when the threshold is set too high, effective characters in low-quality documents are excessively deleted, resulting in the loss of key information and a significant decrease in recall; when the threshold is set too low, a large number of erroneous characters are mixed into high-quality documents, leading to semantic vector contamination and reducing the accuracy of downstream tasks. Some improved solutions attempt to adjust the threshold based on image quality parameters, but often focus only on a single dimension (such as resolution or blurriness), failing to fully consider the coupling effect between textual attributes (such as font size and typesetting density) and imaging environmental conditions (such as text-background contrast and ambient lighting). For example, small-font text is more sensitive to resolution changes, while the impact of blurriness is significantly amplified in low-contrast scenes. This neglect of the interaction of multiple factors makes the threshold adjustment architecture lack adaptability, failing to maximize information retention while ensuring recognition accuracy, thus restricting the overall efficiency of unstructured document parsing and vectorization processing. Therefore, how to provide a more adaptable threshold adjustment architecture to optimize the processing of unstructured documents is the technical problem that this invention aims to solve. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for parsing and vectorizing unstructured documents, in order to solve the above-mentioned problems.

[0005] This invention is implemented by providing a method for parsing and vectorizing unstructured documents, the method comprising: Based on the obtained font size and text density, a text readability coefficient, which represents the difficulty of character recognition, is calculated. Based on the acquired text color, background contrast, and ambient lighting, the imaging quality coefficient, which characterizes the image acquisition quality, is calculated. Based on the obtained resolution and blur, as well as the text readability coefficient and image quality coefficient, the sharpness matching degree, which represents the degree to which the sharpness meets the requirements of text recognition, is calculated. Based on the obtained tilt angle, a geometric straightening coefficient representing the geometric correction requirement of the document tilt angle is calculated; Based on the geometric rightness coefficient and the clarity matching degree, the OCR confidence threshold is calculated and the current OCR confidence threshold is adjusted to the target OCR confidence threshold.

[0006] As a further aspect of the present invention, the calculation steps for the text readability coefficient are as follows: Max-min normalization is performed on the font size and text density respectively, and the normalization value is limited to the range of 0-1 to obtain the font size index and text density index. The text readability coefficient is obtained by weighting and combining the font size index and the text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated with the text readability coefficient.

[0007] As a further aspect of the present invention, the calculation steps for the imaging quality coefficient are as follows: The contrast ratio between the current text color and the background is calculated by comparing it with the maximum contrast value, and then the upper limit of the ratio is set to 1 using the min function to obtain the contrast index. The ambient light intensity is subjected to maximum-minimum normalization and the normalization value is limited to the range of 0-1 to obtain the ambient light index. The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one aspect is extremely poor, and the image is almost indistinguishable.

[0008] As a further aspect of the present invention, the calculation steps for the clarity matching degree are as follows: The resolution and ambiguity are respectively subjected to maximum-min normalization, and the normalization value is limited to the range of 0-1 to obtain the resolution index and ambiguity index. Based on the resolution index and the blur index, a sharpness index that comprehensively reflects the sharpness of an image is obtained. Based on text readability coefficient and imaging quality coefficient This yields a text recognition demand index that characterizes the degree of clarity requirement; Substitute the clarity index and text recognition demand index into the formula. Get a clear match , , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This represents the demand index for text recognition. This is an indicator of sharpness.

[0009] As a further aspect of the present invention, the calculation steps for the geometric end positive coefficient are as follows: The tilt angle is normalized to its maximum and minimum values, and the amplitude-limited normalized value is within the range of 0-1. The complement of the amplitude-limited value is taken as the geometric correction coefficient. , , This indicates no tilt and minimal need for geometric correction. This indicates that the tilt has reached its maximum, making correction extremely difficult.

[0010] As a further aspect of the present invention, the calculation steps for the OCR confidence threshold are as follows: The overall quality factor is obtained by geometrically averaging the clarity matching degree and the geometric positivity coefficient. The target OCR confidence threshold is obtained by interpolating between the minimum and maximum confidence thresholds based on the comprehensive quality factor. Both the clarity matching degree and the geometric positivity coefficient are positively correlated with the target threshold.

[0011] The present invention also provides a system for parsing and vectorizing unstructured documents. This system is used to implement the aforementioned method for parsing and vectorizing unstructured documents. The system includes: The readability analysis module is used to calculate the text readability coefficient, which represents the difficulty of character recognition, based on the obtained font size and text density. The imaging analysis module is used to calculate the imaging quality coefficient, which characterizes the image acquisition quality, based on the acquired text color, background contrast, and ambient lighting. The matching degree determination module is used to calculate the sharpness matching degree, which represents the degree to which the sharpness meets the requirements of text recognition, based on the obtained resolution and ambiguity, as well as the text readability coefficient and the imaging quality coefficient. The correction information determination module is used to calculate the geometric straightening coefficient, which characterizes the geometric correction requirement of the document's tilt angle, based on the acquired tilt angle. The confidence determination module is used to calculate the OCR confidence threshold based on the geometric end-positive coefficient and the sharpness matching degree, and adjust the current OCR confidence threshold to the target OCR confidence threshold.

[0012] As a further aspect of the present invention, the calculation of the text readability coefficient is as follows: Max-min normalization is performed on the font size and text density respectively, and the normalization value is limited to the range of 0-1 to obtain the font size index and text density index. The text readability coefficient is obtained by weighting and combining the font size index and the text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated with the text readability coefficient.

[0013] As a further aspect of the present invention, the calculation of the imaging quality coefficient is as follows: The contrast ratio between the current text color and the background is calculated by comparing it with the maximum contrast value, and then the upper limit of the ratio is set to 1 using the min function to obtain the contrast index. The ambient light intensity is subjected to maximum-minimum normalization and the normalization value is limited to the range of 0-1 to obtain the ambient light index. The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one aspect is extremely poor, and the image is almost indistinguishable.

[0014] As a further aspect of the present invention, the calculation of the clarity matching degree is as follows: The resolution and ambiguity are respectively subjected to maximum-min normalization, and the normalization value is limited to the range of 0-1 to obtain the resolution index and ambiguity index. Based on the resolution index and the blur index, a sharpness index that comprehensively reflects the sharpness of an image is obtained. Based on text readability coefficient and imaging quality coefficient This yields a text recognition demand index that characterizes the degree of clarity requirement; Substitute the clarity index and text recognition demand index into the formula. Get a clear match , , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This represents the demand index for text recognition. This is an indicator of sharpness.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention calculates a text readability coefficient, representing the ease of character recognition, based on the acquired font size and text density; an imaging quality coefficient, representing the image acquisition quality, based on the acquired text color, background contrast, and ambient lighting; a sharpness matching degree, representing the degree to which the sharpness meets the text recognition requirements, based on the acquired resolution and blur, as well as the text readability coefficient and imaging quality coefficient; a geometrical straightness coefficient, representing the geometric correction requirements of the document's tilt angle, based on the acquired tilt angle; and an OCR confidence threshold, based on the geometrical straightness coefficient and sharpness matching degree, and adjusts the current OCR confidence threshold to the target OCR confidence threshold. This invention solves the adaptive adjustment problem by dynamically adjusting the confidence threshold by comprehensively considering the text's own attributes and imaging environment conditions. It maximizes information retention while ensuring recognition accuracy by dynamically adjusting the optical character recognition confidence threshold, effectively avoiding excessive deletion or the introduction of erroneous characters caused by traditional fixed thresholds, thereby improving the overall efficiency of unstructured document parsing and vectorization processing. Attached Figure Description

[0016] Figure 1 The flowchart illustrates the parsing and vectorization method for unstructured documents provided by this invention.

[0017] Figure 2 The structural block diagram of the unstructured document parsing and vectorization processing system provided by this invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0019] In the parsing and vectorization of unstructured documents, traditional fixed confidence threshold strategies cannot adaptively match the recognition requirements of documents of different quality levels due to the dynamic changes in document image quality and the complexity of text content. Specifically, this strategy does not comprehensively consider the coupling relationship between text readability parameters (including font size and text density) and image quality parameters (including text color, background contrast, and ambient lighting). This results in the inability to simultaneously optimize information recall and recognition accuracy when document quality fluctuates, thus affecting the overall performance of subsequent text segmentation, vectorization representation, and semantic retrieval.

[0020] For example, in financial institutions processing historical loan records digitization projects, the document set includes microfilm scans and high-resolution scanned contracts. Microfilm scans exhibit low resolution, small font size, high text density, and low contrast, while high-resolution scanned contracts contain handwritten annotations and slight tilting. When using a fixed confidence threshold for OCR processing, the small font size in the microfilm is filtered out because its confidence level is below the threshold, resulting in the loss of key clause information; simultaneously, handwritten annotations in the high-resolution scanned contracts are misidentified as high-confidence characters, introducing noisy data. Furthermore, this problem manifests as the threshold adjustment architecture failing to dynamically adjust according to document characteristics, resulting in insufficient recall of effective information from low-quality documents and contamination of the recognition results for high-quality documents.

[0021] If the aforementioned issues are not addressed, the structured data output by OCR will contain incomplete or erroneous information, resulting in missing information and noise interference in the constructed knowledge base. Consequently, the retrieval enhancement generation system will return irrelevant results during queries, and systematic biases will be introduced during the training of the semantic analysis model, ultimately reducing the automation level and decision support capabilities of the entire document processing workflow. Furthermore, the workload of manual proofreading will increase, system maintenance costs will rise, and the in-depth implementation of enterprise digital transformation will be hindered.

[0022] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.

[0023] like Figure 1 As shown, in one embodiment of the technical solution of the present invention, a method for parsing and vectorizing unstructured documents is provided, the method comprising: Step S100: Based on the obtained font size and text density, calculate the text readability coefficient, which characterizes the ease of character recognition. Font size refers to the visual size of characters in the document. Font size is one of the important factors affecting the ease of character recognition, and is usually measured in points (pt) or pixels (px). Text density refers to the density of text characters per unit area in the document. High text density may lead to insufficient spacing between characters, increasing the difficulty of recognition; low text density may make characters easier to recognize independently. The text readability coefficient is a quantitative indicator used to characterize the ease with which characters are visually recognized. This coefficient comprehensively considers factors such as font size and text density; a higher value generally indicates that the character is easier to recognize.

[0024] Step S200: Based on the acquired text color and background contrast, as well as ambient lighting, calculate the imaging quality coefficient, which characterizes the image acquisition quality. Text color and background contrast refers to the degree of difference between the text color and the background color. High contrast helps the OCR system distinguish text from the background, thus improving recognition accuracy; low contrast increases recognition difficulty. Ambient lighting refers to the ambient light conditions during document image acquisition. Appropriate lighting intensity and uniformity are crucial for acquiring high-quality images; excessively bright or dark, or uneven lighting, can lead to a decrease in image quality. The imaging quality coefficient is a quantitative indicator used to characterize the quality of document image acquisition. This coefficient comprehensively considers factors such as text color and background contrast, as well as ambient lighting; a higher value generally indicates better image acquisition quality.

[0025] Step S300: Based on the acquired resolution and blurriness, as well as the text readability coefficient and image quality coefficient, calculate the sharpness matching degree, which represents the degree to which the sharpness meets the requirements of text recognition. Resolution refers to the density of pixels in an image, usually expressed in pixels per inch (DPI) or total pixels (e.g., 1920x1080). High-resolution images contain more detailed information, which helps the OCR system recognize small fonts or complex characters. Blurriness refers to the degree of sharpness of object edges in an image. High blurriness indicates that image details are not clear and character edges are blurred, which will significantly reduce the accuracy of OCR recognition. Sharpness matching degree is a quantitative indicator used to characterize the degree to which the sharpness of the current document image meets the requirements of text recognition. This coefficient comprehensively considers the image's own sharpness (such as resolution and blurriness) and the requirements of text recognition (such as text readability coefficient and image quality coefficient).

[0026] Step S400: Based on the obtained tilt angle, calculate the geometric regularity coefficient, which characterizes the geometric correction requirement of the document tilt angle; the tilt angle refers to the deviation angle of the document page relative to the horizontal or vertical direction. Document tilt increases the complexity of geometric correction performed by the OCR system and affects the recognition effect. The geometric regularity coefficient is a quantitative indicator used to characterize the degree of geometric correction requirement of the document tilt angle. This coefficient reflects the geometric regularity of the document; a higher value generally indicates a more upright document and a lower geometric correction requirement.

[0027] Step S500: Based on the geometrical straightness coefficient and sharpness matching degree, calculate the OCR confidence threshold and adjust the current OCR confidence threshold to the target OCR confidence threshold. The OCR confidence threshold is a numerical limit used by the Optical Character Recognition (OCR) system to judge the reliability of the recognition result during the recognition process. The OCR system assigns a confidence score to each recognized character or word. Only when the score is higher than the set threshold will the recognition result be retained; otherwise, the result may be considered unreliable and discarded. The target OCR confidence threshold refers to the confidence threshold that the OCR system should adopt after dynamically calculating and adjusting various quality parameters of the document. This threshold aims to optimize the balance between OCR accuracy and recall.

[0028] The technical concept of this invention demonstrates a significant technical contribution. In existing technologies, OCR systems generally use a fixed confidence threshold to filter recognition results. This presents an irreconcilable contradiction when processing unstructured documents of varying quality. For example, in the scenario described above where user A processes old scanned documents, if a fixed high threshold is used, a large amount of blurry, small-font, or low-contrast document content will be mistakenly deleted, leading to the loss of crucial information; if a fixed low threshold is used, too many recognition errors will be mixed into clear documents, contaminating subsequent vectorization processing results.

[0029] This invention provides a comprehensive and detailed evaluation of document quality by introducing multiple dimensions, including text readability coefficient, image quality coefficient, sharpness matching degree, and geometric uprightness coefficient. Compared to existing technologies that only consider a single factor (such as resolution or blurriness), this invention can more accurately capture the complexity of document quality, especially the coupled effects between factors such as font size, text density, contrast, and lighting. For example, when calculating sharpness matching degree, it considers not only the image's resolution and blurriness but also incorporates the text readability coefficient and image quality coefficient, thus making the judgment on whether the sharpness meets the requirements for text recognition more accurate.

[0030] Therefore, this invention can dynamically calculate and adjust the OCR confidence threshold based on these comprehensive evaluation results. This adaptive threshold adjustment architecture allows the system to appropriately lower the threshold to maximize information recall and avoid the false deletion of valid information when processing low-quality documents; while raising the threshold to ensure recognition accuracy and reduce the introduction of erroneous information when processing high-quality documents. This dynamic balancing strategy effectively solves the problem of accuracy and recall imbalance caused by fixed thresholds or single-factor adjustments in existing technologies, significantly improving the overall effect and robustness of unstructured document parsing and vectorization processing.

[0031] The present invention further proposes the following steps for calculating the above-mentioned text readability coefficient: Retrieving font size and text density refers to extracting the visual features of text from unstructured documents. Font size refers to the average or main height of characters in the text, reflecting the visual size of the characters. Text density refers to the number of characters per unit area or the proportion of characters occupied by characters, reflecting the density of the text. These features can be obtained through image processing techniques, such as connected component analysis and character segmentation in the OCR preprocessing stage, to identify text regions in the document and calculate the average pixel height or width of the characters within them as the font size; text density can be obtained by statistically analyzing the ratio of the number of characters within a text region to the total pixel area of ​​that region. Alternatively, for editable documents such as PDFs, font and layout information can be directly extracted from the document metadata to obtain font size and text density.

[0032] The font size and text density are subjected to max-min normalization, with the normalized values ​​limited to the range of 0-1, to obtain the font size index and text density index. This step aims to eliminate dimensional differences between different features, making them comparable and ensuring that all indices are on a uniform scale for easier subsequent calculation and interpretation. This normalization process can use the standard max-min normalization formula, and the results are pruned after calculation, setting any value less than 0 to 0 and any value greater than 1 to 1. The normalized font size index and text density index represent the relative size of font size and density within their respective ranges. Maximum font size, minimum font size, maximum text density, and minimum text density are reference values ​​used for normalization, representing the possible range of font size and text density values ​​in a specific application scenario or dataset. These values ​​can be statistically analyzed based on historical data and set as empirical values ​​or statistical extremes, or defined according to preset industry standards or user configurations.

[0033] The text readability coefficient is obtained by weighting and combining the font size index and text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated. The specific calculation method is as follows: substitute the font size index and text density index into the formula... Obtain the text readability score This formula takes into account the impact of font size and text density on readability. Larger font sizes generally result in better readability. Direct contribution. Lower text density (sparser texture) results in better readability, therefore... This represents the inverse effect of density. The average of the two values ​​yields a comprehensive text readability assessment. This calculation can be performed directly in a software program using mathematical formulas, or by constructing a lookup table or using a machine learning model, based on... and The combination value is used to predict However, it is necessary to ensure that its behavior is consistent with the formula logic. This ensures that the text readability coefficient is between 0 and 1, facilitating standardized measurement and subsequent threshold adjustment. This indicates the largest font size and the lowest density (sparsest), making character recognition the easiest. This indicates the smallest font size and highest density (densest), making character recognition the most difficult. This is the font size index. This is the text density index.

[0034] The present invention first obtains raw features such as font size and text density from unstructured documents, and then performs max-min normalization on these raw features in conjunction with preset maximum and minimum reference values, thereby obtaining a dimensionless font size index. and text density index This normalization step allows features of different dimensions to be compared and calculated on a uniform scale. Subsequently, these normalized exponents are substituted into specific mathematical formulas. It cleverly combines the positive impact of font size and the negative impact of text density (i.e., the positive impact of sparsity), and takes their average value to calculate a comprehensive text readability coefficient. The coefficient, ranging from 0 to 1, intuitively reflects the difficulty of character recognition. In this way, the present invention provides a precise and quantitative text readability evaluation architecture for the aforementioned parsing and vectorization methods for unstructured documents. This enables the OCR system to more accurately understand the inherent readability characteristics of a document, thus more effectively adapting to different document qualities in subsequent clarity matching calculations and OCR confidence threshold adjustments, improving the overall processing accuracy and robustness. This precise text readability evaluation effectively solves the key problem of accurately measuring the identifiability of text in complex and varied unstructured documents, providing a solid foundation for subsequent OCR processing.

[0035] Through the above technical solution, this invention can accurately assess the inherent readability of text, overcoming the inaccuracies caused by relying on a single indicator or subjective judgment. This precise text readability coefficient can more accurately reflect the difficulty of character recognition, thus providing more reliable input for subsequent clear matching calculations and OCR confidence threshold adjustments. This enables the OCR system to adaptively adjust its recognition strategy according to the actual readability characteristics of the document, avoiding recognition errors or information loss caused by the text's own attributes (such as font size being too small or too dense), significantly improving the accuracy and robustness of unstructured document parsing and vectorization processing.

[0036] The present invention further proposes the following steps for calculating the above-mentioned imaging quality coefficient: This involves acquiring text color and background contrast, as well as ambient lighting. Text color and background contrast refers to the degree of difference between the text color and the background color in a document image, and it is one of the key factors affecting the visual recognizability of characters. This contrast can be obtained through image processing techniques, such as calculating it by analyzing the pixel brightness or color differences between text and background areas. Ambient lighting refers to the external lighting conditions at the time of document image acquisition, which directly affects the overall brightness and detail rendering of the image. Ambient lighting can be acquired through a light sensor integrated into the image acquisition device, or estimated by analyzing the brightness distribution of the image itself.

[0037] The contrast ratio is calculated by comparing the current text color to the background contrast with the maximum contrast value, and then capped at 1 using a min function to obtain the contrast index. This step quantifies the original text color to background contrast into a dimensionless index between 0 and 1. By comparing the currently obtained contrast value with the preset maximum contrast value, the ratio of the current contrast to the ideal maximum contrast can be reflected. The min function caps the contrast index at 1 to ensure it does not exceed 1. Even in extreme cases where the current contrast is slightly higher than the maximum contrast value, the index remains within a valid range, thus providing a standardized input for subsequent image quality coefficient calculations.

[0038] Ambient illumination is subjected to maximum-minimum normalization, with the normalized value limited to the range of 0-1, to obtain the ambient illumination index. The purpose of this step is to convert the original ambient illumination value into an ambient illumination index between 0 and 1, eliminating the influence of different illumination measurement units or ranges and enabling effective combination with other indices. Maximum-minimum normalization is achieved by subtracting the minimum illumination value from the current illumination value and then dividing by the difference between the maximum and minimum illumination values, thus mapping the illumination value to the 0-1 range. Limiting the normalized value to the 0-1 range ensures the validity and stability of the index, providing standardized input for subsequent image quality coefficient calculations.

[0039] The maximum contrast ratio, maximum ambient light value, and minimum ambient light value are reference benchmark values ​​used for subsequent normalization processing. They can be preset according to the needs of the actual application scenario, for example, determined through experimental testing or industry standards, or obtained through calibration or dynamic monitoring during system operation.

[0040] The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one of the factors is extremely poor (contrast is 0 or illumination is 0), making the image almost indistinguishable. This step comprehensively evaluates the captured quality of the document image by multiplying the contrast index and the ambient illumination index. The logic of the multiplication operation is that the overall image capture quality is only optimal when the text color has good contrast with the background and the ambient lighting is sufficient. If either factor is extremely poor (e.g., contrast is close to 0 or illumination is close to 0), the product will approach 0, accurately reflecting the low-quality condition where the image is almost indistinguishable.

[0041] This invention provides a more comprehensive reflection of the actual difficulty of document recognition by systematically evaluating the quality of document image acquisition. Specifically, the scheme first identifies two core factors affecting image quality: text color and background contrast, and ambient lighting. To transform these raw physical quantities into quantifiable and unified evaluation indicators, they are standardized. Text color and background contrast are compared to the maximum contrast value and then limited to obtain a contrast index, which directly reflects the distinguishability of text and background. Simultaneously, ambient lighting is normalized by a maximum-minimum process and then limited to obtain an ambient lighting index, which quantifies the lighting conditions during image acquisition. Subsequently, these two standardized indices are multiplied to generate the final image quality coefficient. This multiplicative approach cleverly reflects the "weakest link" effect in image acquisition quality: only when contrast and illumination are both at high levels can the overall image quality coefficient approach the ideal value of 1; conversely, if either factor performs poorly, the image quality coefficient drops significantly, accurately reflecting the potential difficulties in image recognition. In this way, the image quality coefficient... It can serve as an important basis for adjusting the confidence threshold of OCR. Together with other factors such as the text readability coefficient, it enables the OCR system to adaptively adjust the recognition strategy according to the actual quality of the document image. Thus, when the image quality is poor, the threshold can be appropriately relaxed to retain more potential recognition results and avoid prematurely discarding effective information due to image quality issues.

[0042] Through the above technical solution, this invention can quantitatively evaluate the image acquisition quality of unstructured documents. This solution comprehensively considers two key factors: text color and background contrast, as well as ambient lighting, and converts them into a unified imaging quality coefficient. This refined evaluation avoids the bias that may arise from subjective judgment or a single indicator, allowing the system to more accurately understand the actual recognition difficulty of the document image. When the imaging quality coefficient is low, it indicates defects in image acquisition. Based on this, the system can combine it with other factors such as text readability coefficients in subsequent OCR processing to more reasonably adjust the OCR confidence threshold. This helps avoid erroneously discarding valid recognition results due to excessively high thresholds when image quality is unsatisfactory, thereby improving the adaptability, recognition accuracy, and robustness of the OCR system to various complex unstructured documents.

[0043] The present invention further proposes the following steps for calculating the above-mentioned clarity matching degree: Obtaining resolution and blurriness: Resolution refers to the number of pixels in an image, which directly affects the image's ability to represent details. It can be obtained by reading the image file's metadata or through image processing library functions. "Blurriness" refers to the sharpness of edges and details in an image. High blurriness indicates that the image is not clear and details are severely lost. It can be quantified using edge detection algorithms such as image gradient information, Fourier transform frequency component analysis, or the Laplacian operator.

[0044] Resolution and blurriness are respectively subjected to maximum-min normalization, with the normalized values ​​limited to the range of 0-1, to obtain the resolution index and blurriness index. Maximum-min normalization is a common data preprocessing technique that aims to transform data of different dimensions or ranges into a unified interval, such as [0,1]. Limiting the normalized values ​​to the range of 0-1 ensures that the normalized values ​​do not exceed the preset valid range. Even if the original data slightly exceeds the preset maximum or minimum values, it can be limited to between 0 and 1, avoiding outliers from affecting subsequent calculations. The "resolution index" and "blurriness index" are the normalized resolution and blurriness values, representing the relative levels of image resolution and blurriness with values ​​from 0 to 1, respectively, facilitating subsequent comprehensive calculations. The "maximum resolution" and "minimum resolution" can be preset as the upper and lower limits of the image resolution that the system can process, or obtained based on historical data statistics. The "maximum blur" and "minimum blur" can be set based on empirical values. For example, the maximum blur can correspond to the degree to which the image is almost unrecognizable, while the minimum blur corresponds to the degree to which the image is extremely sharp.

[0045] Based on the resolution index and the blur index, a sharpness index is derived that comprehensively reflects the sharpness of an image. The "sharpness index" is a comprehensive numerical value that quantifies the visual sharpness of an image. It combines the two key factors of image resolution and blur, aiming to provide a single, easily understood numerical value to evaluate the overall sharpness of an image. The index is calculated by weighting the resolution index and the blur index, such that higher resolution and lower blur result in a higher sharpness index value, thus accurately reflecting the image's sharpness. The sharpness index is calculated by substituting the resolution index and the blur index into the formula... Obtaining Clarity Indicators , , This indicates the highest and clearest resolution, with rich image details. This indicates that at least one of the values ​​is 0, meaning the image is extremely blurry or has very low resolution. This refers to the resolution index. This is the ambiguity index.

[0046] Based on text readability coefficient and imaging quality coefficient The text recognition demand index, which characterizes the degree of clarity requirement, is obtained. The text recognition demand index is calculated by substituting the text readability coefficient and the image quality coefficient into the formula. Obtain the text recognition demand index , , This indicates no need (the text is very easy to understand and the image quality is excellent). This indicates the highest demand (extremely difficult text and extremely poor image quality), among which... The text readability coefficient. The "Text Recognition Demand Index" is a numerical value that quantifies the image sharpness requirements of an OCR system. It comprehensively considers the readability of the text itself (such as font size and text density) and the image acquisition quality (such as contrast and lighting) to determine how high an image sharpness the OCR system needs to effectively recognize text under current conditions. The index is designed so that the more difficult the text is to recognize and the worse the image quality, the higher the text recognition demand index, indicating a higher requirement for sharpness.

[0047] Substitute the clarity index and text recognition demand index into the formula. Get a clear match Sharpness matching is a comprehensive metric that evaluates the degree of matching between the current image sharpness and the text recognition requirements. It compares the actual image sharpness (sharpness index) with the text recognition requirements. The required clarity (text recognition requirement index) and OCR system This formula quantifies whether the current image meets the recognition requirements, and to what extent. It includes three cases, flexibly handling different scenarios such as no requirement, fully meeting the requirements, and insufficient clarity. , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This indicates insufficient clarity, and the confidence threshold should be appropriately lowered to retain more information. The smaller the value, the more severe the deficiency. This represents the demand index for text recognition. This is an indicator of sharpness.

[0048] In the aforementioned parsing and vectorization methods for unstructured documents, this invention further refines the calculation process for sharpness matching to more accurately assess the impact of image quality on OCR recognition. This process first obtains the original resolution and blurriness of the image and performs max-min normalization to obtain standardized resolution and blurriness indices. These indices are then cleverly combined using a square root product formula. A sharpness index, which comprehensively reflects the actual sharpness of an image, is calculated. Simultaneously, this method also utilizes a previously calculated text readability coefficient. and imaging quality coefficient Through formula This method quantifies the actual sharpness requirements for text recognition, generating a text recognition requirement index. Finally, a piecewise function is used to compare the actual sharpness index with the text recognition requirement index to determine the sharpness matching degree. This computational method dynamically assesses whether the current image's sharpness is sufficient to support the text recognition task and quantifies its degree of adequacy. Through this architecture, the system avoids over-optimization when image sharpness is too high or blind recognition when sharpness is insufficient. Instead, it provides a more precise and personalized basis for adjusting the subsequent OCR confidence threshold based on the actual matching degree, thereby significantly improving the robustness and accuracy of OCR processing. Through the above technical solution, this invention can accurately quantify the degree of matching between the sharpness of the current document image and the text recognition requirements. By comprehensively considering image resolution, blurriness, text readability, and imaging quality, this invention can generate a meaningful sharpness matching degree. This matching degree not only reflects the sharpness of the image itself, but more importantly, it combines the actual requirements of text recognition, thus accurately determining whether the current image sharpness is sufficient to support the OCR task. When the sharpness matching degree is low, it indicates that the image sharpness is insufficient to meet the recognition requirements. The system can use this to guide subsequent OCR processing. For example, the OCR confidence threshold can be appropriately lowered to retain more potential recognition results and avoid prematurely discarding effective information due to sharpness issues. Conversely, when the sharpness matching degree is high, there is no need to excessively adjust the threshold, thereby ensuring the accuracy and efficiency of recognition. This refined evaluation architecture enables the OCR system to adaptively optimize according to the actual quality and recognition difficulty of the document image, significantly improving the robustness and recognition accuracy of unstructured document parsing and vectorization processing.

[0049] The present invention further proposes the following steps for calculating the above-mentioned geometric end positive coefficient: Obtaining the tilt angle; the tilt angle refers to the degree of deviation of a document image relative to the horizontal or vertical direction, and is an important parameter for measuring the geometric distortion of a document image. This tilt angle can be obtained in various ways. For example, it can be determined by using image processing algorithms, such as Hough transform or Radon transform, to detect text lines or edges in the image and calculate their angle with a preset reference axis (such as the horizontal axis); or it can be determined by training a machine learning model to analyze the document image, identify text regions, and predict their overall tilt angle.

[0050] The tilt angle is normalized to its maximum and minimum values, and the normalized value is within the range of 0-1. The complement of the limiting value (i.e., one minus the limiting value) is taken as the geometric correction coefficient. , , This indicates no tilt and minimal need for geometric correction. The maximum tilt (45°) indicates that the document is extremely difficult to correct. The maximum and minimum tilt angles represent the upper and lower limits of the tilt angles that the system can effectively handle or anticipate, respectively. These values ​​are typically preset based on the actual application scenario, document type, and the OCR system's correction capabilities. For example, the minimum tilt angle can be set to 0 degrees, indicating that the document is perfectly upright; the maximum tilt angle can be set to 45 degrees, representing the maximum tilt limit that the OCR system can effectively correct. Maximum-minimum normalization of the tilt angle transforms tilt angle data of different dimensions or ranges into a unified 0-1 range, thereby eliminating the influence of dimensional differences on subsequent calculations and making the data comparable. This processing is usually achieved using the formula "Normalized value = (current value - minimum value) / (maximum value - minimum value)". Limiting the normalized value to the 0-1 range ensures that the normalized value strictly falls between 0 and 1, preventing values ​​from exceeding the expected range due to abnormal input or calculation errors. This can be achieved using functions such as min(1, max(0, normalized value)). Take the complement of the amplitude limit (i.e., one minus the amplitude limit) as the geometric correction coefficient. The purpose is to convert the tilt degree index into an index of "straightness" or "low geometric correction requirement". The greater the tilt degree, the larger the normalized value and the smaller its complement, indicating a lower geometric straightness coefficient and a higher geometric correction requirement; conversely, the smaller the tilt degree, the smaller the normalized value and the larger its complement, indicating a higher geometric straightness coefficient and a lower geometric correction requirement.

[0051] This invention obtains the tilt angle of a document image and, combined with preset maximum and minimum tilt angles, first performs a maximum-minimum normalization process on the tilt angle, mapping it to a uniform range of 0 to 1. Then, the normalized value is clipped to ensure it strictly remains between 0 and 1. Based on this, the geometrical straightness coefficient is obtained by calculating the complement of this clipped value, i.e., subtracting the clipped value from 1. The geometric positive coefficient This value intuitively reflects the geometrical straightness of the document image. A higher value indicates a more straight image and a lower need for geometric correction; conversely, a lower value indicates a more severe image tilt and a greater difficulty in geometric correction. In this way, the system can quantify the geometric quality of the document image, providing crucial input for the dynamic adjustment of the subsequent OCR confidence threshold. When the document image has a low degree of tilt, the geometrical straightness coefficient... A higher geometrical alignment coefficient indicates a lower demand for geometrical correction. In this case, the OCR system can maintain a high confidence threshold to ensure the accuracy of the recognition results. Conversely, when the document image is highly tilted, the geometrical alignment coefficient will be lower. A low confidence threshold indicates significant difficulty in geometric correction. The system may need to appropriately lower the OCR confidence threshold to avoid missing valid information due to an overly strict threshold, thus ensuring both recognition rate and recall. Through the above technical solution, the present invention can accurately quantify the slant degree of unstructured documents and convert it into a geometric symmetry coefficient. This coefficient directly reflects the geometric quality of a document and its need for geometric correction. This allows the OCR system to dynamically adjust the OCR confidence threshold based on the actual tilt of the document, avoiding a decrease in recognition accuracy or unnecessary geometric correction processing due to document tilt. When the document tilt is low, a higher confidence threshold can be maintained to ensure recognition accuracy; when the tilt is high, the threshold can be appropriately lowered to improve recall, thus achieving more robust and efficient text recognition and parsing on documents of different geometric qualities.

[0052] This invention further proposes the following steps for calculating the above-mentioned OCR confidence threshold: Obtain the geometrical alignment coefficient and sharpness matching score. The geometrical alignment coefficient is an indicator that characterizes the degree to which the document's tilt angle requires geometric correction, with a value ranging from 0 to 1. In the calculation of the OCR confidence threshold, the geometrical alignment coefficient serves as a key adjustment factor, reflecting the potential impact of document geometric quality on recognition accuracy. A higher value indicates a more upright document, and the less the OCR engine is affected by geometric deformation during character recognition, thus allowing for a relatively high confidence threshold. The sharpness matching score is an indicator that characterizes the degree to which image sharpness meets the requirements of text recognition, also ranging from 0 to 1. In the calculation of the OCR confidence threshold, the sharpness matching score serves as another important adjustment factor, reflecting the degree of matching between document image sharpness and text recognition requirements. A higher value indicates a sharper image that better meets recognition requirements, and the less the OCR engine is affected by image quality during character recognition, thus allowing for a relatively high confidence threshold.

[0053] Based on the sharpness match and geometric mean square, a comprehensive quality factor is obtained by geometrically averaging the two. The target OCR confidence threshold is then obtained by interpolating the comprehensive quality factor between the minimum confidence threshold and the maximum confidence threshold, where both the sharpness match and geometric mean square are positively correlated with the target threshold. Specifically, the calculation method involves substituting the geometric mean square and the sharpness match into the formula. Obtain the target OCR confidence threshold. The function of this formula is to set the minimum confidence threshold. Maximum confidence threshold Clear matching degree and geometric positive coefficient Taking all factors into account, this allows for dynamic adjustment of the OCR recognition strictness. This is achieved by adjusting the clarity of the match. and geometric positive coefficient Taking the square root of the product of these two key document quality metrics effectively merges them into a comprehensive quality factor. This factor, varying between 0 and 1, comprehensively reflects the overall identifiability of the document. This comprehensive quality factor is then multiplied by the difference between the maximum and minimum thresholds, and then added to the minimum threshold to achieve the target threshold. Within a preset reasonable range (from) arrive It dynamically adjusts within a given range to adapt to unstructured documents of varying qualities. The minimum confidence threshold, The maximum confidence threshold. For clear matching accuracy, The geometric positive coefficient. Minimum confidence threshold. This refers to the lowest confidence score that an OCR engine is willing to accept when recognizing characters, even if the document quality is extremely poor. This threshold can be set as a fixed baseline value, such as 0.3 or 0.4, based on the inherent characteristics of the OCR engine and the needs of real-world application scenarios, through extensive experimental data analysis or expert experience. Alternatively, a dynamic reference value can be obtained by statistically analyzing historical recognition results and using the lowest percentile (e.g., the 5th percentile) of the confidence scores for all successfully recognized characters. Maximum confidence threshold. This refers to the highest confidence score that an OCR system expects to achieve under ideal document quality conditions. This threshold is typically set as the highest confidence value that the OCR engine can output, such as 0.95 or 0.99, to ensure that, under optimal recognition conditions, the highest confidence score is preserved as much as possible. Alternatively, the highest confidence value that the OCR engine can achieve can be used as the maximum confidence threshold based on the engine's theoretical performance metrics.

[0054] The present invention aims to optimize the recognition performance of unstructured documents by establishing an architecture that dynamically adjusts the OCR confidence threshold. The core of this architecture lies in first setting a reasonable range for the variation of the OCR confidence threshold, starting from the minimum confidence threshold... and maximum confidence threshold Jointly defined. Next, the system will comprehensively consider two key quality dimensions of the document: clarity and relevance. and geometric positive coefficient Clear match This reflects the visual quality of the document image, including the impact of factors such as font size, text density, color contrast, lighting, resolution, and blurriness on text recognition. Geometric regularity coefficient. This reflects the document's geometric integrity, specifically the need for geometric correction of the tilt angle. After obtaining these two key coefficients, they are substituted into the formula. To calculate the target OCR confidence threshold This formula cleverly combines... and The product of these factors is squared to generate a comprehensive document quality factor. This factor sensitively reflects the overall legibility of a document: if either clarity or geometric regularity is poor, the factor will decrease significantly; conversely, if both are good, the factor will approach 1. Subsequently, this comprehensive quality factor is used in… and Interpolation is performed between these values ​​to dynamically determine the final target OCR confidence threshold. This dynamically adjusted architecture ensures that the OCR system can intelligently adapt to unstructured documents of varying qualities. When the document quality is high (i.e., ... and All are close to 1), target threshold It will approach This allows OCR engines to use stricter standards to filter recognition results, thereby improving accuracy and reducing errors. Conversely, when document quality is low (i.e., ... or (lower), target threshold It will approach This approach allows the OCR engine to adopt a more lenient standard for accepting recognition results, thereby improving the recall rate and avoiding the omission of valid information due to excessively high thresholds. In this way, the method effectively balances the accuracy and recall of OCR, solving the challenge of setting an OCR confidence threshold that ensures both recognition quality and sufficient information extraction in complex and ever-changing unstructured document environments.

[0055] Through the above technical solution, this invention can dynamically and intelligently adjust the OCR confidence threshold based on the actual quality of the unstructured document. Specifically, it adjusts the threshold by comprehensively considering the clarity of the match. and geometric positive coefficient By substituting this information into a specific calculation formula, a target OCR confidence threshold highly adapted to document quality can be generated. This adaptive threshold adjustment architecture effectively addresses the challenges faced by traditional fixed threshold or simple linear adjustment methods when processing unstructured documents of varying quality. For high-quality documents, the system can employ a stricter threshold, significantly improving OCR accuracy and reducing false recognitions; for low-quality documents, the system can appropriately lower the threshold, maximizing the retention of effective information, improving recall, and preventing valuable information from being incorrectly filtered out due to excessively high thresholds. This ability to balance accuracy and recall enables the OCR system to exhibit superior performance in various complex scenarios, greatly enhancing the robustness and practicality of unstructured document parsing and vectorization processing.

[0056] As a preferred embodiment of the technical solution of the present invention, the present invention proposes a parsing and vectorization processing system for unstructured documents, wherein the system 10 includes: The readability analysis module 11 is used to calculate the text readability coefficient, which represents the difficulty of character recognition, based on the obtained font size and text density. The imaging analysis module 12 is used to calculate the imaging quality coefficient, which characterizes the image acquisition quality, based on the acquired text color, background contrast, and ambient lighting. The matching degree determination module 13 is used to calculate the sharpness matching degree, which represents the degree to which the sharpness meets the text recognition requirements, based on the obtained resolution and blur, as well as the text readability coefficient and the imaging quality coefficient. The correction information determination module 14 is used to calculate the geometric straightening coefficient, which characterizes the geometric correction requirement of the document's tilt angle, based on the acquired tilt angle. The confidence determination module 15 is used to calculate the OCR confidence threshold based on the geometric end-correction coefficient and the sharpness matching degree, and adjust the current OCR confidence threshold to the target OCR confidence threshold.

[0057] The calculation of the text readability coefficient is as follows: Max-min normalization is performed on the font size and text density respectively, and the normalization value is limited to the range of 0-1 to obtain the font size index and text density index. The text readability coefficient is obtained by weighting and combining the font size index and the text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated with the text readability coefficient.

[0058] Furthermore, the calculation of the imaging quality coefficient is as follows: The contrast ratio between the current text color and the background is calculated by comparing it with the maximum contrast value, and then the upper limit of the ratio is set to 1 using the min function to obtain the contrast index. The ambient light intensity is subjected to maximum-minimum normalization and the normalization value is limited to the range of 0-1 to obtain the ambient light index. The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one aspect is extremely poor, and the image is almost indistinguishable.

[0059] Specifically, the calculation of the clarity matching degree is as follows: The resolution and ambiguity are respectively subjected to maximum-min normalization, and the normalization value is limited to the range of 0-1 to obtain the resolution index and ambiguity index. Based on the resolution index and the blur index, a sharpness index that comprehensively reflects the sharpness of an image is obtained. Based on text readability coefficient and imaging quality coefficient This yields a text recognition demand index that characterizes the degree of clarity requirement; Substitute the clarity index and text recognition demand index into the formula. Get a clear match , , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This represents the demand index for text recognition. This is an indicator of sharpness.

[0060] The system for parsing and vectorizing unstructured documents includes a processor and a memory, the memory and the processor being connected; the memory is used to store programs, instructions or code; the processor is used to execute the programs, instructions or code in the memory to implement the above-mentioned method for parsing and vectorizing unstructured documents.

[0061] The core innovation of this embodiment lies in combining text readability coefficient, imaging quality coefficient, sharpness matching degree, and geometric uprightness coefficient in a multi-dimensional fusion manner. This allows for real-time evaluation of document quality and dynamic matching of text recognition requirements, achieving the effect of maximizing information recall while ensuring OCR accuracy. Specifically, during implementation, the processor first calculates the text readability coefficient, representing the difficulty of character recognition, based on the acquired font size and text density. Secondly, it calculates the imaging quality coefficient, representing the image acquisition quality, based on the acquired text color, background contrast, and ambient lighting. Then, based on the acquired resolution and blurriness, as well as the text readability coefficient and imaging quality coefficient, it calculates the sharpness matching degree, representing the degree to which the sharpness meets the text recognition requirements. Simultaneously, based on the acquired tilt angle, it calculates the geometric uprightness coefficient, representing the geometric correction requirements of the document tilt angle. Finally, based on the geometric uprightness coefficient and sharpness matching degree, it calculates the OCR confidence threshold and adjusts the current OCR confidence threshold to the target OCR confidence threshold.

[0062] Through the above technical solution, the system can adaptively adjust the OCR confidence threshold according to the dynamic changes in document quality. For example, when processing low-quality documents (such as small font size, high density, low contrast, blurriness, or tilt), the system calculates lower text readability coefficients, image quality coefficients, sharpness matching, and geometric uprightness coefficients, thus generating a lower target OCR confidence threshold to retain more information and improve recall. Conversely, for high-quality documents, the system generates a higher target OCR confidence threshold to ensure recognition accuracy. This architecture effectively overcomes the limitations of traditional fixed threshold strategies, avoids the inadequacy of single-factor adjustment, achieves a dynamic balance between accuracy and recall, and significantly improves the robustness and overall performance of unstructured document parsing and vectorization processing.

[0063] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for parsing and vectorizing unstructured documents, characterized in that, The method includes: Based on the obtained font size and text density, a text readability coefficient, which represents the difficulty of character recognition, is calculated. Based on the acquired text color, background contrast, and ambient lighting, the imaging quality coefficient, which characterizes the image acquisition quality, is calculated. Based on the obtained resolution and blur, as well as the text readability coefficient and image quality coefficient, the sharpness matching degree, which represents the degree to which the sharpness meets the text recognition requirements, is calculated; the calculation steps for the sharpness matching degree are as follows: The resolution and ambiguity are respectively subjected to maximum-min normalization, and the normalization value is limited to the range of 0-1 to obtain the resolution index and ambiguity index. Based on the resolution index and the blur index, a sharpness index that comprehensively reflects the sharpness of an image is obtained. Based on text readability coefficient and imaging quality coefficient This yields a text recognition demand index that characterizes the degree of clarity requirement; Substitute the clarity index and text recognition demand index into the formula. Get a clear match , , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This represents the demand index for text recognition. For clarity indicators; Based on the obtained tilt angle, a geometric straightening coefficient representing the geometric correction requirement of the document tilt angle is calculated; Based on the geometric rightness coefficient and the clarity matching degree, the OCR confidence threshold is calculated and the current OCR confidence threshold is adjusted to the target OCR confidence threshold.

2. The method for parsing and vectorizing unstructured documents according to claim 1, characterized in that, The steps for calculating the text readability coefficient are as follows: Max-min normalization is performed on the font size and text density respectively, and the normalization value is limited to the range of 0-1 to obtain the font size index and text density index. The text readability coefficient is obtained by weighting and combining the font size index and the text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated with the text readability coefficient.

3. The method for parsing and vectorizing unstructured documents according to claim 2, characterized in that, The steps for calculating the imaging quality coefficient are as follows: The contrast ratio between the current text color and the background is calculated by comparing it with the maximum contrast value, and then the upper limit of the ratio is set to 1 using the min function to obtain the contrast index. The ambient light intensity is subjected to maximum-minimum normalization and the normalization value is limited to the range of 0-1 to obtain the ambient light index. The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one aspect is extremely poor, and the image is almost indistinguishable.

4. The method for parsing and vectorizing unstructured documents according to claim 1, characterized in that, The calculation steps for the geometric end positive coefficient are as follows: The tilt angle is normalized to its maximum and minimum values, and the amplitude-limited normalized value is within the range of 0-1. The complement of the amplitude-limited value is taken as the geometric correction coefficient. , , This indicates no tilt and minimal need for geometric correction. This indicates that the tilt has reached its maximum, making correction extremely difficult.

5. The method for parsing and vectorizing unstructured documents according to claim 1, characterized in that, The calculation steps for the OCR confidence threshold are as follows: The overall quality factor is obtained by geometrically averaging the clarity matching degree and the geometric positivity coefficient. The target OCR confidence threshold is obtained by interpolating between the minimum and maximum confidence thresholds based on the comprehensive quality factor. Both the clarity matching degree and the geometric positivity coefficient are positively correlated with the target threshold.

6. A parsing and vectorization system for unstructured documents, characterized in that, The system is used to implement the parsing and vectorization processing method for unstructured documents as described in any one of claims 1 to 5, and the system comprises: The readability analysis module is used to calculate the text readability coefficient, which represents the difficulty of character recognition, based on the obtained font size and text density. The imaging analysis module is used to calculate the imaging quality coefficient, which characterizes the image acquisition quality, based on the acquired text color, background contrast, and ambient lighting. The matching degree determination module is used to calculate the sharpness matching degree, which represents the degree to which the sharpness meets the text recognition requirements, based on the acquired resolution and blurriness, as well as the text readability coefficient and image quality coefficient; the calculation content of the sharpness matching degree is as follows: The resolution and ambiguity are respectively subjected to maximum-min normalization, and the normalization value is limited to the range of 0-1 to obtain the resolution index and ambiguity index. Based on the resolution index and the blur index, a sharpness index that comprehensively reflects the sharpness of an image is obtained. Based on text readability coefficient and imaging quality coefficient This yields a text recognition demand index that characterizes the degree of clarity requirement; Substitute the clarity index and text recognition demand index into the formula. Get a clear match , , This indicates that the current clarity fully meets or even exceeds the text recognition requirements, and there is no need to lower the threshold due to clarity issues. This represents the demand index for text recognition. For clarity indicators; The correction information determination module is used to calculate the geometric straightening coefficient, which characterizes the geometric correction requirement of the document's tilt angle, based on the acquired tilt angle. The confidence determination module is used to calculate the OCR confidence threshold based on the geometric end-positive coefficient and the sharpness matching degree, and adjust the current OCR confidence threshold to the target OCR confidence threshold.

7. The parsing and vectorization system for unstructured documents according to claim 6, characterized in that, The calculation of the text readability coefficient is as follows: Max-min normalization is performed on the font size and text density respectively, and the normalization value is limited to the range of 0-1 to obtain the font size index and text density index. The text readability coefficient is obtained by weighting and combining the font size index and the text density index. The font size index is positively correlated with the text readability coefficient, while the text density index is negatively correlated with the text readability coefficient.

8. The parsing and vectorization system for unstructured documents according to claim 7, characterized in that, The calculation of the imaging quality coefficient is as follows: The contrast ratio between the current text color and the background is calculated by comparing it with the maximum contrast value, and then the upper limit of the ratio is set to 1 using the min function to obtain the contrast index. The ambient light intensity is subjected to maximum-minimum normalization and the normalization value is limited to the range of 0-1 to obtain the ambient light index. The image quality coefficient is obtained by multiplying the contrast index and the ambient light index. , , This indicates the highest contrast and best lighting, resulting in excellent image acquisition quality. This indicates that at least one aspect is extremely poor, and the image is almost indistinguishable.

Citation Information

Patent Citations

  • Self-adaptive text extraction method and system based on artificial intelligence

    CN121658657A