Ancient book character input method and input system
By scanning the entire text of ancient books, locating the text coordinates, and segmenting the text, combined with deep learning and high-magnification camera processing, the problems of inaccurate recognition and low input efficiency caused by the cutting, blurring, and damage of ancient books have been solved, achieving efficient and accurate input of ancient books.
Patent Information
- Application Number
- CN202511441777.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-01-06
AI Technical Summary
Existing technologies suffer from inaccurate recognition and low input efficiency of ancient texts due to cutting, blurring, and damage.
By scanning the full text of a single page of an ancient book, the coordinates of the text are accurately located and segmented into text slices. The minimum bounding polygon is determined, and the integrity and clarity of the text are scientifically assessed. Based on different states, targeted processing is carried out. Deep learning and high-magnification camera magnification scanning are used for clear processing. Combined with a text comparison model, the text is converted into a simplified Chinese document.
It enables efficient and accurate input of ancient texts, preserves the original layout, reduces manual intervention, improves input efficiency, ensures input quality, and supports the preservation and research of ancient books.
Smart Images

Figure CN121281069A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ancient text processing technology, and in particular to a method and system for inputting ancient texts. Background Technology
[0002] Early ancient book transcription relied mainly on manual character-by-character input, which, while accurate, was inefficient. The widespread adoption of scanning technology enabled the digital storage of ancient book images, but the image text could not be directly edited or retrieved. After the 1990s, OCR technology based on the national standard simplified Chinese character library was gradually applied to ancient books, but due to the challenges of recognizing traditional characters, variant characters, vertical formatting, and complex layouts, the early recognition rate was only 30% to 50%. To overcome these bottlenecks, the industry significantly improved the recognition accuracy to over 90% by developing dedicated ancient book OCR systems, constructing multi-font Unicode dictionaries, adopting intelligent layout analysis technology, and using multi-stage proofreading tools.
[0003] Publication No. CN106529521A discloses a method for digitizing ancient texts, including full-text scanning of the ancient text, fragmenting the scanned image, automatically recognizing the text cells using an ancient text font database, using a crowdsourcing model to input unrecognized text cells on an input platform, comparing and verifying the input results, improving the ancient text font database, restoring the position based on the input results and coordinates, and generating a PDF file. This invention can improve the security and efficiency of image digitization. Therefore, it is evident that existing technologies have the following problems:
[0004] The problem of inaccurate recognition and low input efficiency caused by the cutting, blurring, and loss of ancient characters in ancient books was not taken into account. Summary of the Invention
[0005] Therefore, the present invention provides a method and system for inputting ancient texts, in order to overcome the problems of inaccurate recognition and low input efficiency caused by cutting, blurring, and damage of ancient texts in the prior art.
[0006] To achieve the above objectives, on the one hand, the present invention provides a method for inputting ancient texts, comprising:
[0007] Scan a single page of an ancient book in its entirety to generate a scanned page of that ancient book.
[0008] Locate all ancient texts in the scanned page and determine the corresponding text coordinates and their ranges;
[0009] The scanned page is divided into several text slices according to the coordinate range, and the minimum bounding polygon of the text region in each text slice is determined.
[0010] The representation state of the corresponding character is determined based on the coordinate range of the minimum bounding polygon and the corresponding character slice. The representation state includes a complete state and a cut state.
[0011] The confidence score of the ancient text in each text slice is determined based on deep learning to determine the fuzzy representation state of the text slice. The fuzzy representation state includes explicit fuzzy state and implicit fuzzy state.
[0012] Determining whether a text slice is a processing slice based on its representation state and its fuzzy representation state to determine subsequent operations includes:
[0013] Extract the ancient text from the text slice;
[0014] Alternatively, a high-magnification camera can be controlled to perform magnified scanning based on the text coordinates of the processed slice to form magnified text slices, and the corresponding ancient texts can be extracted after the magnified text slices are cleared.
[0015] The order of each ancient text is determined based on the extracted text coordinates, so that it can be mapped to the corresponding position in the PDF ancient text document;
[0016] The PDF ancient book document was converted into a PDF simplified Chinese document using a text comparison model.
[0017] Furthermore, the method for locating all the ancient texts in the scanned page and determining the corresponding text coordinates and their range includes,
[0018] Get the number of rows and columns of the text area on the scanned page;
[0019] The cell for each character is determined based on the number of rows and columns;
[0020] The geometric center point of each cell is determined as the text coordinate of the ancient text corresponding to that cell;
[0021] The coordinate range of the corresponding ancient text text is determined based on the coordinates of each text and the area of the cell.
[0022] Furthermore, the areas of each of the aforementioned text slices are equal;
[0023] The area of the text slice is equal to the area enclosed by the coordinate range.
[0024] Furthermore, the representation state of the corresponding character is determined based on the coordinate range of the minimum bounding polygon and the corresponding character slice, including:
[0025] If the coordinate range of the minimum bounding polygon and the corresponding text slice meets the overlap condition, then the representation state of the corresponding text is determined to be a cutting state.
[0026] If the coordinate range of the minimum bounding polygon and the corresponding text slice does not meet the overlap condition, then the representation state of the corresponding text is determined to be a complete state.
[0027] The overlap condition is that the coordinate range of the smallest circumscribed polygon overlaps with the coordinate range of the corresponding text slice and the degree of overlap is greater than or equal to a preset ratio.
[0028] Furthermore, based on deep learning, the confidence score of the ancient text for each text slice is determined to determine the fuzzy representation state of the text slice, including:
[0029] If the confidence score is less than or equal to the preset score, the fuzzy representation state of the text slice is determined to be an explicit fuzzy state.
[0030] If the confidence score is greater than the preset score, the fuzzy representation state of the text slice is determined to be a latent fuzzy state.
[0031] Further, based on the character slice's representation state and its fuzzy representation state, it is determined whether it is a processing slice to determine subsequent operations, including:
[0032] If the representation state is a complete state and the fuzzy representation state is a latent fuzzy state, then the text slice is determined not to be a processing slice, and the ancient text of the text slice is directly extracted.
[0033] If the characterization state is a segmentation state and / or the fuzzy characterization state is an explicit fuzzy state, then the text slice is determined to be a processing slice. Based on the text coordinates of the processing slice, a high-magnification camera is controlled to perform magnification scanning to form a magnified text slice. After the magnified text slice is processed to clarify, the corresponding ancient text is extracted.
[0034] Furthermore, the magnification of the text slice is determined based on the representation state and / or fuzzy representation state of the processed slice, wherein,
[0035] If the representation state of the processed slice is a cutting state, then the magnified text slice includes the processed slice and adjacent text slices in the overlapping direction.
[0036] If the fuzzy representation state of the processed slice is an explicit fuzzy state, then the magnified text slice includes the processed slice.
[0037] If the representation state of the slice is a cutting state and the fuzzy representation state is an explicit fuzzy state, then the magnified text slice includes a processing slice and eight adjacent text slices.
[0038] Furthermore, the process of clear processing includes,
[0039] The enlarged text slices are preprocessed to form preprocessed enlarged slices, and the preprocessing includes noise reduction and contrast adjustment.
[0040] The degree of blur in the explicit blur state is determined based on the text confidence score of the processed slice to determine the sharpening method for the corresponding preprocessed magnified slice, so as to obtain the sharpened magnified slice. The sharpening method includes a spatial domain-based sharpening method, a frequency domain-based sharpening method, and a deep learning method.
[0041] On the other hand, the present invention also provides an ancient text processing system, comprising:
[0042] The scanning module is used to capture scanned pages of ancient books and enlarged text slices;
[0043] The scanning processing module, which is connected to the scanning module, is used to locate all the ancient texts in the scanned page of the ancient book and determine the corresponding text coordinates and coordinate ranges, and to divide the scanned page into several text slices according to the coordinate ranges and determine the minimum bounding polygon of the text region in each text slice.
[0044] The scanning judgment module, which is connected to the scanning processing module, is used to determine the representation state of the corresponding text based on the coordinate range of the minimum bounding polygon and the corresponding text slice, to determine the confidence score of the ancient text of each text slice based on deep learning to determine the fuzzy representation state of the text slice, and to determine whether the text slice is a processing slice based on the representation state and the fuzzy representation state of the text slice to determine subsequent operations.
[0045] The scanning control module is connected to the scanning judgment module and the shooting scanning module respectively. It is used to control the high-magnification camera to perform magnified scanning according to the text coordinates of the processed slice to form magnified text slices, and to extract the corresponding ancient texts after clearing the magnified text slices.
[0046] The scanning and input module, which is connected to the scanning judgment module, is used to determine the order of each ancient book character based on the extracted text coordinates so as to map it to the corresponding position in the PDF ancient book document, and to convert the PDF ancient book document into a PDF simplified Chinese document through a text comparison model.
[0047] Furthermore, the imaging and scanning module includes a fixed imaging unit and a zoom imaging unit;
[0048] The fixed shooting unit is used to acquire scanned pages of ancient books, and the zoom shooting unit is used to acquire magnified text slices.
[0049] Compared with existing technologies, the beneficial effects of this invention are as follows: The ancient book text input method provided by this invention accurately locates the text coordinates and segments the text into text slices by scanning the full text of a single page of an ancient book and determining the minimum bounding polygon, thereby scientifically judging the integrity and clarity of the text; then, it processes the text in a targeted manner according to different states, directly extracting text in good condition, and extracting text in problematic condition after magnification scanning and clarity processing, ensuring input quality; at the same time, it accurately sorts and maps the text coordinates to a PDF ancient book document, preserving the original layout, and converts it into a simplified Chinese document through a text comparison model, facilitating reading and dissemination; this invention uses intelligent technology to reduce manual intervention, improve input efficiency, and provide strong support for the protection and research of ancient books, achieving efficient, accurate, convenient and practical ancient book text input;
[0050] Furthermore, based on regularly divided cells, the process of determining the coordinates and ranges of ancient texts is simplified, making the positioning operation more systematic and regular, and easier to implement and understand. Determining the geometric center point of the cell as the text coordinates utilizes geometric properties to ensure the relative accuracy of coordinate positioning, and the method of determining the coordinate range based on the cell effectively defines the area where the text is located. The setting that each text slice has an equal area ensures the consistency of subsequent text slice processing, facilitating unified management and analysis. At the same time, it closely links the coordinate range with the text slice, laying a precise foundation for subsequent operations of dividing scanned pages by coordinate range and determining text slices. This, in turn, ensures the accuracy and standardization of text processing throughout the entire ancient text input process, improving text input efficiency and quality.
[0051] Furthermore, by using the minimum bounding polygon to accurately define the text region, and combining the overlap condition and preset ratio, it is determined whether the text has been cut. Considering the cell segmentation error and the writing characteristics of ancient books, by reasonably setting the preset ratio, misjudgment can be avoided and the text that is actually cut can be effectively identified, thus improving the accuracy and reliability of the judgment. In addition, artificial intelligence is used to quickly determine the degree of overlap, realize automated processing, improve the judgment efficiency, and provide an accurate basis for subsequent targeted processing of text slices. This judgment method ensures the control of the integrity of the text during the ancient book text input process, reduces the information loss or error caused by text cutting, helps to extract and process ancient book text more accurately, and ensures that the ancient book text input results can truly and completely restore the content of the ancient book. It has important practical value for the digital protection and research of ancient books.
[0052] Furthermore, by comprehensively considering the representational and fuzzy representational states of text slices, differentiated processing strategies were formulated, and appropriate clear processing methods were adopted for different degrees of fuzziness, achieving high efficiency and accuracy in ancient text extraction. Specifically, through scientific processing logic and intelligent technology applications, the quality of ancient text extraction was ensured, reducing input errors caused by text state issues. At the same time, reasonable resource allocation and processing strategies improved overall text input efficiency, providing reliable and efficient technical support for the digitization of ancient books and contributing to the effective protection and widespread dissemination of ancient book resources. Attached Figure Description
[0053] Figure 1 This is a flowchart illustrating the steps of the ancient text input method according to an embodiment of the present invention;
[0054] Figure 2 This is a schematic diagram illustrating the text coordinates and coordinate range within a single cell according to an embodiment of the present invention;
[0055] Figure 3 This is a connection diagram of the ancient text processing system according to an embodiment of the present invention;
[0056] In the diagram: 1, text coordinates; 2, coordinate range. Detailed Implementation
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] Please see Figure 1 The diagram illustrates the steps of an ancient text input method according to an embodiment of the present invention. This embodiment of the present invention provides an ancient text input method, including:
[0062] Step S1: Scan the entire page of the ancient book to generate a scanned page of the ancient book.
[0063] Step S2: Locate all ancient texts in the scanned page and determine the corresponding text coordinates 1 and their coordinate range 2;
[0064] Step S3: Divide the scanned page into several text slices according to the coordinate range 2 and determine the minimum bounding polygon of the text region in each text slice;
[0065] Step S4: Determine the representation state of the corresponding text based on the coordinate range 2 of the minimum bounding polygon and the corresponding text slice. The representation state includes the complete state and the cut state.
[0066] Step S5: Based on deep learning, determine the confidence score of the ancient text text of each text slice to determine the fuzzy representation state of the text slice. The fuzzy representation state includes explicit fuzzy state and implicit fuzzy state.
[0067] Step S6, determining whether a text slice is a processing slice based on its representation state and fuzzy representation state to determine subsequent operations, including:
[0068] Extract the ancient text from the text slice;
[0069] Alternatively, a high-magnification camera can be controlled to perform magnified scanning based on the text coordinates 1 of the processed slice to form magnified text slices, and the corresponding ancient texts can be extracted after the magnified text slices are cleared.
[0070] Step S7: Determine the order of each ancient text character based on the extracted text coordinates 1 so as to map it to the corresponding position in the PDF ancient text document;
[0071] Step S8: Convert the PDF ancient book document into a PDF simplified Chinese document using a text comparison model.
[0072] Understandably, this invention performs full-text scanning of a single page of an ancient book, locates the coordinates of all the text within the scanned page and their coordinate range 2, and then segments the text into text slices and determines the minimum bounding polygon. This method can accurately identify the position and shape of the text, avoiding omissions or incorrect segmentation of text information, and efficiently process the text into units, laying a solid foundation for subsequent text extraction and analysis. Secondly, by determining the representation state of the slice based on the minimum bounding polygon and the coordinate range 2 of the text slice, and by determining the fuzzy representation state of the text slice based on deep learning, it is possible to comprehensively and scientifically evaluate the integrity and clarity of the text. This can determine whether the text has been completely segmented and identify any fuzziness, which helps to take targeted measures for text slices in different states. The method employs several techniques: first, it improves the accuracy of text input by performing text processing; second, it determines the sorting of extracted text based on its coordinates and maps it to the corresponding position in the PDF ancient book document, ensuring that the original layout order of the ancient book text is preserved, thus maximizing the restoration of the original appearance of the ancient book; and third, it converts the PDF ancient book document into a PDF simplified Chinese document through a text comparison model, making it convenient for modern readers to read and use, greatly expanding the dissemination range and audience of ancient books, and promoting the inheritance and promotion of ancient book culture. This method utilizes intelligent technologies such as deep learning, coordinate positioning, and image segmentation, reducing manual intervention, lowering labor costs and human error, and enabling the rapid and efficient completion of ancient book text input. It is particularly suitable for the digitization of large numbers of ancient books, providing strong technical support for the rescue protection and systematic research of ancient books.
[0073] like Figure 2 As shown, this is a schematic diagram of the text coordinates and coordinate range 2 within a single cell. Specifically, in step S2, the method for locating all the ancient texts in the scanned page and determining the corresponding text coordinates 1 and their coordinate range 2 includes:
[0074] Step S21: Obtain the number of rows and columns of the text area on the scanned page;
[0075] Step S22: Determine the cell for each character based on the number of rows and columns;
[0076] Step S23: Determine the geometric center point of each cell as the text coordinate 1 of the ancient text corresponding to that cell; it can be understood that... Figure 2 The intersection of the two dashed lines is the geometric center of the corresponding cell. The dashed lines are drawn in the figure only to clearly show the position of the text coordinate 1.
[0077] Step S24: Determine the coordinate range 2 of the corresponding ancient text text based on the coordinates 1 of each text and the area of the cell. That is, the continuous coordinate points corresponding to the four sides of the cell are recorded as the coordinate range 2.
[0078] Specifically, the areas of all the text slices are equal;
[0079] The area of the text slice is equal to the area enclosed by the coordinate range 2.
[0080] Understandably, step S2 simplifies the determination of the coordinates 1 and coordinate range 2 of the ancient text based on regularly divided cells, making the positioning operation more systematic and regular, and easier to implement and understand. Determining the geometric center point of the cell as the text coordinate 1 ensures the relative accuracy of the coordinate positioning by utilizing geometric characteristics, and the method of determining the coordinate range 2 based on the cell can effectively define the area where the text is located. The setting that each text slice has an equal area ensures the consistency of subsequent text slice processing, facilitates unified management and analysis, and closely links the coordinate range 2 with the text slice, laying a precise foundation for the subsequent operation of dividing the scanned page according to the coordinate range 2 and determining the text slice, thereby ensuring the accuracy and standardization of text processing in the entire ancient text text input process, and improving the efficiency and quality of text input.
[0081] Specifically, in step S4, the representation state of the corresponding text is determined based on the coordinate range 2 of the minimum bounding polygon and the corresponding text slice, including:
[0082] If the coordinate range 2 of the minimum bounding polygon and the corresponding text slice satisfies the overlap condition, then the representation state of the corresponding text is determined to be a cutting state.
[0083] If the coordinate range 2 of the minimum bounding polygon and the corresponding text slice does not meet the overlap condition, then the representation state of the corresponding text is determined to be a complete state.
[0084] The overlap condition is that the minimum circumscribed polygon overlaps with the coordinate range 2 of the corresponding text slice and the degree of overlap is greater than or equal to a preset ratio.
[0085] Understandably, the minimum bounding polygon is the polygon that completely contains the text region and has the smallest area. For the text region in a text slice, the text is usually binarized first to separate the text from the background. Then, the minimum bounding polygon is determined by finding the boundary points of the text region and using these boundary points. In practice, existing techniques for determining the minimum bounding polygon include: convex hull algorithms, deep learning-based object detection algorithms (Faster R-CNN, YOLO, etc.), and skeleton extraction methods based on mathematical morphology, etc.
[0086] In practice, the preset ratio is usually set to below 20%. The larger the preset ratio, the greater the acceptable overlap between the smallest bounding polygon and coordinate range 2, which means the lower the accuracy of the analysis of the possibility of characters being cut when segmented by cells in the current text slice. It is understood that in a normal single cell, a single character should not be in contact with the coordinate range 2 of the cell, that is, the overlap should be close to 0 under normal circumstances. However, errors may occur when cells are segmented, and the writing style of classical Chinese may be quite varied. This invention sets a preset ratio to determine whether a single text slice has the possibility of cutting ancient texts. Therefore, the preset ratio is usually 5%, that is, when the overlap between the smallest bounding polygon and the corresponding coordinate range 2 is ≥5%, the characterization state of the corresponding character is determined to be a cutting state.
[0087] In implementation, coordinate range 2 is a rectangle, the minimum bounding polygon is a polygon, and the minimum bounding polygon can also identify its corresponding continuous coordinates during recognition. Therefore, artificial intelligence can quickly determine the overlap between the minimum bounding polygon and the corresponding coordinate range 2. In implementation, the coordinates of any point in a single page of ancient text are confirmed in the same coordinate system. The coordinate system can be arbitrarily established by artificial intelligence.
[0088] Understandably, step S4 uses the smallest bounding polygon to accurately define the text area, and combines the overlap condition and preset ratio to determine whether the text has been cut. Considering the cell segmentation error and the characteristics of ancient text writing, setting a reasonable preset ratio can avoid misjudgment and effectively identify text that is actually cut, thus improving the accuracy and reliability of the judgment. In addition, artificial intelligence is used to quickly determine the degree of overlap, realize automated processing, improve the judgment efficiency, and provide an accurate basis for subsequent targeted processing of text slices. This judgment method ensures the control of the integrity of the text during the ancient text input process, reduces the information loss or errors caused by text cutting, helps to extract and process ancient text more accurately, and ensures that the ancient text input results can truly and completely restore the content of the ancient text. It has important practical value for the digital protection and research of ancient texts.
[0089] Specifically, in step S5, the confidence score of the ancient text text for each text slice is determined based on deep learning to determine the fuzzy representation state of the text slice, including:
[0090] If the confidence score is less than or equal to the preset score, the fuzzy representation state of the text slice is determined to be an explicit fuzzy state.
[0091] If the confidence score is greater than the preset score, the fuzzy representation state of the text slice is determined to be a latent fuzzy state.
[0092] As we can understand, confidence level refers to a measure of the credibility or certainty of a model's prediction of a text slice. In the process of deep learning models recognizing and analyzing text slices from ancient books, confidence level reflects the probability that the model believes the recognized text is correct. A confidence level of 0.8 indicates that the model is 80% confident that its recognition result is correct.
[0093] In practice, the preset score is usually set to 80%. A score lower than the preset score means that the text slice has different text recognition results, which may be due to the text being blurry or damaged over time, resulting in inaccurate recognition results.
[0094] Understandably, step S5 uses deep learning to determine the confidence score of the ancient text slices, quantifies the uncertainty of the model's text recognition results, and compares it with the preset score to accurately distinguish between the explicit and implicit ambiguity states of the text slices. This approach achieves an adaptive processing strategy, which not only improves the accuracy of ancient text input but also increases the efficiency of ancient text digitization by reducing manual intervention and optimizing resource allocation. At the same time, it enhances the system's robustness in dealing with issues such as text ambiguity, providing an efficient and reliable intelligent solution for the protection and inheritance of ancient texts.
[0095] Specifically, in step S6, determining whether a text slice is a processing slice based on its representation state and its fuzzy representation state determines subsequent operations, including:
[0096] If the representation state is a complete state and the fuzzy representation state is a latent fuzzy state, then the text slice is determined not to be a processing slice, and the ancient text of the text slice is directly extracted.
[0097] If the characterization state is a segmentation state and / or the fuzzy characterization state is an explicit fuzzy state, then the text slice is determined to be a processing slice. Based on the text coordinates 1 of the processing slice, a high-magnification camera is controlled to perform magnification scanning to form a magnified text slice. After the magnified text slice is processed to clear it, the corresponding ancient text is extracted.
[0098] Understandably, step S6 performs precise classification based on the representation state and fuzzy representation state of the text slices. For complete and implicitly fuzzy text slices, the text is directly extracted to avoid over-processing and save computing resources and time. For slices that are cut or explicitly fuzzy, the high-magnification camera is controlled to magnify and scan, and combined with the information of adjacent slices, to ensure the complete and accurate recognition of the cut or fuzzy text, effectively solving the problem of information loss caused by the cutting and fuzziness of ancient texts.
[0099] Specifically, in step S6, the enlarged text slice is determined based on the representation state and / or fuzzy representation state of the processed slice, wherein,
[0100] If the characterization state of the processed slice is a cutting state, then the magnified text slice includes the processed slice and adjacent text slices in the overlapping direction; it can be understood that for text slices in the cutting state, the magnification process should include text slices in the overlapping direction to identify the cut text.
[0101] If the fuzzy representation state of the processed slice is an explicit fuzzy state, then the magnified text slice includes the processed slice.
[0102] If the representation state of the slice is a cutting state and the fuzzy representation state is an explicit fuzzy state, then the magnified text slice includes a processing slice and eight adjacent text slices.
[0103] Specifically, in step S6, the clarification process includes,
[0104] Step A01: Preprocess the enlarged text slice to form a preprocessed enlarged slice. The preprocessing includes noise reduction and contrast adjustment.
[0105] Step A02: Determine the degree of blur in the explicit blur state based on the text confidence score of the processed slice to determine the sharpening method for the corresponding preprocessed magnified slice, so as to obtain the sharpened magnified slice. The sharpening method includes a spatial domain-based sharpening method, a frequency domain-based sharpening method, and a deep learning method.
[0106] In implementation, a confidence score ≤ 80% is determined to be a linear fuzzy state. The degree of fuzziness is the ratio of the confidence score to the preset score. When the degree of fuzziness is ≥ the first preset degree of fuzziness, a spatial domain-based sharpening method is used. When the second preset degree of fuzziness is ≤ the degree of fuzziness < the first preset degree of fuzziness, a frequency domain-based sharpening method is used. When the degree of fuzziness is < the second preset degree of fuzziness, a deep learning method is used.
[0107] In practice, the first preset fuzziness level is ≥0.9, and the second preset fuzziness level is ≥0.7; preferably, the first preset fuzziness level is 0.9, and the second preset fuzziness level is 0.85.
[0108] Understandably, when the blur level is greater than the first preset blur level, it means that although the text slice is explicitly blurred, its confidence score is still relatively close to the preset score (i.e., not particularly blurry). In this case, a spatial domain-based sharpening method can meet the requirements for magnification processing. When the blur level is between the first and second preset blur levels, it means that the blur level of the text slice is relatively severe. In this case, a spatial domain-based sharpening method cannot meet the processing requirements, and a frequency domain-based sharpening method needs to be used. When the blur level is less than the second preset blur level, it means that the text slice is very blurry, and a more precise and complex method (i.e., a deep learning method) is required for processing.
[0109] In practice, spatial domain-based sharpening methods can enhance image edges and details; however, in noisy images, noise is easily amplified. Relatively simple methods involve convolution kernels and pixel convolution operations, involving pixel neighborhood operations and simple mathematical calculations, resulting in low computational cost and ease of implementation and understanding. Frequency domain-based sharpening methods can precisely control frequency components, effectively removing blur and noise and improving clarity; however, improper parameters can easily produce ringing effects, making them more complex. They require frequency domain transformations (such as Fast Fourier Transform) and inverse transformations, involving complex number operations and numerous multiplication and addition operations, resulting in high computational cost, complex parameter adjustments, and high technical and equipment requirements. Deep learning-based sharpening methods can learn complex image features and mapping relationships, achieving good sharpening effects on various types of images, enhancing details and edges while suppressing noise, generating more natural and realistic images. However, the processing is extremely complex, requiring a large amount of labeled data, selecting a suitable model architecture for training and optimization, involving complex parameter adjustments and optimization algorithms. Training requires powerful computing resources, and model loading and initialization during inference also require time and resources, making them difficult to understand and debug.
[0110] Understandably, the degree of blur is determined based on the text confidence score, and then a sharpening method based on spatial domain, frequency domain, or deep learning is matched: for text slices with low blur, a simple and efficient spatial domain sharpening method is used; when the blur is moderate, a frequency domain sharpening method that can precisely control frequency components is used; and for extremely blurry text slices, deep learning methods are used to mine complex image features to achieve the best sharpening effect. This intelligent adaptation processing method balances processing efficiency and resource consumption while ensuring processing quality.
[0111] Please see Figure 3 The diagram shown is a connection diagram of the ancient text processing system according to an embodiment of the present invention. The present invention also provides an ancient text processing system, comprising:
[0112] The scanning module is used to capture scanned pages of ancient books and enlarged text slices;
[0113] The scanning processing module, which is connected to the scanning module, is used to locate all the ancient texts in the scanned page of the ancient book and determine the corresponding text coordinates 1 and coordinate range 2, and to divide the scanned page into several text slices according to the coordinate range 2 and determine the minimum bounding polygon of the text region in each text slice.
[0114] The scanning judgment module, which is connected to the scanning processing module, is used to determine the representation state of the corresponding text based on the coordinate range 2 of the minimum bounding polygon and the corresponding text slice, to determine the confidence score of the ancient text of each text slice based on deep learning to determine the fuzzy representation state of the text slice, and to determine whether the text slice is a processing slice based on the representation state and the fuzzy representation state of the text slice to determine subsequent operations.
[0115] The scanning control module is connected to the scanning judgment module and the shooting scanning module respectively. It is used to control the high-magnification camera to perform magnified scanning according to the text coordinates 1 of the processed slice to form magnified text slices, and to extract the corresponding ancient texts after clearing the magnified text slices.
[0116] The scanning and input module, which is connected to the scanning judgment module, is used to determine the order of each ancient book character based on the extracted ancient book text's text coordinates 1 so as to map it to the corresponding position in the PDF ancient book document, and to convert the PDF ancient book document into a PDF simplified Chinese document through a text comparison model.
[0117] Specifically, the imaging and scanning module includes a fixed imaging unit and a zoom imaging unit;
[0118] The fixed shooting unit is used to acquire scanned pages of ancient books, and the zoom shooting unit is used to acquire magnified text slices.
[0119] It is understood that the fixed shooting unit can be any type of high-definition camera in the prior art, in one implementation; the zoom shooting unit can be any type of macro zoom lens in the prior art (optical zoom magnification of about 10x to 20x).
[0120] In practice, the scanning module also requires a dedicated lighting system, such as halogen lamps or LED cold light sources, to evenly illuminate the pages of the ancient book through fiber optic transmission.
[0121] 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.
[0122] 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. A method for entering ancient text, characterized by, The method comprises: full-text scanning of a single page of an ancient book to generate a scanned page of the page of the ancient book; locating all ancient book characters in the scanned page and determining corresponding character coordinates and coordinate ranges thereof; segmenting the scanned page into a plurality of character slices according to the coordinate ranges and determining minimum circumscribed polygons of character regions in each character slice; determining a representation state of a corresponding character according to the minimum circumscribed polygon and the coordinate range of the corresponding character slice, the representation state comprising a complete state and a cut state; determining a confidence score of an ancient book character of each character slice based on deep learning to determine a fuzzy representation state of the character slice, the fuzzy representation state comprising an explicit fuzzy state and an implicit fuzzy state; determining whether the character slice is a processing slice according to the representation state and the fuzzy representation state of the character slice to determine a subsequent operation, comprising: extracting the ancient book character of the character slice; or, controlling a high-magnification camera to perform magnification scanning to form a magnified character slice according to the character coordinates of the processing slice, and extracting the corresponding ancient book character after clear processing of the magnified character slice; determining an order of each ancient book character according to the character coordinates of the extracted ancient book character to map it to a corresponding position of a PDF ancient book document; converting the PDF ancient book document into a PDF simplified Chinese document through a character comparison model.
2. The method of claim 1, wherein, The method of locating all ancient book characters in the scanned page and determining corresponding character coordinates and coordinate ranges thereof comprises: obtaining the number of rows and columns of the character region of the scanned page; determining a cell of each character according to the number of rows and columns; determining the geometric center point of each cell as the character coordinate of the ancient book character corresponding to the cell; determining the coordinate range of the corresponding ancient book character according to each of the character coordinates and the cell area.
3. The method of claim 1, wherein the method further comprises: The areas of each of the character slices are equal. The area of the character slice is equal to the area enclosed by the area and the coordinate range.
4. The method of claim 1, wherein, The method of determining a representation state of a corresponding character according to the minimum circumscribed polygon and the coordinate range of the corresponding character slice comprises: if the minimum circumscribed polygon and the coordinate range of the corresponding character slice satisfy an overlap condition, determining that the representation state of the corresponding character is a cut state; if the minimum circumscribed polygon and the coordinate range of the corresponding character slice do not satisfy the overlap condition, determining that the representation state of the corresponding character is a complete state; wherein the overlap condition is that the minimum circumscribed polygon and the coordinate range of the corresponding character slice overlap and the overlap degree is greater than or equal to a preset proportion. The method of determining a confidence score of an ancient book character of each character slice based on deep learning to determine a fuzzy representation state of the character slice comprises:
5. The method of claim 1, wherein, if the confidence score is less than or equal to a preset score, determining that the fuzzy representation state of the character slice is an explicit fuzzy state; if the confidence score is greater than the preset score, determining that the fuzzy representation state of the character slice is an implicit fuzzy state. The method of determining whether the character slice is a processing slice according to the representation state and the fuzzy representation state of the character slice to determine a subsequent operation comprises:
6. The method of claim 1, wherein, if the representation state is a complete state and the fuzzy representation state is an implicit fuzzy state, determining that the character slice is not a processing slice, and directly extracting the ancient book character of the character slice. If the representation state is a cutting state and / or the ambiguous representation state is an explicit ambiguous state, the text slice is determined as a processing slice, and a high-magnification camera is controlled to perform a zoom-in scan according to text coordinates of the processing slice to form a zoom-in text slice, and the zoom-in text slice is processed to extract corresponding ancient text.
7. The ancient document text input method according to claim 6, wherein The zoom-in text slice is determined according to a representation state and / or an ambiguous representation state of the processing slice, wherein, If the representation state of the processing slice is a cutting state, the zoom-in text slice includes the processing slice and an adjacent text slice in an overlapping direction; If the ambiguous representation state of the processing slice is an explicit ambiguous state, the zoom-in text slice includes the processing slice; If the representation state of the slice is a cutting state and the ambiguous representation state is an explicit ambiguous state, the zoom-in text slice includes the processing slice and eight adjacent text slices thereof.
8. The ancient document text input method according to claim 6, wherein The process of the clear processing includes, The zoom-in text slice is preprocessed to form a preprocessed zoom-in slice, and the preprocessing includes noise reduction processing and contrast adjustment; A sharpening method of the preprocessed zoom-in slice is determined according to a text confidence score of the processing slice to determine a degree of ambiguity of the explicit ambiguous state, so as to obtain a sharpened zoom-in slice, and the sharpening method includes a spatial domain-based sharpening method, a frequency domain-based sharpening method, and a deep learning method.
9. A system for inputting ancient texts using the method for inputting ancient texts according to any one of claims 1-8, characterized in that, It includes, The photographing and scanning module is used to obtain a scanned page of a single page of an ancient book and a zoom-in text slice; The scanning processing module is connected with the photographing and scanning module, and is used to locate all ancient text in the scanned page of the ancient book, determine corresponding text coordinates and a coordinate range, and segment the scanned page into a plurality of text slices according to the coordinate range and determine a minimum circumscribed polygon of a text region in each text slice; The scanning judgment module is connected with the scanning processing module, and is used to determine a representation state of corresponding text according to the minimum circumscribed polygon and a coordinate range of the corresponding text slice, determine a confidence score of ancient text in each text slice based on deep learning to determine an ambiguous representation state of the text slice, and determine whether the text slice is a processing slice according to the representation state and the ambiguous representation state of the text slice to determine a subsequent operation; The scanning control module is connected with the scanning judgment module and the photographing and scanning module, and is used to control a high-magnification camera to perform a zoom-in scan according to text coordinates of the processing slice to form a zoom-in text slice, and process the zoom-in text slice to extract corresponding ancient text. The scanning input module is connected with the scanning judgment module, and is used to determine an order of each ancient text according to text coordinates of the extracted ancient text to map the ancient text to a corresponding position of a PDF ancient book document, and convert the PDF ancient book document into a PDF simplified Chinese document through a text comparison model.
10. The ancient document text input system according to claim 9, wherein The photographing and scanning module includes a fixed photographing unit and a zoom photographing unit; The fixed photographing unit is used to obtain a scanned page of an ancient book, and the zoom photographing unit is used to obtain a zoom-in text slice.
Citation Information
Patent Citations
Ancient book character digital recording method
CN106529521A