A picture character recognition method and system based on layout optimization voting

CN119068499BActive Publication Date: 2026-08-18CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411193571.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2026-08-18
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

[0002]目前常用的开源光学字符识别系统识别的准确率面对通用文本文档时,已能达到很高的水平,但是面对特定文本文档的文字识别任务时,识别准确率往往无法达到预期

Benefits of technology

[0046] This invention combines the square representation characteristics of dot matrix Chinese characters, estimates the character size based on the line height, and uses the character size to simulate the character spacing and line spacing to adjust the text layout. Finally, it votes on the recognition results of various text layouts to obtain the final result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068499B_ABST
    Figure CN119068499B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of picture character recognition, and particularly discloses a picture character recognition method and system based on layout optimization voting, which comprises the following steps: step 100, inputting a text image file; step 200, inputting image preprocessing; step 300, adjusting the layout of image characters; step 400, recognizing the image characters in multiple layout lines and voting the recognition results of multiple layouts; step 500, outputting a result list, and ending. The application combines the representation characteristics of dot-matrix Chinese square characters, estimates the size of characters according to line height, adjusts the layout of characters by simulating the character spacing and line spacing according to the size of characters, and finally votes the recognition results of multiple character layouts to obtain the final result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image text recognition technology, specifically to an image text recognition method based on layout optimization voting, and also to an image text recognition system based on layout optimization voting. Background Technology

[0002] Currently, commonly used open-source optical character recognition systems can achieve a high level of accuracy when dealing with general text documents. However, when faced with text recognition tasks involving specific text documents, the accuracy often falls short of expectations.

[0003] Traditional image pattern matching algorithms suffer from poor recognition accuracy and often fail to accurately segment characters in densely packed text images, leading to inaccurate text recognition. Meanwhile, the commonly used DB-CRNN two-step text recognition system often fails to accurately locate all text positions in multi-line or irregularly distributed text images, resulting in a large number of missed recognitions.

[0004] Currently, the optimization of text recognition systems from a preprocessing perspective usually focuses on improving image quality and enhancing the text information in the image. However, in actual recognition tasks, even after image enhancement and noise reduction, the recognition effect is still not ideal, and the impact of text layout in the image on the recognition effect is rarely considered. Summary of the Invention

[0005] In view of this, the present invention provides an image text recognition method and system based on layout optimization voting, which optimizes the recognition of optical characters by adjusting the layout of the text in the image from the perspective of improving the preprocessing of the input image.

[0006] To achieve the above objectives, the basic solution of this invention provides an image text recognition method based on layout optimization voting, comprising the following steps:

[0007] Step 100: Input a text image file;

[0008] Step 200: Input image preprocessing;

[0009] Step 300: Adjust the image and text layout;

[0010] Step 400: Multi-layout line image text recognition and voting on multi-layout recognition results;

[0011] Step 500: Output the result list Result, then end.

[0012] In one possible design, step 200 specifically includes,

[0013] Step 201: Read the image file and obtain the suffix file extension;

[0014] Step 202: Determine if suffix = ".tif". If suffix = ".tif", then do not process it; otherwise, modify the file format to make suffix = ".tif".

[0015] Step 203: Use OpenCV to read the TIFF format image file and obtain the image.

[0016] Step 204: Use OpenCV to convert Image to grayscale to obtain a grayscale image Image_gray. Then, perform local mean adaptive binarization on Image_gray to obtain a binary image Image_bianry.

[0017] Step 205: Using OpenCV, set a 2*2 convolution kernel to perform erosion, dilation, and erosion operations on Image_bianry to obtain the result Image_ede, and set Image = Image_ede; the input image preprocessing is complete, proceed to step 300.

[0018] In one possible design, step 300 includes,

[0019] Step 301: Read the preprocessed image Image, and read the Image dimensions as height h and width w.

[0020] Step 302: Horizontally project the Image and record the sum of pixel values ​​in each row of the Image pixel matrix to obtain the horizontal projection vector Hor_proj;

[0021] Step 303: Read the horizontal projection vector Hor_proj, and record the positions si and ei that change from 0 to 0 from top to bottom, to obtain the top and bottom positions rowi = [si, ei], i = 1, 2, 3, ..., n, and all row positions row_all = [row1, row2, row3, ..., rown].

[0022] Step 304: Iterate through row_all, initialize the list row_width, calculate the absolute value of the difference between two elements in rowi, add it to the list row_width, and take the arithmetic mean width_mean of all elements in row_width;

[0023] Step 305: Iterate through row_all and segment the image Image to obtain...

[0024] Image_rowi = Image[rowi[0]:rowi[1],0:w], which gives the set of focused row images.

[0025] Image_row_set=[Image_row1,Image_row2,…,Image_rown];

[0026] Step 306: Traverse Image_row_set, perform vertical projection on Image_rowi, and record the sum of pixel values ​​in each column of the image pixel matrix to obtain the vertical projection vector Ver_proji;

[0027] Step 307: Read the vertical projection vector Ver_proji corresponding to the row image Image_rowi in sequence. From left to right, record the positions si where the value changes from 0 and ei where the value changes to 0, to obtain the left and right column positions coli = [si, ei], and all column positions col_alli = [col1, col2, col3, ..., coln].

[0028] Step 308: Read the column position list col_alli corresponding to the row image Image_rowi in sequence, perform clustering based on distance threshold on the elements in the list col_alli, traverse col_alli, if |colj[0]-colj-1[1]|≤t, then do not process, otherwise merge colj and colj-1 to obtain [colj-1[0],colj[1]], j=1,2,3,…,n; process to obtain the corresponding merged column position list col_merge_alli=[col_merge1,col_merge2,…,col_mergem];

[0029] Step 309: Traverse all row images Image_rowi, read the list of merged column positions corresponding to the Image_rowi dimensions rowi_h and rowi_w, and segment Image_rowi according to the column positions recorded in col_merge_alli.

[0030] rowi_colj = Image_rowi[0:rowi_h,col_mergej[0]:col_mergej[1]], thus obtaining the corresponding column image set Image_rowi_col_set = {rowi_col1, rowi_col2, ..., rowi_colm};

[0031] Step 310: Initialize the sub-image width list sub_col_width, traverse the image set Image_rowi_col_set corresponding to all row images Image_rowi, read the sub-image size width rowi_colj_w, and add sub_col_width and the number of sub-images rowi_col_cnt;

[0032] Step 311: Sum all elements within the corresponding sub_col_width of Image_rowi to obtain w_sumi. Initialize the size of the blank canvas Image_rowi_adjust to rowi_h*(w_sumi+int(1 / 3)*w_mean*(rowi_col_cnt-1)), i = 1, 2, ..., m. Integrate the sub-images within the corresponding column image set Image_rowi_col_set into Image_rowi_adjust in order, with a sub-image spacing of int(1 / 3)*w_mean. Process all row images to obtain the adjusted row image set Image_row_adjust_set = ...

[0033] {Image_row1_adjust,….Image_rowm_adjust} collection;

[0034] Step 312: Iterate through the adjusted row image set Image_row_adjust_set. For a single row image Image_rowi_adjust, use OpenCV to adjust the background size, which is rowi_h * rowi_w. Then, fill the blanks on the four sides of the row image with the corresponding row height rowi_h as the step size. The filling size for n steps is (rowi_h + 2 * n * rowi_h) * (rowi_w + 2 * rowi_w). Each row image is filled with 5 units of step size, resulting in a set of adjusted images.

[0035] rowi_adjust_bk_set = {rowi_h, rowi_2h, rowi_3h, rowi_4h, rowi_5h}; Perform the same processing on all rows of all images; The image and text layout adjustment is complete, proceed to step 400.

[0036] In one possible design, step 400 includes,

[0037] Step 401: Initialize the text line multi-layout recognition result list rowi_result, and the line image multi-layout image set rowi_adjust_bk_set = {rowi_h,rowi_2h,rowi_3h,rowi_4h,rowi_5h};

[0038] Step 402: Iterate through the multi-layout image set rowi_adjust_bk_set, input all images in the set into the text recognition engine for recognition, obtain the recognition results, and add them to the recognition result list rowi_result.

[0039] The final recognition result list rowi_result = [rowi_result_h, rowi_result_2h, rowi_result_3h, rowi_result_4h, rowi_result_5h];

[0040] Step 403: A vote is performed on the results within `rowi_result`. Results with empty recognition results are not included in the vote. The recognition result with the highest frequency is taken as the final recognition result for row `rowi`. Recognition and result voting are performed on all row images, and the results are added to the result list `Result` in sequence. In one possible design, the text image file in step 100 may include jpg, png, or tif.

[0041] In one possible design, in step S308, the distance threshold is t = 1 * width_mean, where width_mean is the average line height of the text in the image.

[0042] The present invention also provides an image text recognition device based on layout optimization voting, including a memory, a control processor, and a computer program stored in the memory and executable on the control processor. The control processor executes the program to implement the image text recognition method based on layout optimization voting as described above.

[0043] The present invention also provides a control system, including the image text recognition device based on layout optimization voting as described above.

[0044] The present invention also provides a computer-readable storage medium storing computer-executable instructions for implementing the image text recognition method based on layout optimization voting as described above.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0046] This invention combines the square representation characteristics of dot matrix Chinese characters, estimates the character size based on the line height, and uses the character size to simulate the character spacing and line spacing to adjust the text layout. Finally, it votes on the recognition results of various text layouts to obtain the final result.

[0047] This invention addresses the issue that, aside from the recognition system itself, the input image also affects the accuracy of the optical character recognition system's results. Regularly arranged and clear images are beneficial for the system's accurate character recognition. This invention enhances text information by performing grayscale and binarization, erosion and dilation on the input image. It then uses Hybrid Segments to segment the image into text lines and adjusts the character and line spacing by approximating the character width with the line height, resulting in a standardized text arrangement. Furthermore, by adjusting the background size of the text line images, the layout of the text in the image is further refined, generating a set of text images with different layouts. These images are then input into the recognition system, and the results are voted on. The highest-scoring result is used as the final recognition result, significantly improving the recognition accuracy. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 The diagram illustrates a logical block diagram of an image text recognition method and system based on layout optimization voting, as proposed in an embodiment of this application. Detailed Implementation

[0050] To further illustrate the various embodiments, the present invention provides accompanying drawings, which are part of the disclosure of the present invention. These drawings are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementation methods and the advantages of the present invention. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.

[0051] Disadvantages of existing technology:

[0052] (1) Traditional image pattern matching algorithms have poor recognition accuracy and often fail to accurately segment characters in dense text images, resulting in inaccurate text recognition. The commonly used DB-CRNN two-step text recognition system often fails to accurately locate all text positions in multi-line and irregularly distributed text images, resulting in a large number of missed recognitions.

[0053] (2) At present, the optimization of text recognition systems from the perspective of preprocessing usually focuses on improving image quality and enhancing text information in the image. However, in actual recognition tasks, the recognition effect is still not ideal after image enhancement and noise reduction. At present, little attention is paid to the impact of text layout in the image on the recognition effect.

[0054] Therefore, after performing image enhancement processing such as tilt correction, grayscale and binarization, and filtering on the input image, this invention uses Hybrid Segment to focus the text line sequence image, and adjusts the text layout model in the image by simulating character spacing and line spacing through character size, before inputting it into the text recognition system to improve the recognition accuracy and completeness.

[0055] like Figure 1 As shown, the present invention provides an image text recognition method based on layout optimization voting, comprising the following steps:

[0056] Step 100, Input a text image file; specifically including,

[0057] Step 101: Input a text image file (including image formats such as .jpg / .png / .tif).

[0058] Step 102, Output Description: The output is the text recognition results in the text image, stored in rows, in the Result list.

[0059] Step 200, Input image preprocessing; specifically including,

[0060] Step 201: Read the image file and obtain the suffix file extension;

[0061] Step 202: Determine if suffix = ".tif". If suffix = ".tif", no processing is performed; otherwise, modify the file format to make suffix = ".tif". Proceed to step 203.

[0062] Step 203: Use OpenCV to read the TIFF format image file and obtain the image; proceed to step 204.

[0063] Step 204: Use OpenCV to convert Image to grayscale to obtain a grayscale image Image_gray. Perform local mean adaptive binarization on Image_gray to obtain a binary image Image_bianry. Proceed to step 205.

[0064] Step 205: Using OpenCV, set a 2*2 convolution kernel to perform erosion, dilation, and erosion operations on Image_bianry to obtain the result Image_ede, and set Image = Image_ede; the input image preprocessing is complete, proceed to step 300.

[0065] Step 300, Image Text Layout Adjustment; The purpose of image text layout adjustment is to adjust the character spacing and line spacing of the text in the image, facilitating the text recognition system to extract text features for accurate recognition. Its main steps include image text line focusing based on Hybrid Segment, and text layout adjustment, specifically as follows:

[0066] Step 301: Read the preprocessed image Image, and read the dimensions of Image as height h and width w, then proceed to step 302;

[0067] Step 302: Horizontally project the Image and record the sum of pixel values ​​in each row of the Image pixel matrix to obtain the horizontal projection vector Hor_proj, then proceed to step 303.

[0068] Step 303: Read the horizontal projection vector Hor_proj, and record the positions si and ei that change from 0 to 0 from top to bottom, to obtain the top and bottom row positions rowi = [si, ei], i = 1, 2, 3, ..., n, and all row positions row_all = [row1, row2, row3, ..., rown] (i = 1, 2, 3, ..., n); Proceed to step 304;

[0069] Step 304: Iterate through row_all, initialize the list row_width, calculate the absolute value of the difference between two elements in rowi, add it to the list row_width, and take the arithmetic mean width_mean of all elements in row_width; proceed to step 305.

[0070] Step 305: Iterate through row_all and segment the image Image to obtain...

[0071] Image_rowi = Image[rowi[0]:rowi[1],0:w], which gives the set of focused row images.

[0072] Image_row_set = [Image_row1, Image_row2, ..., Image_rown]; Proceed to step 306;

[0073] Step 306: Traverse Image_row_set, perform vertical projection on Image_rowi, and record the sum of pixel values ​​in each column of the image pixel matrix to obtain the vertical projection vector Ver_proji; proceed to step 307.

[0074] Step 307: Read the vertical projection vector Ver_proji corresponding to the row image Image_rowi sequentially. From left to right, record the positions si where the value changes from 0 and ei where the value changes to 0, to obtain the left and right column positions coli = [si, ei] and all column positions col_alli = [col1, col2, col3, ..., coln]; proceed to step 308;

[0075] Step 308: Read the column position list col_alli corresponding to the row image Image_rowi in sequence, perform clustering based on distance threshold on the elements in the list col_alli, traverse col_alli, if |colj[0]-colj-1[1]|≤t, then do not process, otherwise merge colj and colj-1 to obtain [colj-1[0],colj[1]], j=1,2,3,…,n; process to obtain the corresponding merged column position list col_merge_alli=[col_merge1,col_merge2,…,col_mergem]; proceed to step 309;

[0076] Step 309: Traverse all row images Image_rowi, read the list of merged column positions corresponding to the Image_rowi dimensions rowi_h and rowi_w, and segment Image_rowi according to the column positions recorded in col_merge_alli.

[0077] rowi_colj = Image_rowi[0:rowi_h,col_mergej[0]:col_mergej[1]], j = 1, 2, ..., m, to obtain the corresponding column image set Image_rowi_col_set = {rowi_col1, rowi_col2, ..., rowi_colm}; proceed to step 310;

[0078] Step 310: Initialize the sub-image width list sub_col_width, traverse the image set Image_rowi_col_set corresponding to all row images Image_rowi, read the sub-image size width rowi_colj_w, add sub_col_width and the number of sub-images rowi_col_cnt; proceed to step 311;

[0079] Step 311: Sum all elements within the corresponding sub_col_width of Image_rowi to obtain w_sumi. Initialize the size of the blank canvas Image_rowi_adjust to rowi_h*(w_sumi+int(1 / 3)*w_mean*(rowi_col_cnt-1)), i = 1, 2, ..., m. Integrate the sub-images within the corresponding column image set Image_rowi_col_set into Image_rowi_adjust in order, with a sub-image spacing of int(1 / 3)*w_mean. Process all row images to obtain the adjusted row image set Image_row_adjust_set = ...

[0080] The set {Image_row1_adjust,,Image_rowm_adjust} is used; proceed to step 312.

[0081] Step 312: Iterate through the adjusted row image set Image_row_adjust_set. For a single row image Image_rowi_adjust, use OpenCV to adjust the background size, which is rowi_h*rowi_w. Then, fill the blanks on the four sides of the row image with the corresponding row height rowi_h as the step size. The filling size for n steps is (rowi_h+2*n*rowi_h)*(rowi_w+2*rowi_w). Each row image is filled with 5 units of step size, resulting in an adjusted image set rowi_adjust_bk_set={rowi_h,rowi_2h,rowi_3h,rowi_4h,rowi_5h}. Perform the same processing on all rows of all images. The image and text layout adjustment is complete. Proceed to step 400.

[0082] Step 400: Multi-layout line image text recognition and multi-layout recognition result voting; including,

[0083] Step 401: Initialize the text line multi-layout recognition result list rowi_result, and the line image multi-layout image set rowi_adjust_bk_set = {rowi_h,rowi_2h,rowi_3h,rowi_4h,rowi_5h}; Proceed to step 402;

[0084] Step 402: Iterate through the multi-layout image set rowi_adjust_bk_set, input all images in the set into the text recognition engine for recognition, obtain the recognition results, and add them to the recognition result list rowi_result.

[0085] The final recognition result list rowi_result = [rowi_result_h, rowi_result_2h, rowi_result_3h, rowi_result_4h, rowi_result_5h]; proceed to step 403;

[0086] Step 403: Vote on the results in rowi_result. Results with empty recognition results are not included in the vote. Take the recognition result with the highest frequency as the final recognition result of rowi. Recognize and vote on the results of all row images and add them to the result list Result in turn. Proceed to step 500.

[0087] Step 500, Result list, End. Text image layout can be understood as the position and pattern of the text line sequence distribution in an image, which can be summarized as line spacing and character spacing. For general multilingual character recognition systems, images that have undergone image cleaning and have appropriate and regular line and character spacing are more conducive to the accurate positioning of text regions. However, it is difficult to accurately determine the appropriate dimensions for character and line spacing. To address the above problems, this invention combines the representation characteristics of dot-matrix Chinese characters as squares, estimates character size based on line height, and uses character size to simulate character and line spacing to adjust the text layout. Finally, multiple text layout recognition results are voted on to obtain the final result.

[0088] The present invention also provides an image text recognition device based on layout optimization voting, including a memory, a control processor, and a computer program stored in the memory and executable on the control processor. The control processor executes the program to implement the image text recognition method based on layout optimization voting as described above.

[0089] The present invention also provides a control system, including the image text recognition device based on layout optimization voting as described above.

[0090] The present invention also provides a computer-readable storage medium storing computer-executable instructions for implementing the image text recognition method based on layout optimization voting as described above.

[0091] Although the methods described above are illustrated and depicted as a series of actions for the sake of simplicity, it should be understood and appreciated that these methods are not limited by the order of the actions, as some actions may occur in a different order and / or concurrently with other actions from the illustrations and descriptions herein or not illustrated and described herein but which may be understood by those skilled in the art, according to one or more embodiments. Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or a combination of both. To clearly illustrate this interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps are described above in a generalized form in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. Those skilled in the art may implement the described functionality in different ways for each particular application, but such implementation decisions should not be construed as departing from the scope of the invention. The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or performed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. The general-purpose processor may be a microprocessor, but in alternatives, it may be any conventional processor, battery compartment control board, micro battery compartment control board, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors cooperating with a DSP core, or any other such configuration. The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of both. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information to / from the storage medium. In an alternative, the storage medium may be integrated into the processor. The processor and storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and storage medium may reside as discrete components in the user terminal. In one or more exemplary embodiments, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functionality may be stored or transmitted therefrom as one or more instructions or code on a computer-readable medium.Computer-readable media includes both computer storage media and communication media, encompassing any medium that facilitates the transfer of a computer program from one location to another. Storage media can be any available medium accessible to a computer. By way of example and not limitation, such computer-readable media may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and is accessible to a computer. Any connection is also legitimately referred to as computer-readable media. For example, if software is transmitted from a website, a central control computer, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then that coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of media. As used in this article, disk and disc include compact discs (CDs), laser discs, optical discs, digital multi-purpose discs (DVDs), floppy disks, and Blu-ray discs. Disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Combinations of these should also be included within the scope of computer-readable media.

[0092] Although the methods described above are illustrated and depicted as a series of actions for the sake of simplicity, it should be understood and appreciated that these methods are not limited by the order of the actions, as some actions may occur in a different order and / or concurrently with other actions from the illustrations and descriptions herein or not illustrated and described herein but which may be understood by those skilled in the art, according to one or more embodiments.

[0093] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for image text recognition based on layout optimization voting, characterized in that, Includes the following steps: Step 100: Input a text image file; Step 200, Image preprocessing; Step 300, image text layout adjustment; including row segmentation, reading the image dimensions height h and width w, obtaining the vector Hor_proj through horizontal projection, scanning the vector from top to bottom, recording the positions where pixel values ​​change from 0 to non-zero and from non-zero to 0, thus obtaining the top and bottom positions of each text line and a list of all line positions, calculating the arithmetic mean w_mean of all line heights, and segmenting the original image into multiple row images based on the row position list, storing them in the set Image_row_set; also including column segmentation and merging, performing vertical projection on each row image to obtain the vector Ver_proj of the sum of pixel values ​​in each column, scanning the vector from left to right, recording... The positions where the value changes from 0 to non-zero and from non-zero to 0 are used to obtain the initial position list of all text columns in each row. Clustering and merging based on a distance threshold t is performed on the initial position list: the gaps between adjacent columns are checked sequentially; if the gap is ≤ t, it is considered the same text region and not processed; otherwise, the end point of the current column is merged with the start point of the previous column to form a new continuous region. This process is repeated until no merging occurs, resulting in the final column position list. Based on the merged column positions, each row image is divided into multiple sub-images, and the width and number of each sub-image are recorded. The widths of all sub-images are summed to obtain w_sumi. A blank canvas is created with a width of w_sumi + int((1 / 3)). *w_mean) *(number of sub-images-1), keep the original row height, put all sub-images into the canvas in order to form the adjusted row images, adjust the background size of each adjusted row image, and fill the four sides of the image with blank space with the original row height as the step. Each row image is filled with 1, 2, 3, 4, and 5 times the step, respectively, and finally obtain a set of images with different background sizes. After performing the same operation on all row images, the adjustment of the entire text layout is completed, and proceed to the next step 400; Step 400: Multi-layout line image text recognition and multi-layout recognition result voting; Five images with different background sizes generated for each line image are sent to the OCR recognition engine for recognition to obtain five results. These five results are statistically analyzed, empty results are ignored, and the text with the highest frequency is selected as the final recognition result for that line. Step 500: Output the result list Result, then end.

2. The image text recognition method based on layout optimization voting according to claim 1, characterized in that, Step 200 specifically includes, Step 201: Read the image file and obtain the suffix file extension; Step 202: Determine if suffix is ​​".tif". If suffix is ​​".tif", do not process it. Otherwise, modify the file format to make suffix ".tif". Step 203: Use OpenCV to read the TIFF format image file and obtain the image. Step 204: Use OpenCV to convert Image to grayscale to obtain a grayscale image Image_gray. Then, perform local mean adaptive binarization on Image_gray to obtain a binary image Image_bianry. Step 205: Using OpenCV, set a 2*2 convolution kernel to perform erosion, dilation and erosion operations on Image_bianry to obtain the result Image_ede, and set Image=Image_ede; the input image preprocessing is complete, proceed to step 300.

3. The image text recognition method based on layout optimization voting according to claim 2, characterized in that, Step 300 includes, Step 301: Read the preprocessed image Image, and read the Image dimensions as height h and width w; Step 302: Horizontally project the Image and record the sum of pixel values ​​in each row of the Image pixel matrix to obtain the horizontal projection vector Hor_proj; Step 303: Read the horizontal projection vector Hor_proj, and record the positions si and ei that change from 0 to 0 from top to bottom, to obtain the top and bottom positions rowi=[si, ei], i=1, 2, 3, ..., n, and all row positions row_all=[row1,row2,row3,...,rown]; Step 304: Iterate through row_all, initialize the list row_width, calculate the absolute value of the difference between two elements in rowi, add it to the list row_width, and take the arithmetic mean w_mean of all elements in row_width; Step 305: Iterate through row_all and segment the image Image to obtain Image_rowi=Image[rowi[0]:rowi[1],0:w], and obtain the set of focused row images Image_row_set=[Image_row1,Image_row2,…,Image_rown]; Step 306: Traverse Image_row_set, perform vertical projection on Image_rowi, and record the sum of pixel values ​​in each column of the image pixel matrix to obtain the vertical projection vector Ver_proji; Step 307: Read the vertical projection vector Ver_proji corresponding to the row image Image_rowi in sequence. From left to right, record the positions si where the value changes from 0 and ei where the value changes to 0, to obtain the left and right column positions coli=[si, ei] and all column positions col_alli=[col1,col2,col3,…,colk]. Step 308: Read the column position list col_alli corresponding to the row image Image_rowi in sequence, perform clustering on the elements in the list col_alli based on the distance threshold t, traverse col_alli, and take the j-th element colj and the (j-1)-th element colj_1 in sequence. If |colj[0]-colj_1[1]|≤t, no processing is performed. Otherwise, colj[1] and colj_1[0] are merged to obtain [colj_1[0],colj[1]] and stored in the list col_mer. ge_alli, where j=1, 2, 3, ..., p; process to obtain the corresponding merged column position list col_merge_all_t=[col_merge1_t, col_merge2_t, ..., col_merges_t], repeat the above operation until there are no more elements in the column position list that need to be merged, and obtain the final column position list col_merge_alli=[col_merge1, col_merge2, ..., col_mergem], where (m≤s); Step 309: Traverse all row images Image_rowi, read the list of merged column positions corresponding to the dimensions rowi_h and rowi_w of Image_rowi, and divide Image_rowi according to the column positions recorded in col_merge_alli, rowi_colj=Image_rowi[0:rowi_h,col_mergej[0]:col_mergej[1]], j=1,2,...,m, to obtain the corresponding column image set Image_rowi_col_set={rowi_col1,rowi_col2,...,rowi_colm}; Step 310: Initialize the sub-image width list sub_col_width, traverse the image set Image_rowi_col_set corresponding to all row images Image_rowi, read the sub-image size width rowi_colj_w, and add sub_col_width and the number of sub-images rowi_col_cnt; Step 311: Sum all elements within the corresponding sub_col_width of Image_rowi to obtain w_sumi; initialize the size of the blank canvas Image_rowi_adjust to rowi_h*(w_sumi+int((1 / 3)*w_mean)*(rowi_col_cnt-1)); integrate the sub-images in the corresponding column image set Image_rowi_col_set into Image_rowi_adjust in order, with the sub-image spacing being int((1 / 3)*w_mean); process all row images to obtain the adjusted row image set Image_row_adjust_set={Image_row1_adjust、…、Image_rowv_adjust}; Step 312: Iterate through the adjusted row image set Image_row_adjust_set. For a single row image Image_rowi_adjust, use OpenCV to adjust the background size, which is rowi_h*rowi_w. Then, fill the blanks on all four sides of the row image with the corresponding row height rowi_h as the step size. The filling size for e steps is (rowi_h+2*e*rowi_h)*(rowi_w+2*rowi_w). Each row image is filled with 1, 2, 3, 4, and 5 times the unit step size, respectively, to obtain an adjusted image set rowi_adjust_bk_set={rowi_h_img,rowi_2h_img,rowi_3h_img,rowi_4h_img,rowi_5h_img}. Perform the same processing on all rows of all images. The image and text layout adjustment is complete. Proceed to step 400.

4. The image text recognition method based on layout optimization voting according to claim 3, characterized in that, Step 400 includes, Step 401: Initialize the text line multi-layout recognition result list rowi_result, and the line image multi-layout image set rowi_adjust_bk_set={rowi_h_img,rowi_2h_img,rowi_3h_img,rowi_4h_img,rowi_5h_img}; Step 402: Iterate through the multi-layout image set rowi_adjust_bk_set, input all images in the set into the text recognition engine for recognition, obtain the recognition results, and add them to the recognition result list rowi_result. The final recognition result list rowi_result=[rowi_result_h,rowi_result_2h,rowi_result_3h, rowi_result_4h,rowi_result_5h]; Step 403: Vote on the results in rowi_result. Results with empty recognition results are not included in the vote. Take the recognition result with the highest frequency as the final recognition result of rowi. Recognize and vote on the results of all row images and add them to the result list Result in turn. Proceed to step 500.

5. A method for image text recognition based on layout optimization voting according to any one of claims 1-4, characterized in that, The text image file in step 100 includes jpg, png, or tif.

6. A method for image text recognition based on layout optimization voting according to claim 3 or 4, characterized in that, In step 308, the distance threshold is t=w_mean, where w_mean is the average line height of the text in the image.

7. An image text recognition device based on layout optimization voting, characterized in that, The method includes a memory, a control processor, and a computer program stored in the memory and executable on the control processor, wherein the control processor executes the program to implement the image text recognition method based on layout optimization voting as described in any one of claims 1-6.

8. A control system, characterized in that, The image text recognition device based on layout optimization voting as described in claim 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for implementing the image text recognition method based on layout optimization voting as described in any one of claims 1-6.