Ocr image recognition method and system based on large model self-learning
By introducing stroke-level texture and pen pressure joint difference analysis and cross-part self-learning verification mechanism into OCR technology, the problem of insufficient recognition accuracy of multi-part documents and handwritten signature documents is solved, adaptive closed-loop optimization is achieved, and recognition accuracy and reliability are improved.
Patent Information
- Application Number
- CN202511761374.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-05-15
- Estimated Expiration
- 2045-11-27
AI Technical Summary
Existing OCR technology lacks sufficient recognition accuracy in complex scenarios such as multi-part documents and handwritten signature documents. It is difficult to distinguish fine-grained anomalies such as pen breaks caused by insufficient pen pressure and ink bleeding caused by ink penetration, and it lacks adaptive capabilities.
By introducing stroke-level texture and pen pressure joint difference analysis and cross-level self-learning verification mechanism, an adaptive closed-loop optimization architecture is established through image acquisition, quality judgment, re-acquisition, stroke feature analysis and cross-level verification to achieve online correction of image quality and model self-learning.
It significantly improves recognition accuracy and operational reliability in complex scenarios, achieves precise separation of acquisition defects and writing defects, reduces the rate of manual intervention, and ensures the continuous evolution of the model in response to actual defects.
Smart Images

Figure CN121459369B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an OCR image recognition method and system based on large model self-learning. Background Technology
[0002] Currently, optical character recognition (OCR) technology has been widely applied in document automation scenarios such as invoice entry, document digitization, and contract recognition. Traditional OCR methods mostly rely on convolutional neural network (CNN) or recurrent neural network (RNN) models to generate structured text results by performing character segmentation, feature extraction, and classification on the input image. However, in complex scenarios such as multi-part documents and handwritten signature documents, there are still several bottlenecks in recognition accuracy.
[0003] Meanwhile, traditional OCR algorithms often employ global feature extraction methods based on edge detection or histogram of directional gradients for stroke-level feature processing, making it difficult to effectively distinguish between fine-grained anomalies such as "broken strokes caused by insufficient pen pressure" and "blurring caused by ink penetration." Because a joint feature analysis model between stroke texture and pen pressure has not been established, the algorithm struggles to accurately identify structural anomalies in handwriting, affecting character structure reconstruction and subsequent semantic recognition.
[0004] Chinese Patent Publication No. CN119992571A discloses a method and system for improving image recognition rate based on Tesseract-OCR. This method is implemented by performing character recognition and extraction on a first input image using Tesseract-OCR, and by optimizing the recognition process to improve image recognition accuracy. Specifically, it involves performing preprocessing operations on the first input image to be recognized in the training dataset and training the model on the training dataset. Image preprocessing is one of the key steps in improving OCR accuracy. By performing a series of preprocessing operations on the first input image, image quality can be optimized, and the OCR engine's ability to recognize text regions can be improved.
[0005] At the same time, existing image recognition technology is essentially still a single-engine, single-shot recognition framework; its accuracy improvement relies heavily on the optimization of image preprocessing and training data, and it does not have the ability to adaptively and closed-loop correct collection defects and writing defects in complex multi-part document scenarios. Summary of the Invention
[0006] To address this, the present invention provides an OCR image recognition method and system based on large model self-learning, which overcomes the problems of limited recognition accuracy and insufficient model adaptability in the prior art by introducing stroke-level texture and pen pressure joint difference analysis and cross-level self-learning verification mechanism in the OCR image recognition process.
[0007] To achieve the above objectives, on the one hand, the present invention provides an OCR image recognition method based on large model self-learning, comprising:
[0008] At the initial sampling resolution, acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch;
[0009] Based on the panoramic document image and the partial document image, extract the target area image within the written text area of any single document layer, and determine the image quality category of the target area image;
[0010] When the image is classified as an image defect, the corresponding multi-part document to be verified is sent to the next verification batch and an image re-acquisition step is performed to re-acquire the corresponding panoramic document image and local document image. When the number of images in the target area is greater than the preset trigger number, the initial sampling resolution is adjusted.
[0011] When the image belongs to the category of image quality to be determined, the target area image is acquired, and stroke feature analysis is performed to obtain stroke difference feature analysis results.
[0012] Upon obtaining the second stroke difference feature analysis result, the panoramic document image and partial document image of the other document layers are called, and cross-link verification operation is performed.
[0013] Furthermore, the process of determining the image quality category of the target region image includes:
[0014] The number of executions of the multi-part document corresponding to the target area image is obtained. When the number of executions is less than or equal to a preset execution threshold, the number of valid information pixels and the total number of pixels of the target area image are obtained. The overall pixel density ratio of the target area image is calculated based on the number of valid information pixels and the total number of pixels.
[0015] The pixel density ratio is compared with a preset image clarity threshold. When the pixel density ratio is greater than the image clarity threshold, the effective information pixel count and total pixel count corresponding to the writing field area of several types of information fields in the target area image are obtained to calculate the regional pixel density ratio of each writing field area.
[0016] When the pixel density ratio is less than or equal to the image sharpness threshold, it is the first image defect category in the image defect category;
[0017] When the pixel density ratio of any of the aforementioned regions is less than or equal to a preset effective pixel threshold for the field, it is classified as the second image defect category in the image defect category.
[0018] When the pixel density ratio of all the regions is greater than the preset effective pixel threshold of the field, it belongs to the image quality category to be determined;
[0019] When the defect falls under the category of image defects, the multi-part document information corresponding to the writing field area is transmitted to the next verification batch, and the corresponding image re-acquisition step of acquiring the panoramic document image and the partial document image is executed.
[0020] The number of target area images is obtained when the number of times the image re-acquisition step is executed on the multi-part document corresponding to the target area image is greater than a preset execution number threshold. When the number of target area images is greater than a preset trigger number, a first adjustment operation is performed on the initial sampling resolution.
[0021] Furthermore, the process of performing the first adjustment operation on the initial sampling resolution includes:
[0022] Obtain the overall pixel density ratio and the regional pixel density ratio from the historical image acquisition data corresponding to the target region image, and calculate the average of the overall pixel density ratio and the regional pixel density ratio;
[0023] Based on the mean and the number of times the target region image is executed, the sampling resolution adjustment step size is calculated using the sampling resolution adjustment step size calculation formula, and the initial sampling resolution is adjusted to the updated sampling resolution.
[0024] Furthermore, the process for performing stroke feature analysis includes:
[0025] Obtain the stroke boundary contours of each written character block in the target area image, and extract several stroke segments of each written character block based on the stroke boundary contours.
[0026] Based on the spatial adjacency relationship of the handwriting segments, obtain the starting coordinates and ending coordinates of each handwriting segment, and construct a sequence of undetermined segments corresponding to each handwriting segment.
[0027] After calculating the endpoint spacing, the endpoint spacing value between the endpoints of adjacent stroke segments within each stroke unit is obtained. Based on the endpoint spacing value and a preset breakage judgment threshold, it is determined whether each stroke unit has a breakage.
[0028] If the endpoint spacing value is greater than the preset breakage judgment threshold, it is determined to be broken. For a single stroke determined to be broken, the endpoint spacing value is compared with the preset maximum repairable spacing threshold. If the endpoint spacing value is less than the preset maximum repairable spacing threshold, it is determined to be a repairable break. After trajectory fitting and extension splicing operations, the spliced stroke trajectory is generated and the font restoration image is obtained.
[0029] If the endpoint spacing value is greater than or equal to the preset maximum repairable spacing threshold, it is determined to be an unrepairable severe break, and the subsequent texture and pen pressure joint difference analysis operation is performed to obtain stroke difference feature parameters, and the stroke anomaly category to which the stroke belongs is determined based on the difference feature parameters.
[0030] Furthermore, the process of constructing a sequence of segments to be determined for each of the aforementioned handwriting segments includes:
[0031] Obtain the coordinates of the starting point of each individual stroke within each written character block;
[0032] Sort by starting point x-coordinate from smallest to largest;
[0033] When the difference in the horizontal coordinates of two or more strokes is less than or equal to a preset pixel threshold, they are considered to be in the same column and sorted from top to bottom according to their vertical coordinates within the same column.
[0034] The sorting results constitute a sequence of segments to be determined, in order to simulate the stroke order during writing.
[0035] Furthermore, the process of joint texture and pen pressure difference analysis includes:
[0036] Obtain the grayscale pixel distribution features of each stroke unit in the segment sequence to be determined, and calculate the uniformity of stroke texture;
[0037] Determine the connection relationships between individual strokes and perform merging to generate stroke feature regions;
[0038] Extract the grayscale distribution curve sequence within each stroke feature region and calculate the grayscale change trend to determine the texture uniformity category;
[0039] Obtain the pen pressure sampling point sequence of individual strokes, calculate the width change rate along the main axis, and obtain the relative pen pressure feature category;
[0040] Input the texture uniformity category and the relative pen pressure feature category into the difference coefficient calculation model, calculate the joint difference coefficient of stroke texture and pen pressure, and output the stroke difference feature analysis results corresponding to the stroke difference feature parameters.
[0041] Furthermore, the process of calculating the uniformity of the stroke texture of the individual strokes includes:
[0042] Determine whether there are intersections between individual strokes;
[0043] When there are intersections, individual strokes that are connected are merged to obtain the corresponding connected strokes as a whole.
[0044] Based on the shape of the line segment connecting the strokes, and according to the preset outward expansion width, a boundary expansion operation is performed along the direction perpendicular to the line segment to generate several stroke analysis areas.
[0045] The analysis area and the unconnected independent stroke unit area together constitute multiple stroke feature areas, and the areas are numbered according to their spatial position order, wherein the sequential number of the stroke unit is the serial number, and the number of the stroke feature area is the label.
[0046] The minimum value of the individual stroke number within each stroke feature region is used as the label of that stroke feature region;
[0047] When there are gaps in the labels of stroke feature regions, a label rearrangement operation is performed to move the labels of subsequent stroke feature regions forward in sequence to eliminate the gaps.
[0048] Several grayscale analysis areas are set within each stroke feature area. The grayscale distribution curves at each analysis point are obtained, and the trend analysis of the grayscale distribution curves is performed to obtain the category of texture uniformity of the corresponding stroke feature area.
[0049] Furthermore, the process of analyzing the changing trend of the grayscale distribution curve includes:
[0050] Obtain the sampling point sequence of the grayscale distribution curve in each grayscale analysis area, calculate the grayscale change rate between adjacent sampling points, and generate the corresponding grayscale change gradient sequence.
[0051] When the grayscale gradient changes abruptly between adjacent sampling points and the magnitude of the abrupt change is greater than a preset cliff change threshold, a first texture uniformity category is obtained.
[0052] When the grayscale gradient does not have abrupt changes between adjacent sampling points or has abrupt changes and the magnitude of the abrupt changes is less than or equal to a preset cliff change threshold, a second texture uniformity category is obtained.
[0053] Furthermore, the process of calculating the stroke difference feature parameters includes:
[0054] The texture uniformity category and the relative pen pressure feature category are respectively converted into preset texture uniformity quantization value and relative pen pressure quantization value;
[0055] The difference coefficient calculation model calculates the stroke difference feature parameters and the stroke difference feature analysis results corresponding to the stroke difference feature parameters based on the texture uniformity quantization value, the relative pen pressure quantization value, and the preset weighting coefficient.
[0056] On the other hand, the present invention also provides a system for applying the above-mentioned OCR image recognition method based on large model self-learning, comprising:
[0057] The image acquisition module is used to acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch at an initial sampling resolution.
[0058] The image quality determination module, connected to the image acquisition module, is used to extract the target area image within any written text area of a single-part document based on the panoramic document image and the partial document image, and to determine the image quality category of the target area image.
[0059] The re-acquisition module, connected to the image acquisition module and the image quality determination module, is used to send the corresponding multi-part document to be verified to the next verification batch and perform the image re-acquisition step to re-acquire the corresponding panoramic document image and partial document image when the image of the target area belongs to the image defect category.
[0060] The stroke feature analysis module is connected to the image quality determination module and is used to perform stroke feature analysis operation to obtain stroke difference feature analysis results when the target area image belongs to the image quality category to be determined.
[0061] The cross-link verification module, connected to the stroke feature analysis module, is used to call the panoramic and partial document images of the other document layers and perform cross-link verification operations when the second stroke difference feature analysis result is obtained.
[0062] Compared with existing technologies, the advantages of this invention are as follows: by establishing an adaptive closed-loop optimization architecture for multi-part document OCR, the recognition accuracy and operational reliability in complex scenarios are significantly improved; traditional OCR technology has poor robustness to ink penetration, pen pressure defects, and environmental fluctuations; through online correction of acquisition parameters, the scanning resolution is intelligently adjusted based on defect data, improving image quality from the source; joint depth diagnosis of pixel density and stroke features enables accurate separation of acquisition defects and writing defects, avoiding erroneous repairs; the cross-part verification mechanism provides final verification of results, transforming high- and low-quality comparison samples into a high-quality data stream for model self-learning, ensuring that the deployed large model can continuously evolve to address actual defects; the overall solution significantly reduces the rate of manual intervention, achieving an effective balance between accuracy, efficiency, and self-learning capabilities.
[0063] Furthermore, by simulating the left-to-right writing order using the horizontal axis priority sorting, and sorting the vertical axis within the same column using a preset pixel threshold, the sequence of segments to be determined constructed by this sorting result provides logically correct temporal input, greatly ensuring the accuracy of subsequent stroke continuity analysis. Attached Figure Description
[0064] Figure 1This is a flowchart illustrating the OCR image recognition method based on large model self-learning according to an embodiment of the present invention.
[0065] Figure 2 This is a logic decision diagram for performing stroke feature analysis operations in an embodiment of the present invention;
[0066] Figure 3 This is a logic decision diagram for cross-chain verification operations in an embodiment of the present invention;
[0067] Figure 4 This is a schematic diagram of the structure of the OCR image recognition system based on large model self-learning according to an embodiment of the present invention. Detailed Implementation
[0068] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0069] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.
[0070] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "inner", "outer", etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0071] Furthermore, it should be noted that, in the description of this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0072] Please see Figure 1 The diagram shown is a flowchart of an OCR image recognition method based on large model self-learning according to an embodiment of the present invention. The present invention provides an OCR image recognition method based on large model self-learning, comprising:
[0073] At the initial sampling resolution, acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch;
[0074] Based on the panoramic document image and the partial document image, extract the target area image within the written text area of any single document layer, and determine the image quality category of the target area image;
[0075] When the image is classified as an image defect, the corresponding multi-part document to be verified is sent to the next verification batch and an image re-acquisition step is performed to re-acquire the corresponding panoramic document image and local document image. When the number of images in the target area is greater than the preset trigger number, the initial sampling resolution is adjusted.
[0076] When the image belongs to the category of image quality to be determined, the target area image is acquired, and stroke feature analysis is performed to obtain stroke difference feature analysis results.
[0077] Upon obtaining the second stroke difference feature analysis result, the panoramic document image and partial document image of the other document layers are called, and cross-link verification operation is performed.
[0078] In this embodiment, the current verification batch is a set of multi-part documents to be identified that are simultaneously received and verified by the automated processing system.
[0079] The panoramic document image is a complete image obtained through a data acquisition device, containing information about the entire document layout. It is mainly used for the overall positioning and layout analysis of the document.
[0080] The local document images are high-resolution images captured or cropped for specific written fields on the document, such as amount, date, signature, etc., and are mainly used for accurate OCR recognition and image quality analysis.
[0081] The "any copy layer" refers to any copy or original layer in a multi-copy document that can be analyzed independently, such as the first or second copy of a four-copy invoice; the "written text area" is a pre-defined rectangular or specifically shaped area on the document page for users to handwrite information; the "target area image" is a local image extracted from the written text area of a certain copy layer that requires image quality assessment, stroke feature analysis, and final OCR recognition.
[0082] The stroke feature analysis operation is a series of image processing procedures, focusing on a refined quantitative analysis of the physical characteristics of handwritten characters, such as stroke shape, continuity, breakage, ink texture, and pen pressure changes.
[0083] The stroke difference feature analysis result is a quantitative index or classification result of the degree and type of stroke defects output by the system after performing the stroke feature analysis operation;
[0084] The first stroke difference feature analysis result indicates that the degree of stroke defect is relatively minor or within the repairable range, such as minor stroke breaks that can be repaired by interpolation fitting; the second stroke difference feature analysis result indicates that the degree of stroke defect is severe and cannot be solved by simple repair operations, such as large-area ink stains, severe missing strokes, or extreme blurring.
[0085] The cross-copy verification operation is a process in which the system automatically calls the single-layer image data of other copies of the document for cross-comparison and mutual verification when the analysis result of one copy of the document is highly uncertain.
[0086] The image quality category is a preliminary quality assessment classification of the target region image, including image defect category and image integrity category;
[0087] The image defect category is a classification within the image quality category that indicates that the image quality does not meet the requirements for high-precision OCR recognition.
[0088] The image acquisition defect category, namely the first image defect category, specifically refers to image quality problems caused by acquisition equipment and environmental factors such as scanner jitter, uneven lighting, and inaccurate focus.
[0089] The aforementioned text defect category, also known as the second image defect category, specifically refers to quality problems caused by the handwriting itself, such as faint handwriting, ink smudges, or poor copying results.
[0090] By establishing an adaptive closed-loop optimization architecture for multi-part document OCR, the recognition accuracy and operational reliability in complex scenarios are significantly improved. Traditional OCR technology has poor robustness to ink penetration, pen pressure defects, and environmental fluctuations. Through online correction of acquisition parameters, the scanning resolution is intelligently adjusted based on defect data, improving image quality from the source. Joint depth diagnosis of pixel density and stroke features enables accurate separation of acquisition defects and writing defects, avoiding incorrect repairs. The cross-part verification mechanism provides final verification of results, transforming high- and low-quality comparison samples into a high-quality data stream for model self-learning, ensuring that the deployed large model can continuously evolve to address actual defects. The overall solution significantly reduces the rate of manual intervention, achieving an effective balance between accuracy, efficiency, and self-learning capabilities.
[0091] Specifically, the process of determining the image quality category of the target region image includes:
[0092] The number of executions of the multi-part document corresponding to the target area image is obtained. When the number of executions is less than or equal to a preset execution threshold, the number of valid information pixels and the total number of pixels of the target area image are obtained. The overall pixel density ratio of the target area image is calculated based on the number of valid information pixels and the total number of pixels.
[0093] The pixel density ratio is compared with a preset image clarity threshold. When the pixel density ratio is greater than the image clarity threshold, the effective information pixel count and total pixel count corresponding to the writing field area of several types of information fields in the target area image are obtained to calculate the regional pixel density ratio of each writing field area.
[0094] When the pixel density ratio is less than or equal to the image sharpness threshold, it is the first image defect category in the image defect category;
[0095] When the pixel density ratio of any of the aforementioned regions is less than or equal to a preset effective pixel threshold for the field, it is classified as the second image defect category in the image defect category.
[0096] When the pixel density ratio of all the regions is greater than the preset effective pixel threshold of the field, it belongs to the image quality category to be determined;
[0097] When the defect falls under the category of image defects, the multi-part document information corresponding to the writing field area is transmitted to the next verification batch, and the corresponding image re-acquisition step of acquiring the panoramic document image and the partial document image is executed.
[0098] The number of target area images is obtained when the number of times the image re-acquisition step is executed on the multi-part document corresponding to the target area image is greater than a preset execution number threshold. When the number of target area images is greater than a preset trigger number, a first adjustment operation is performed on the initial sampling resolution.
[0099] In this embodiment, the system first obtains the number of times the multi-part document corresponding to the target area image is executed. The number of executions is used to characterize the total number of times the document has been collected or re-collected in the collection task.
[0100] If the current execution count is less than or equal to the preset execution count threshold, then proceed to the image quality analysis stage;
[0101] The preset execution count threshold is used to limit the frequency of repeated data collection and prevent the system from repeatedly collecting data when the collection accuracy is insufficient, thus avoiding resource waste. Preferably, in this embodiment, the execution count threshold is 3.
[0102] The number of effective information pixels refers to the number of pixels whose brightness or grayscale value is higher than a preset brightness threshold and has obvious structural texture. The total number of pixels is the total number of pixels in the entire image. The ratio of the two is the overall pixel density ratio, which is used to reflect the distribution density of effective information in the image.
[0103] The image sharpness threshold is used as a boundary value to distinguish between blurred and sharp images. Preferably, in this embodiment, it is set to 0.68. When the overall pixel density ratio is greater than the image sharpness threshold, the system further analyzes the writing field area; otherwise, it is directly determined to be the first image defect category in the image defect category, indicating that the overall image sharpness is insufficient.
[0104] The writing field area refers to the local text writing area defined in the template, including the name field, date field, amount field, and number field, etc.; the system calculates the area pixel density ratio for each writing field area, that is, the ratio of the number of effective information pixels in each area to the total number of pixels in the area;
[0105] The effective pixel threshold of the field is used to determine whether there is missing information or blurred handwriting in a local area. Preferably, in this embodiment, it is set to 0.72. If the pixel density ratio of any field area is less than or equal to the effective pixel threshold of the field, it is classified as the second image defect category in the image defect category. If the pixel density ratio of all areas is higher than the threshold, it is determined as an image quality category to be determined.
[0106] When the number of re-collections of the multi-part document corresponding to the target area image exceeds the preset execution number threshold, the cumulative number of such images in the current task queue is calculated; if the number is greater than the preset trigger number, the preset trigger number is used to trigger the statistical threshold for automatic optimization of the collection parameters, preferably 50, then the system performs the first adjustment operation on the initial sampling resolution of the collection device.
[0107] By introducing an execution count threshold to limit invalid resampling; using the overall pixel density ratio to quickly determine image acquisition defects and distinguish between overall blur and local defects; and then using the regional pixel density ratio to accurately identify handwriting defects such as missing handwriting information or insufficient ink; this multi-level pixel judgment mechanism ensures the accuracy of defect classification and drives the adjustment of the initial sampling resolution with data indicators.
[0108] Specifically, the process of performing the first adjustment operation on the initial sampling resolution includes:
[0109] Obtain the overall pixel density ratio and the regional pixel density ratio from the historical image acquisition data corresponding to the target region image, and calculate the average of the overall pixel density ratio and the regional pixel density ratio;
[0110] Based on the mean and the number of times the target region image is executed, the sampling resolution adjustment step size is calculated using the sampling resolution adjustment step size calculation formula, and the initial sampling resolution is adjusted to the updated sampling resolution.
[0111] In this embodiment, the formula for calculating the sampling resolution adjustment step size is: ;
[0112] in, This is the resolution adjustment coefficient, used to control the overall adjustment range, with a value range of 30-80;
[0113] The image sharpness threshold is preferably set to 0.68, which is used to define the boundary between sharp and blurry images.
[0114] It is the average of the overall pixel density ratio and the regional pixel density ratio, used to reflect the overall sharpness level of the current target area image;
[0115] This is a weighting coefficient for the number of executions, used to enhance the adjustment sensitivity in the case of multiple data acquisitions, with a value range of 0.2-0.4;
[0116] This is the number of times the target region image has been processed, used to record the number of resolution adjustment rounds performed on the current image during the sampling process;
[0117] The preset execution count threshold is preferably set to 3, which is used to limit the maximum number of iterations for resolution adjustment;
[0118] Preferably, in this embodiment, K = 50. =0.68 =3、 =0.3, to achieve dynamic balance adjustment of sampling resolution in multiple execution scenarios.
[0119] A dynamic adjustment factor is formed by calculating and combining the historical image quality average and the number of resampling operations; the adjustment formula ensures the sensitivity and stability of the response to environmental fluctuations; this adaptive mechanism effectively avoids excessive or delayed resolution adjustment and improves the quality stability of the image acquisition process.
[0120] See Figure 2 As shown, it is a logic decision diagram for performing stroke feature analysis operations in an embodiment of the present invention;
[0121] Specifically, the process of performing stroke feature analysis includes:
[0122] Obtain the stroke boundary contours of each written character block in the target area image, and extract several stroke segments of each written character block based on the stroke boundary contours.
[0123] Based on the spatial adjacency relationship of the handwriting segments, obtain the starting coordinates and ending coordinates of each handwriting segment, and construct a sequence of undetermined segments corresponding to each handwriting segment.
[0124] After calculating the endpoint spacing, the endpoint spacing value between the endpoints of adjacent stroke segments within each stroke unit is obtained. Based on the endpoint spacing value and a preset breakage judgment threshold, it is determined whether each stroke unit has a breakage.
[0125] If the endpoint spacing value is greater than the preset breakage judgment threshold, it is determined to be broken. For a single stroke determined to be broken, the endpoint spacing value is compared with the preset maximum repairable spacing threshold. If the endpoint spacing value is less than the preset maximum repairable spacing threshold, it is determined to be a repairable break. After trajectory fitting and extension splicing operations, the spliced stroke trajectory is generated and the font restoration image is obtained.
[0126] If the endpoint spacing value is greater than or equal to the preset maximum repairable spacing threshold, it is determined to be an unrepairable severe break, and the subsequent texture and pen pressure joint difference analysis operation is performed to obtain stroke difference feature parameters, and the stroke anomaly category to which the stroke belongs is determined based on the difference feature parameters.
[0127] In this embodiment, the stroke boundary contour is a set of closed or semi-closed contour lines extracted based on the stroke grayscale gradient change rate and edge direction consistency, which is used to define the outer edge range of the writing strokes.
[0128] The aforementioned stroke segments are stroke trajectory segments separated from the stroke boundary contour, and each stroke segment corresponds to the digital expression of a single continuous motion trajectory in the writing action.
[0129] The spatial adjacency relationship is the geometric relationship between adjacent stroke segments within the same writing block, used to determine the possibility of physical connection between stroke segments. The spatial adjacency relationship is based on the condition that the Euclidean distance between the endpoints is less than a preset spacing threshold and the angle between the direction vectors is less than 15°.
[0130] The sequence of undetermined segments of the individual strokes is a set obtained by arranging several stroke segments in sequence according to spatial adjacency, and the stroke segments in the sequence are sorted progressively according to the direction of stroke writing.
[0131] The preset breakage judgment threshold is used to determine whether adjacent stroke segments within a single stroke are broken; preferably, the threshold is 0.8 to 1.2 times the average width of the stroke, and in this embodiment, the value is 1.0 times the average width of the stroke to ensure the sensitivity and stability of the breakage judgment.
[0132] The preset maximum repairable spacing threshold is used to limit the maximum break spacing that can be recovered through trajectory fitting; preferably, the threshold is 2.5 times the average handwriting width, and in this embodiment, it is 2.4 times the average handwriting width, in order to achieve a balance between repair accuracy and computational cost.
[0133] The trajectory fitting and extension splicing operation involves fitting the stroke direction vectors at both ends of the broken strokes to a curve using the Bézier curve interpolation method, and then performing extension splicing to generate a continuous and smooth stroke trajectory.
[0134] By extracting handwriting segments, breakpoints are accurately identified based on a breakage judgment threshold. For minor breaks, trajectory fitting and extension splicing are performed for self-repair, significantly improving the integrity of the strokes. For severe defects, precise guided texture and pen pressure joint analysis are used to achieve graded processing and high-precision repair of defects.
[0135] Specifically, the process of constructing a sequence of segments to be determined for each of the aforementioned handwriting segments includes:
[0136] Obtain the coordinates of the starting point of each individual stroke within each written character block;
[0137] Sort by starting point x-coordinate from smallest to largest;
[0138] When the difference in the horizontal coordinates of two or more strokes is less than or equal to a preset pixel threshold, they are considered to be in the same column and sorted from top to bottom according to their vertical coordinates within the same column.
[0139] The sorting results constitute a sequence of segments to be determined, in order to simulate the stroke order during writing.
[0140] In this embodiment, the strokes within the writing block are sorted from smallest to largest according to the horizontal coordinate of the starting point to determine the order of strokes in the horizontal direction, so as to simulate the writing order from left to right.
[0141] When the difference in the horizontal coordinates of two or more strokes is less than or equal to a preset pixel threshold, these strokes are considered to belong to the same writing column horizontally.
[0142] The preset pixel threshold is used to determine the column belonging relationship of the stroke in the image coordinates. The preferred value range is 0.8 to 1.2 times the average width of the stroke. In this embodiment, it is 1.0 times the average width of the stroke. This threshold is obtained by statistically analyzing a large number of writing samples, which can take into account the fluctuation of writing offset and stroke spacing.
[0143] Within the same column, strokes are sorted from top to bottom according to their vertical coordinates to reproduce the vertical order of strokes in the same column during writing, ensuring that the stroke sequence conforms to the natural stroke patterns of human writing; the sorting process uses a stable sorting algorithm to ensure that the original order is maintained when the vertical coordinates are the same.
[0144] The sorting results constitute a sequence of segments to be determined, that is, a sequence of individual strokes arranged in order, which is used to simulate the stroke execution order during writing; this segment sequence is directly used as the input data structure for subsequent endpoint spacing calculation and breakage judgment, realizing the structured organization of stroke analysis.
[0145] By simulating the left-to-right writing order using horizontal coordinate priority sorting, and sorting the vertical coordinates within the same column using a preset pixel threshold, the resulting sequence of segments to be determined provides logically correct temporal input, greatly ensuring the accuracy of subsequent stroke continuity analysis.
[0146] Specifically, the process of joint texture and pen pressure difference analysis includes:
[0147] Obtain the grayscale pixel distribution features of each stroke unit in the segment sequence to be determined, and calculate the uniformity of stroke texture;
[0148] Determine the connection relationships between individual strokes and perform merging to generate stroke feature regions;
[0149] Extract the grayscale distribution curve sequence within each stroke feature region and calculate the grayscale change trend to determine the texture uniformity category;
[0150] Obtain the pen pressure sampling point sequence of individual strokes, calculate the width change rate along the main axis, and obtain the relative pen pressure feature category;
[0151] Input the texture uniformity category and the relative pen pressure feature category into the difference coefficient calculation model, calculate the joint difference coefficient of stroke texture and pen pressure, and output the stroke difference feature analysis results corresponding to the stroke difference feature parameters.
[0152] In this embodiment, the joint texture and pen pressure difference analysis operation is a process of jointly judging the physical writing characteristics and ink quality of a stroke when there are severe breaks in the stroke; obtaining the gray-level pixel distribution characteristics of each stroke unit in the sequence of segments to be determined means that the system describes the distribution of ink density based on the gray-level statistics of each stroke segment; calculating the uniformity of the stroke texture is to quantify the consistency level of the stroke ink distribution based on the gray-level distribution characteristics; judging the connection relationship between stroke units and performing merging means merging visually continuous but logically separate strokes into a stroke feature region; extracting the gray-level distribution curve sequence means extracting the gray-level distribution curve sequence from the stroke feature region. Within the domain, grayscale values of pixels are continuously sampled along the main axis or cross-sectional direction of the stroke; calculating the grayscale change trend involves analyzing the smoothness, slope abrupt changes, and other features of these curves to determine the texture uniformity category; obtaining the pen pressure sampling point sequence of individual strokes involves simulating the pen tip pressure change during actual writing based on the width information of each point on the stroke trajectory; calculating the width change rate along the main axis is to quantify the simulated pen pressure feature using the change rate of stroke width with length to obtain the relative pen pressure feature category; the difference coefficient calculation model is a preset mathematical model that takes the texture uniformity category and the relative pen pressure feature category as input to calculate the joint quantization index.
[0153] By jointly analyzing two types of features—the variation rate of grayscale distribution width of strokes—a multi-dimensional quantitative assessment of physical defects in strokes is achieved. This mechanism overcomes the limitations of traditional methods in perceiving complex defects such as ink penetration and insufficient pen pressure on carbon paper.
[0154] Specifically, the process of calculating the uniformity of the stroke texture of the individual strokes includes:
[0155] Determine whether there are intersections between individual strokes;
[0156] When there are intersections, individual strokes that are connected are merged to obtain the corresponding connected strokes as a whole.
[0157] Based on the shape of the line segment connecting the strokes, and according to the preset outward expansion width, a boundary expansion operation is performed along the direction perpendicular to the line segment to generate several stroke analysis areas.
[0158] The analysis area and the unconnected independent stroke unit areas together constitute multiple stroke feature areas, and the areas are numbered according to their spatial position order, wherein the sequential number of the stroke unit is the serial number, and the number of the stroke feature area is the label.
[0159] The minimum value of the individual stroke number within each stroke feature region is used as the label of that stroke feature region;
[0160] When there are gaps in the labels of stroke feature regions, a label rearrangement operation is performed to move the labels of subsequent stroke feature regions forward in sequence to eliminate the gaps.
[0161] Several grayscale analysis areas are set within each stroke feature area. The grayscale distribution curves at each analysis point are obtained, and the trend analysis of the grayscale distribution curves is performed to obtain the category of texture uniformity of the corresponding stroke feature area.
[0162] In this embodiment, determining whether there are intersections between individual strokes is done by calculating the geometric intersection of the stroke centerline or boundary contour to determine the physical connection relationship between strokes; strokes with connection relationships are merged; generating several stroke analysis areas is done by performing a boundary expansion operation on both sides according to the line segment shape of the connecting stroke as a whole, along the direction perpendicular to the line segment, with the expansion width being 0.8 times the average width of the stroke, to obtain the analysis range for collecting grayscale information, while avoiding background noise;
[0163] The sequential numbering of individual strokes is called the serial number, and the numbering of stroke feature regions is called the label;
[0164] The minimum value of the stroke individual number within each stroke feature region is used as the label of that stroke feature region in order to establish the mapping relationship between the stroke feature region and its constituent strokes; the label rearrangement operation is performed to ensure the sequence continuity during subsequent analysis and to eliminate label gaps caused by merging or skipping independent regions.
[0165] By performing boundary expansion operations along the vertical direction, an accurate sampling range free from background interference is obtained; the numbering and rearrangement of stroke feature regions ensure the structured and sequential continuity of the grayscale analysis region, providing reliable data support for the subsequent accurate acquisition of grayscale distribution curves.
[0166] Specifically, the process of analyzing the changing trend of the grayscale distribution curve includes:
[0167] Obtain the sampling point sequence of the grayscale distribution curve in each grayscale analysis area, calculate the grayscale change rate between adjacent sampling points, and generate the corresponding grayscale change gradient sequence.
[0168] When the grayscale gradient changes abruptly between adjacent sampling points and the magnitude of the abrupt change is greater than a preset cliff change threshold, a first texture uniformity category is obtained.
[0169] When the grayscale gradient does not have abrupt changes between adjacent sampling points or has abrupt changes and the magnitude of the abrupt changes is less than or equal to a preset cliff change threshold, a second texture uniformity category is obtained.
[0170] In this embodiment, the sampling point sequence of the gray distribution curve in each gray analysis area is obtained, and then the gray change rate between adjacent sampling points is calculated to generate the corresponding gray change gradient sequence.
[0171] A mutation refers to a change in grayscale that occurs between two adjacent sampling points;
[0172] The abrupt change amplitude is precisely defined as the absolute difference between the gray values of two adjacent sampling points; the preset cliff change threshold is used to determine whether the amplitude constitutes a serious discontinuity or defect in the ink mark, and the threshold value is 50 gray value.
[0173] When the abrupt change amplitude of the grayscale gradient between adjacent sampling points is greater than the preset cliff change threshold, it indicates that the ink has a serious interruption or penetration at the smallest sampling unit, thus obtaining the first texture uniformity category; conversely, when there is no abrupt change in the grayscale gradient between adjacent sampling points, or the abrupt change amplitude is less than or equal to the preset cliff change threshold, it indicates that the ink change is stable or has only slight fluctuations, thus obtaining the second texture uniformity category.
[0174] The mechanism accurately compares the changes with a preset threshold; it enables rapid and accurate detection of non-smooth changes within strokes, effectively distinguishing between smooth ink marks and serious defects caused by poor copying.
[0175] Specifically, the process of calculating the stroke difference feature parameters includes:
[0176] The texture uniformity category and the relative pen pressure feature category are respectively converted into preset texture uniformity quantization value and relative pen pressure quantization value;
[0177] The difference coefficient calculation model calculates the stroke difference feature parameters and the stroke difference feature analysis results corresponding to the stroke difference feature parameters based on the texture uniformity quantization value, the relative pen pressure quantization value, and the preset weighting coefficient.
[0178] In this embodiment, the corresponding parameters of texture characteristics and pen pressure characteristics of each stroke are extracted respectively;
[0179] The texture distribution parameter is calculated by the ratio of the gray-level variance to the average gray-level of the stroke area. This ratio reflects the uniformity of ink penetration in the local area and the distribution of surface texture. The original values of gray-level variance and average gray-level are both between 0 and 255. After normalization, the value range of the texture distribution parameter is between 0 and 1. In this embodiment, to ensure feature discrimination and recognition stability, the texture distribution parameter is preferably between 0.05 and 0.8.
[0180] The pen pressure distribution parameter is determined based on the stability of the stroke trajectory width variation. By collecting the width sequence along the stroke direction and calculating the ratio of its standard deviation to the average width, a measure of the pen pressure fluctuation is obtained. This ratio reflects the stability of the pen pressure during the writing process, and the value is normalized to a range of 0 to 1. In this embodiment, in order to balance the sensitive response and stable recognition effect of the stroke pen pressure variation, the pen pressure distribution parameter is preferably taken in the range of 0.03 to 0.6.
[0181] The fusion model employs a linear weighting method to combine texture distribution parameters and pen pressure distribution parameters to form a difference feature quantity, which is used to characterize the degree of anomaly of individual strokes; its calculation formula is as follows: ;
[0182] in, This is the normalized texture distribution parameter, with a value ranging from 0 to 1;
[0183] The normalized pen pressure distribution parameter, with a value ranging from 0 to 1;
[0184] and The weighting coefficients are such that their sum is 1.
[0185] To ensure high recognition accuracy of the model in texture-dominated handwriting scenarios, the texture weight is preferably set to 0.6 to 0.75, and the pen pressure weight is set to 0.25 to 0.4; in this embodiment, the optimal values for the texture and pen pressure weighting coefficients are 0.7 and 0.3, respectively.
[0186] Finally, the model makes anomaly determination based on the value of the fusion difference parameter D; it compares the stroke difference feature parameter obtained by weighted fusion with the stroke difference determination threshold TD; when the stroke difference feature parameter is greater than the stroke difference determination threshold, the stroke anomaly category determination result of the stroke to which the individual stroke belongs is obtained; when the stroke difference feature parameter is less than or equal to the stroke difference determination threshold, the stroke normal category determination result of the individual stroke belongs is obtained.
[0187] The threshold for stroke difference determination ranges from 0.35 to 0.45. In the training sample set, the probability density of the distribution of difference feature parameters between normal and abnormal strokes is fitted, and the intersection of the two distributions is selected as the classification boundary point. Preferably, in this embodiment, the threshold is 0.4, which can stably distinguish between abnormal stroke categories and normal stroke categories while ensuring a balance between the accuracy and false positive rate of abnormal stroke recognition.
[0188] By employing a defect severity mapping method to convert texture and pen pressure categories into quantized values, and applying a weighted linear combination formula to calculate joint differential feature parameters, this weighted method achieves a unified and accurate assessment of the impact of multi-dimensional defects.
[0189] See Figure 3 As shown, it is a logic decision diagram of cross-chain verification operation in an embodiment of the present invention;
[0190] Specifically, the process of cross-chain verification includes:
[0191] When the analysis results of the second stroke difference feature are obtained, the panoramic document images and partial document images of the other joint document layers are called;
[0192] Perform stroke feature analysis based on the target region image to obtain the corresponding stroke difference feature analysis results;
[0193] The stroke difference feature analysis results of each single layer are compared across layers to calculate the stroke difference matching degree.
[0194] When the stroke difference matching degree is greater than the preset cross-connection consistency threshold, the image recognition result of the current target area is confirmed to be valid.
[0195] When the stroke difference matching degree is less than or equal to the consistency threshold, the target region image is marked as a cross-series anomalous sample and submitted to the model self-learning training pool for relearning and updating.
[0196] In this embodiment, the cross-part verification operation is used to verify the consistency of the recognition results among multiple documents, so as to improve the recognition reliability in complex writing scenarios.
[0197] When the analysis result of the difference feature of the second stroke is detected, the system automatically calls up the panoramic and local document images of other forms corresponding to the target area to ensure that the comparison range and pixel area between different forms are completely corresponding.
[0198] After performing the stroke feature analysis operation, the stroke difference feature analysis results of each single layer are obtained, and the results are compared across layers.
[0199] Obtain the stroke difference matching degree value; the matching degree is expressed in the form of normalized correlation coefficient, and the value range is 0 to 1, where 1 represents complete consistency and 0 represents complete inconsistency; the cross-level consistency threshold is used to judge the cross-level stability of the recognition result, and its value is determined according to the stability statistics of the model during the training phase; preferably, the cross-level consistency threshold is 0.75 to 0.85, and the optimal value is 0.8.
[0200] By comparing data from other forms, and verifying consistency using stroke difference matching, inconsistent abnormal samples are directly submitted to the model training pool, thus enabling the continuous evolution of the system's recognition capabilities and robustness.
[0201] See Figure 4As shown, this is a schematic diagram of the structure of the OCR image recognition method system based on large model self-learning according to an embodiment of the present invention. The present invention also provides a system applied to the above-mentioned OCR image recognition method based on large model self-learning, comprising:
[0202] The image acquisition module is used to acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch at an initial sampling resolution.
[0203] The image quality determination module, connected to the image acquisition module, is used to extract the target area image within any written text area of a single-part document based on the panoramic document image and the partial document image, and to determine the image quality category of the target area image.
[0204] The re-acquisition module, connected to the image acquisition module and the image quality determination module, is used to send the corresponding multi-part document to be verified to the next verification batch and perform the image re-acquisition step to re-acquire the corresponding panoramic document image and partial document image when the image of the target area belongs to the image defect category.
[0205] The stroke feature analysis module is connected to the image quality determination module and is used to perform stroke feature analysis operation to obtain stroke difference feature analysis results when the target area image belongs to the image quality category to be determined.
[0206] The cross-link verification module, connected to the stroke feature analysis module, is used to call the panoramic and partial document images of the other document layers and perform cross-link verification operations when the second stroke difference feature analysis result is obtained.
[0207] The OCR image recognition system based on large model self-learning provided in this embodiment of the invention can be applied to the OCR image recognition method based on large model self-learning and can achieve the same technical effect, which will not be elaborated here.
[0208] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0209] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An OCR image recognition method based on large model self-learning, characterized in that, include: At the initial sampling resolution, acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch; Based on the panoramic document image and the partial document image, extract the target area image within the written text area of any single document layer, and determine the image quality category of the target area image; When the image is classified as an image defect, the corresponding multi-part document to be verified is sent to the next verification batch and an image re-acquisition step is performed to re-acquire the corresponding panoramic document image and local document image. When the number of images in the target area is greater than the preset trigger number, the initial sampling resolution is adjusted. When the image belongs to the category of image quality to be determined, the target area image is acquired, and stroke feature analysis is performed to obtain stroke difference feature analysis results. When the results of the second stroke difference feature analysis are obtained, the panoramic document images and partial document images of other document layers are called, and cross-segment verification operations are performed. The process of performing stroke feature analysis includes: Obtain the stroke boundary contours of each written character block in the target area image, and extract several stroke segments of each written character block based on the stroke boundary contours. Based on the spatial adjacency relationship of the handwriting segments, obtain the starting coordinates and ending coordinates of each handwriting segment, and construct a sequence of undetermined segments corresponding to each handwriting segment. After calculating the endpoint spacing, the endpoint spacing value between the endpoints of adjacent stroke segments within each stroke unit is obtained. Based on the endpoint spacing value and a preset breakage judgment threshold, it is determined whether each stroke unit has a breakage. If the endpoint spacing value is greater than the preset breakage judgment threshold, it is determined to be broken. For a single stroke determined to be broken, the endpoint spacing value is compared with the preset maximum repairable spacing threshold. If the endpoint spacing value is less than the preset maximum repairable spacing threshold, it is determined to be a repairable break. After trajectory fitting and extension splicing operations, the spliced stroke trajectory is generated and the font restoration image is obtained. If the endpoint spacing value is greater than or equal to the preset maximum repairable spacing threshold, it is determined to be an unrepairable severe break, and the subsequent texture and pen pressure joint difference analysis operation is performed to obtain the stroke difference feature parameters, and the stroke anomaly category to which the stroke belongs is determined based on the difference feature parameters. The process of cross-validation includes: Perform stroke feature analysis based on the target region image to obtain the corresponding stroke difference feature analysis results; The stroke difference feature analysis results of each single layer are compared across layers to calculate the stroke difference matching degree. When the stroke difference matching degree is greater than the preset cross-connection consistency threshold, the image recognition result of the current target area is confirmed to be valid. When the stroke difference matching degree is less than or equal to the consistency threshold, the target region image is marked as a cross-series abnormal sample and submitted to the model self-learning training pool for relearning and updating.
2. The OCR image recognition method based on large model self-learning according to claim 1, characterized in that, The process of determining the image quality category of the target region image includes: The number of executions of the multi-part document corresponding to the target area image is obtained. When the number of executions is less than or equal to a preset execution threshold, the number of valid information pixels and the total number of pixels of the target area image are obtained. The overall pixel density ratio of the target area image is calculated based on the number of valid information pixels and the total number of pixels. The pixel density ratio is compared with a preset image clarity threshold. When the pixel density ratio is greater than the image clarity threshold, the effective information pixel count and total pixel count corresponding to the writing field area of several types of information fields in the target area image are obtained to calculate the regional pixel density ratio of each writing field area. When the pixel density ratio is less than or equal to the image sharpness threshold, it is the first image defect category in the image defect category; When the pixel density ratio of any of the aforementioned regions is less than or equal to a preset effective pixel threshold for the field, it is classified as the second image defect category in the image defect category. When the pixel density ratio of all the regions is greater than the preset effective pixel threshold of the field, it belongs to the image quality category to be determined; When the defect falls under the category of image defects, the multi-part document information corresponding to the writing field area is transmitted to the next verification batch, and the corresponding image re-acquisition step of acquiring the panoramic document image and the partial document image is executed. The number of target area images is obtained when the number of times the image re-acquisition step is executed on the multi-part document corresponding to the target area image is greater than a preset execution number threshold. When the number of target area images is greater than a preset trigger number, a first adjustment operation is performed on the initial sampling resolution.
3. The OCR image recognition method based on large model self-learning according to claim 2, characterized in that, The process of performing the first adjustment operation on the initial sampling resolution includes: Obtain the overall pixel density ratio and the regional pixel density ratio from the historical image acquisition data corresponding to the target region image, and calculate the average of the overall pixel density ratio and the regional pixel density ratio; Based on the mean and the number of times the target region image is executed, the sampling resolution adjustment step size is calculated using the sampling resolution adjustment step size calculation formula, and the initial sampling resolution is adjusted to the updated sampling resolution.
4. The OCR image recognition method based on large model self-learning according to claim 3, characterized in that, The process of constructing a sequence of segments to be determined for each of the aforementioned handwriting segments, corresponding to individual strokes, includes: Obtain the coordinates of the starting point of each individual stroke within each written character block; Sort by starting point x-coordinate from smallest to largest; When the difference in the horizontal coordinates of two or more strokes is less than or equal to a preset pixel threshold, they are considered to be in the same column and sorted from top to bottom according to their vertical coordinates within the same column. The sorting results form a sequence of fragments to be determined, simulating the stroke order during writing.
5. The OCR image recognition method based on large model self-learning according to claim 1, characterized in that, The process of joint texture and pen pressure difference analysis includes: Obtain the grayscale pixel distribution features of each stroke unit in the segment sequence to be determined, and calculate the uniformity of stroke texture; Determine the connection relationships between individual strokes and perform merging to generate stroke feature regions; Extract the grayscale distribution curve sequence within each stroke feature region and calculate the grayscale change trend to determine the texture uniformity category; Obtain the pen pressure sampling point sequence of individual strokes, calculate the width change rate along the main axis, and obtain the relative pen pressure feature category; Input the texture uniformity category and the relative pen pressure feature category into the difference coefficient calculation model, calculate the joint difference coefficient of stroke texture and pen pressure, and output the stroke difference feature analysis results corresponding to the stroke difference feature parameters.
6. The OCR image recognition method based on large model self-learning according to claim 5, characterized in that, The process of calculating the uniformity of the stroke texture of the individual strokes includes: Determine whether there are intersections between individual strokes; When there are intersections, individual strokes that are connected are merged to obtain the corresponding connected strokes as a whole. Based on the shape of the line segment connecting the strokes, and according to the preset outward expansion width, a boundary expansion operation is performed along the direction perpendicular to the line segment to generate several stroke analysis areas. The analysis area and the unconnected independent stroke unit area together constitute multiple stroke feature areas, and the areas are numbered according to their spatial position order, wherein the sequential number of the stroke unit is the serial number, and the number of the stroke feature area is the label. The minimum value of the individual stroke number within each stroke feature region is used as the label of that stroke feature region; When there are gaps in the labels of stroke feature regions, a label rearrangement operation is performed to move the labels of subsequent stroke feature regions forward in sequence to eliminate the gaps. Several grayscale analysis areas are set within each stroke feature area. The grayscale distribution curves at each analysis point are obtained, and the trend analysis of the grayscale distribution curves is performed to obtain the category of texture uniformity of the corresponding stroke feature area.
7. The OCR image recognition method based on large model self-learning according to claim 5, characterized in that, The process of analyzing the trend of the grayscale distribution curve includes: Obtain the sampling point sequence of the grayscale distribution curve in each grayscale analysis area, calculate the grayscale change rate between adjacent sampling points, and generate the corresponding grayscale change gradient sequence. When the grayscale gradient changes abruptly between adjacent sampling points and the magnitude of the abrupt change is greater than a preset cliff change threshold, a first texture uniformity category is obtained. When the grayscale gradient does not have abrupt changes between adjacent sampling points or has abrupt changes and the magnitude of the abrupt changes is less than or equal to a preset cliff change threshold, a second texture uniformity category is obtained.
8. The OCR image recognition method based on large model self-learning according to claim 5, characterized in that, The process of calculating the stroke difference feature parameters includes: The texture uniformity category and the relative pen pressure feature category are respectively converted into preset texture uniformity quantization value and relative pen pressure quantization value; The difference coefficient calculation model calculates the stroke difference feature parameters and the stroke difference feature analysis results corresponding to the stroke difference feature parameters based on the texture uniformity quantization value, the relative pen pressure quantization value, and the preset weighting coefficient.
9. A system for applying the OCR image recognition method based on large model self-learning as described in any one of claims 1-8, characterized in that, include: The image acquisition module is used to acquire panoramic and partial images of the writing surfaces of each multi-part document to be verified within the current verification batch at an initial sampling resolution. The image quality determination module, connected to the image acquisition module, is used to extract the target area image within any written text area of a single-part document based on the panoramic document image and the partial document image, and to determine the image quality category of the target area image. The re-acquisition module, connected to the image acquisition module and the image quality determination module, is used to send the corresponding multi-part document to be verified to the next verification batch and perform the image re-acquisition step to re-acquire the corresponding panoramic document image and partial document image when the image of the target area belongs to the image defect category. The stroke feature analysis module is connected to the image quality determination module and is used to perform stroke feature analysis operation to obtain stroke difference feature analysis results when the target area image belongs to the image quality category to be determined. The cross-link verification module, connected to the stroke feature analysis module, is used to call the panoramic and partial document images of the other document layers and perform cross-link verification operations when the second stroke difference feature analysis result is obtained.