Method, system, terminal and medium for converting text clarity based on OCR technology

Obtain ancient characters images through OCR technology, generate high-definition characters and perform proofreading, solving the problem of difficulty in identifying ancient characters and achieving the effect of convenient reading and learning ancient characters.

CN114220109BActive Publication Date: 2025-09-05YUEDU (ZHEJIANG) DIGITAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111450118.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-09-05
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and understand ancient characters, especially those with fonts that are biased or eroded, and the way to directly translate them into modern Chinese lacks learning and educational significance.

Method used

OCR technology is used to obtain ancient character images, generate character parameters, determine the recognition area, identify character shape characteristics, and compare it with the preset ancient character database to find high-definition character models, generate high-definition characters, and adjust them through proofreading operations to finally output high-definition images.

Benefits of technology

It reduces the difficulty of identifying ancient characters, facilitates readers to read and learn, and improves the recognition and learning effect of ancient characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114220109B_ABST
    Figure CN114220109B_ABST
Patent Text Reader

Abstract

The present application relates to a method, system, terminal and medium for converting text clarity based on OCR technology, which includes obtaining an ancient text image; generating character parameters based on the ancient text image; determining the recognition area of ​​each character based on the character parameters; identifying each recognition area and generating shape features corresponding to each character; comparing the shape features of the characters with a preset ancient text database to determine the ancient text font style; identifying the shape features of the characters based on the ancient text font style and the ancient text database, searching for the corresponding high-definition character model and generating high-definition characters based on the high-definition character model; arranging all high-definition characters according to the original character arrangement order; performing a proofreading operation and adjusting the high-definition characters based on the proofreading results; and outputting a high-definition image showing the high-definition characters. The present application has the effect of improving the recognition of ancient text and facilitating readers to read, copy and learn ancient text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text conversion technology, and in particular to a text clarity conversion method, system, terminal and medium based on OCR technology. Background Art

[0002] Optical Character Recognition (OCR) is a technology used to examine characters printed on paper or in images, determine the character shape by detecting patterns of dark and light color differences, and translate the shape into computer text using character recognition methods. It is widely used in text conversion software and hardware.

[0003] Due to the wide variety of ancient Chinese characters, their abstract characters, and their unfamiliar meanings, they are not suitable for beginners to directly read and understand. To understand the contents of ancient books, beginners or ordinary readers need to consult a dictionary or consult a professional teacher for a word-for-word translation, a complex and time-consuming process.

[0004] There are also some programs that store ancient characters from various dynasties. They can find modern Chinese characters that are consistent with the meaning of the ancient characters by comparing their shape features, and use this to translate the ancient characters and convert them into modern Chinese characters.

[0005] Regarding the above-mentioned related technologies, the inventor believes that if readers read the original text of ancient characters directly, it will be difficult to recognize some ancient characters with unconventional fonts or incomplete fonts due to erosion. Although the existing method of directly translating ancient characters into modern Chinese can facilitate readers to understand the content of the article, for scholars, the historical restoration degree is low, the process of learning the ancient characters themselves is lost, and there is a defect of lack of learning and educational significance. Summary of the Invention

[0006] Firstly, in order to improve the recognition of ancient characters and facilitate readers to read, copy and learn ancient characters, this application provides a text clarity conversion method based on OCR technology.

[0007] This application provides a text clarity conversion method based on OCR technology, which adopts the following technical solutions:

[0008] A text clarity conversion method based on OCR technology, comprising:

[0009] Obtain ancient text images;

[0010] Generate character parameters based on ancient character images;

[0011] Determine the recognition area of ​​each character based on the character parameters;

[0012] Identify each recognition area and generate shape features corresponding to each character;

[0013] Compare the shape features of the characters with the preset ancient character database to determine the ancient character font style;

[0014] Recognize the shape features of characters based on their ancient Chinese font style and ancient Chinese character database, search for corresponding high-definition character models, and generate high-definition characters based on the high-definition character models;

[0015] Arrange all high-definition characters according to the original character arrangement order;

[0016] Perform proofreading and adjust high-definition characters according to the proofreading results;

[0017] Outputs high-definition images with high-definition characters.

[0018] By adopting the above technical solution, the character parameters are first determined to obtain the recognition area of ​​the character, which is convenient for recognition; then, based on the shape characteristics of the character, a high-definition character model of a similar font is searched in a preset ancient character database to determine the ancient character font style of the entire text and narrow the search range; finally, the corresponding high-definition character model is found within the determined search range and a high-definition character is generated; through a proofreading operation, the misrecognized characters are screened out and readjusted, and finally a high-definition image converted into a high-definition character is obtained, which reduces the difficulty of ancient character recognition and facilitates readers to read, copy and learn ancient characters.

[0019] Preferably, the character parameters include character size and character line spacing;

[0020] The method for generating the character parameters includes:

[0021] Acquire and perform image binarization processing on the ancient character image to generate a binary image;

[0022] Distinguish the character area and the gap area based on the binary image;

[0023] Screen out the closed ring graphics formed in the gap area;

[0024] Calculate and generate character parameters based on the sizes of all closed loop shapes.

[0025] By adopting the above technical solution, the character size and character line spacing can be used to easily determine the area where the characters are located, thereby narrowing the recognition area and reducing the workload of search and recognition; and the ancient text image after binarization generally only has characters, labels and filled gaps left, which makes it easy to screen out character areas and gap areas, and thus obtain character parameters by measuring the size of the closed ring figure.

[0026] Preferably, after the step of determining the recognition area of ​​each character according to the character parameters, the method further comprises:

[0027] Acquire the closed loop graph;

[0028] Based on the closed loop figure and the preset constraints, a closed loop recognition frame is generated, and a recognition area corresponding to the character is formed within the recognition frame;

[0029] Displaying a zoom control on the identification frame, the zoom control being used to adjust the size of the identification frame in response to a trigger instruction;

[0030] Based on the trigger instruction, the recognition area is re-determined.

[0031] By adopting the above technical solution, the ancient text image after binarization generally only has characters, numbers and filled gaps left. The filled gaps are the gap areas, and the closed ring figure is a circle of blank space outside the characters, which can be used as the recognition box of a single character to determine the recognition area, thereby narrowing the recognition area and reducing the search workload, thereby improving recognition efficiency; and the zoom control can realize manual adjustment of the recognition area to avoid the situation where the recognition box only contains the radical of a certain character or two or more characters are contained in the box at the same time.

[0032] Preferably, the preset ancient character database includes multiple groups of ancient character model groups, each group of ancient character model groups corresponds to at least one ancient character font style, and the ancient character model group includes multiple high-definition character models and multiple comparison models corresponding to the high-definition character models;

[0033] The step of comparing the shape features of the characters with a preset ancient character database to determine the ancient character font style includes:

[0034] Compare the shape features of the characters with the comparison models within all the ancient character model groups;

[0035] Find the comparison model with the highest feature similarity;

[0036] The ancient Chinese font style of the character is determined based on the comparison model.

[0037] By adopting the above technical solution, each group of ancient character model groups corresponds to at least one ancient character font style. Ancient character font styles refer to seal script, regular script and other fonts. By determining the ancient character font style, the search range on the same ancient character image can be narrowed, thereby reducing the workload and improving the efficiency of text recognition and conversion.

[0038] Preferably, the steps of identifying the shape features of characters based on the ancient Chinese character font style and the ancient Chinese character database, searching for corresponding high-definition character models, and generating high-definition characters based on the high-definition character models include:

[0039] Obtaining the comparison results of the shape features of the characters and the comparison models in all ancient character model groups;

[0040] According to the above comparison results, find the comparison model with the highest feature similarity;

[0041] Retrieving the high-definition character model corresponding to the comparison model;

[0042] High-definition characters are generated according to the high-definition character model.

[0043] By adopting the above technical solution, the comparison model, that is, the character that is compared and finally determined to be a certain high-definition character model, is a different expression of the high-definition character model. Therefore, after obtaining the most similar comparison model, the corresponding high-definition character model can be found, and finally the high-definition character is generated.

[0044] Preferably, the proofreading operation includes:

[0045] Obtain the original characters and their corresponding high-definition characters in the ancient text image, and display them both on the human-computer interaction interface;

[0046] Displaying a group of similar characters on the human-computer interaction interface, the group of similar characters including a plurality of comparison models that rank highly similar to the original character features or high-definition character models corresponding to the comparison models;

[0047] A reselection control is displayed on the similar character, and the reselection control is used to call the high-definition character model corresponding to the similar character in response to a trigger instruction to replace the original high-definition character.

[0048] By adopting the above technical solution, the high-definition characters obtained after recognizing the ancient text image are displayed on the human-computer interaction interface, which is convenient for the staff to compare and display other search results at the same time, that is, multiple comparison models are selected according to the similarity with the character features. The comparison model can also be replaced with a high-definition character model, which is convenient for the staff to proofread and select the correct high-definition character model, reducing the workload of the staff and improving the proofreading efficiency.

[0049] Preferably, after the step of obtaining the original characters in the ancient text image and the corresponding high-definition characters and displaying them both on the human-computer interaction interface, the method further includes:

[0050] View controls are displayed on the human-computer interaction interface, each view control corresponds to an original character, and the view controls are used to display a comparison pop-up window in response to a trigger instruction, wherein the comparison pop-up window displays a partial ancient character image, and the partial ancient character image includes the original character.

[0051] By adopting the above technical solution, the staff can trigger the comparison pop-up window by clicking the view control to display part of the ancient character image, that is, a partial screenshot of the ancient character image, which is convenient for the staff to compare the font of the ancient character and check whether it is incomplete. At the same time, it can also be judged based on the context whether the ancient character corresponds to the current recognized high-definition character.

[0052] Secondly, in order to reduce the difficulty of recognizing ancient characters and facilitate readers to read, copy and learn ancient characters, this application provides a text clarity conversion system based on OCR technology, which adopts the following technical solutions:

[0053] A text clarity conversion system based on OCR technology, including:

[0054] A character parameter generation module is used to obtain an ancient character image and generate character parameters based on the ancient character image;

[0055] A recognition area determination module is used to determine the recognition area of ​​each character based on character parameters;

[0056] The font determination module is used to identify each recognition area, generate shape features corresponding to each character, and compare the shape features of the characters with a preset ancient character database to determine the ancient character font style;

[0057] A high-definition character generation module is used to identify the shape features of characters based on the ancient Chinese font style and the ancient Chinese database, find the corresponding high-definition character model, and generate high-definition characters based on the high-definition character model;

[0058] A proofreading module, used for performing a proofreading operation and adjusting the high-definition characters according to the proofreading result;

[0059] The high-definition image output module is used to arrange all high-definition characters according to the original character arrangement sequence and output a high-definition image showing the high-definition characters.

[0060] By adopting the above technical solution, the character parameters are first determined by the character parameter generation module, and the recognition area of ​​the character is obtained by the recognition area determination module, so as to facilitate recognition; then, the high-definition character model of a similar font is searched for in a preset ancient character database according to the shape characteristics of the character by the font determination module, the ancient character font style of the entire text is determined, and the search range is narrowed; finally, the high-definition character generation module finds the corresponding high-definition character model within the determined search range and generates high-definition characters; the proofreading module filters out the misrecognized characters and readjusts them, and finally the high-definition image converted into high-definition characters is obtained by the high-definition image output module, thereby reducing the difficulty of ancient character recognition and facilitating readers to read, copy and learn ancient characters.

[0061] Thirdly, in order to reduce the difficulty of recognizing ancient characters and facilitate readers to read, copy and learn ancient characters, this application provides a smart terminal that adopts the following technical solutions:

[0062] An intelligent terminal includes a memory and a processor. The memory stores a computer program that can be loaded by the processor and execute the above-mentioned text clarity conversion method based on OCR technology.

[0063] Fourthly, in order to reduce the difficulty of recognizing ancient characters and facilitate readers to read, copy and learn ancient characters, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0064] A computer-readable storage medium stores a computer program that can be loaded by a processor and execute any one of the above-mentioned text clarity conversion methods based on OCR technology.

[0065] In summary, this application includes at least one of the following beneficial technical effects:

[0066] 1. First, character parameters are determined to obtain the character recognition area for easy recognition. Then, based on the character's shape characteristics, high-definition character models of similar fonts are searched in a preset ancient character database to determine the ancient character font style of the entire text and narrow the search range. Finally, the corresponding high-definition character model is found within the determined search range and a high-definition character is generated. Through a proofreading operation, incorrectly recognized characters are screened out and readjusted, and finally a high-definition image is obtained, which reduces the difficulty of ancient character recognition and facilitates readers to read, copy and learn ancient characters.

[0067] 2. After binarization, only characters, symbols, and filled gaps remain in the ancient Chinese characters. The filled gaps are called gap areas, while the closed ring pattern is a circle of blank space around the characters. It can be used as a recognition frame for a single character to determine the recognition area, thereby narrowing the recognition area and reducing the search workload, thereby improving recognition efficiency.

[0068] 3. The high-definition characters obtained after recognizing the ancient text image are displayed on the human-computer interaction interface to facilitate comparison by the staff. At the same time, other search results are displayed, that is, multiple comparison models are selected according to the similarity with the character features. The comparison model can also be replaced with a high-definition character model, which is convenient for the staff to proofread and select the correct high-definition character model, reducing the workload of the staff and improving the proofreading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is a flow chart of the method for converting text clarity based on OCR technology in Example 1 of the present application.

[0070] Figure 2This is a partial method flow chart of the text clarity conversion method based on OCR technology in Example 1 of the present application, which mainly shows the steps of obtaining character parameters.

[0071] Figure 3 This is a partial method flow chart of the text clarity conversion method based on OCR technology in Example 1 of the present application, which mainly shows the execution steps of manual segmentation and matching.

[0072] Figure 4 This is a partial method flow chart of the text clarity conversion method based on OCR technology in Example 1 of the present application, which mainly shows the execution steps of cluster proofreading.

[0073] Figure 5 This is a system module diagram of the text clarity conversion system based on OCR technology in Example 2 of the present application. DETAILED DESCRIPTION

[0074] The present application is further described in detail below in conjunction with all the accompanying drawings.

[0075] The input of the trigger command can be obtained through mechanical button triggering or virtual button triggering. With mechanical button triggering, the input can be automatically obtained after turning on the power by pressing the power button, or the current behavior information can be obtained by pressing the corresponding trigger button again after turning on the power. With virtual button triggering, the input can be obtained by pressing the relevant virtual trigger button in the interface of the corresponding software.

[0076] Example 1:

[0077] Reference Figure 1 , a text clarity conversion method based on OCR technology includes:

[0078] S100: Acquire an ancient character image.

[0079] Specifically, the ancient text images can be in the form of image files in JPG, PDF and other formats, and can be scanned from the original texts, manuscripts, and rubbings.

[0080] Reference Figure 1 、 Figure 2 S200: Generate character parameters based on the ancient character image. The character parameters include character size, character line spacing, etc. The specific acquisition steps are S210-S230:

[0081] S210: performing image binarization processing on the ancient character image to generate a binary image, and distinguishing the character area and the gap area based on the binary image.

[0082] Specifically, image binarization involves applying a preset threshold to a grayscale image with 256 brightness levels to create a binary image that still reflects both the overall and local features of the image. By converting the grayscale values ​​of the pixels in the image to 0 or 255, the entire image appears distinctly black and white. Characters, symbols, and writing areas typically have significant color differences from the blank spaces. This color difference is used to isolate the characters, forming the character area, while the remaining blank space serves as the gap area.

[0083] S220: Filter out the closed ring-shaped graphics formed in the gap area.

[0084] Specifically, a closed ring graphic can represent any closed graphic with a character area filled inside, which can generally be a square or a circle. Therefore, this embodiment takes squares and circles as examples to represent the outer blank part surrounding characters and labels, with characters, labels, etc. filled in the middle.

[0085] S230: Calculate and generate character parameters based on the sizes of all closed loop graphics.

[0086] Specifically, based on the length and width of the closed ring, or the radius of the ring, to narrow the scope of later character recognition, the parameters of the smallest box or ring are selected as one of the character parameters, provided that the inner character area can be enclosed. For example, the character size can be the length and width of the smallest box, or the diameter of the smallest ring. The character line spacing is generally selected from the width of the widest part between the inner and outer rings of the closed ring. Of course, it is also possible to manually determine whether the writing is horizontal or vertical, and then select the horizontal continuous gap area or vertical continuous gap area.

[0087] S300: Determine the recognition area of ​​each character according to the character parameters.

[0088] The recognition area is used to facilitate the program to recognize characters, narrow the recognition area, reduce the amount of calculation, and improve recognition efficiency, which specifically includes steps S310-320.

[0089] S310: generating a closed circular recognition frame according to the closed circular figure and preset constraints, and forming a recognition area corresponding to the character within the recognition frame.

[0090] Specifically, the part within the recognition frame is the recognition area. The preset constraint conditions can be selected as high-precision recognition and high-speed recognition. The former sacrifices computational power and expands the recognition area to improve the integrity of sample recognition. According to this constraint condition, the recognition frame preferably selects the outer contour of a closed circular graphic, and can also include adjacent closed circular graphics, that is, increasing the sample range for recognition and reducing the missing part. For example, the dot part of "xian" may be far from other radicals, resulting in failure to collect it during recognition. When the preset constraint condition is high-speed recognition, it is necessary to reduce computational power and reduce the recognition area. Therefore, the recognition frame preferably selects the inner contour of a closed circular graphic, reducing the area and the number of pixel points of the recognition area.

[0091] Since in the same ancient Chinese character text, except for some titles, the font sizes are generally roughly similar, the size of the recognition frame can be preset.

[0092] S320: Preset the size of the recognition frame, which is divided into two cases, a and b:

[0093] a. By manually viewing the ancient Chinese character image, after roughly determining the character size, input the preset value range of the recognition frame.

[0094] b. When the program automatically scans the ancient Chinese character image to generate a closed circular graphic, after calculating the sizes of all closed circular graphics, screen out the size range of the closed circular graphic with the largest proportion and the most concentrated part as the preset range of the recognition frame. The character area surrounded by the closed circular graphic with a size smaller than the lower limit value of this range can be not considered, or merged into the adjacent recognition frame for unified recognition. Those with a size larger than the upper limit value of this range can be manually recognized and entered separately.

[0095] S400: After determining the recognition area, recognize each recognition area and generate the shape features corresponding to each character.

[0096] Specifically, recognizing each recognition area means recognizing the area within each recognition frame. When there is no error in generating the recognition frame, it is used to select a single character for one-to-one comparison during character recognition. The recognition area for a single recognition can be the ancient Chinese character within a single recognition frame, or multiple characters within multiple continuously distributed recognition frames, so as to facilitate screening out associated words, such as names, items, events, etc. mentioned in the article, and making many-to-many comparisons during recognition to improve accuracy. The shape features are the radicals and so on, and can also be specifically refined to strokes, the length of strokes, angles, and relative positions of placement, such as left strokes and right strokes.

[0097] S500: Compare the shape features of the characters within the recognition frame with the preset ancient Chinese character database to determine the font style of the ancient Chinese characters.

[0098] The ancient Chinese character database includes multiple sets of ancient Chinese character models, each corresponding to at least one ancient Chinese character font style, such as small seal script, regular script, and Song style. The ancient Chinese character model sets can be populated with new fonts through data accumulation or synchronized via internet connections. Each ancient Chinese character model set stores all the ancient characters in a single font.

[0099] The ancient Chinese character model set includes multiple high-definition character models and multiple comparison models corresponding to the high-definition character models. Specifically, the high-definition character models can be high-definition fonts obtained by manually tracing and restoring the ancient Chinese characters, or they can be high-definition fonts obtained through color correction, defective pixel repair, radical correction, and font completion. High-definition fonts can facilitate reader recognition and understanding, thereby improving the recognizability of ancient characters while restoring them.

[0100] The comparison model is the original, unprocessed ancient character font. The ancient character database includes previously accumulated ancient character fonts and those available online. Deep learning is used to continuously accumulate this data, thereby improving the accuracy of subsequent character recognition. The comparison model represents different representations of the same ancient character, but still belongs to the same font style, such as Han Li. A high-definition character model is unique, and it may correspond to multiple comparison models, but the differences arise only due to different writers or different periods of time. The comparison model's representation more closely matches the ancient character depicted in the image, thus improving recognition accuracy when used as a sample model.

[0101] The method steps for determining the ancient Chinese character font style include S510-S520.

[0102] S510: Compare the shape features of the character with the comparison models in all ancient character model groups to find the comparison model with the highest feature similarity.

[0103] Specifically, the recognition technology uses commonly used OCR technology, which is relatively mature and will not be described in detail here. The characters in the recognition box are compared with the comparison model. The feature similarity criteria include the size and arrangement of the strokes. At the same time, in order to improve the recognition accuracy, it is necessary to allocate multiple comparison models that have been scaled according to the size of the recognition box. They are compared one by one with the characters in the recognition box, and the one with the highest similarity is selected as the similarity output result. For example, if the recognition box is 5*5, 4*4, 4.5*4.5 and 5*5 comparison models can be selected for comparison one by one, thereby reducing the error caused by size differences.

[0104] S520: Determine the ancient Chinese font style of the character based on the comparison model.

[0105] Specifically, the font styles of ancient Chinese characters include Han Li, regular script, small seal script, etc. When the comparison model with the highest similarity is selected, the font corresponding to the ancient Chinese character model group to which the comparison model belongs is the font type of the current ancient Chinese character. For the same text, by determining the font style of the ancient Chinese character, the search range on the same ancient Chinese character image can be narrowed, thereby reducing the workload and improving the efficiency of character recognition and conversion.

[0106] S600: According to the font style of the ancient Chinese character and the shape characteristics of the characters recognized by the ancient Chinese character database, find the corresponding high-definition character model and generate high-definition characters based on the high-definition character model.

[0107] Specifically, after determining the font type used throughout the text, the ancient Chinese character model group corresponding to the selected font type can be used as the reference sample data. The shape characteristics of the characters are recognized through the comparison models included therein. After finding the comparison model with the highest similarity, the high-definition character model can be determined, that is, the high-definition character model corresponding to this comparison model. Copy the high-definition character model, convert the high-definition character model to the required size and save it as a high-definition character for adapting to different layouts in the later stage.

[0108] S610: Arrange all high-definition characters according to the original character arrangement order.

[0109] Specifically, the user can pre-select an empty template as the layout, and then copy the line spacing and character size of the characters, etc., according to the character arrangement order and character parameters on the ancient Chinese character image, and fill the high-definition characters into the empty template in sequence.

[0110] S620: Perform a proofreading operation and adjust the high-definition characters according to the proofreading results. The proofreading operation is divided into manual segmentation, clustering proofreading, graphic and text proofreading, and proofreading of difficult characters.

[0111] Refer to Figure 1 、 Figure 3 , since the partial radicals of the same ancient Chinese character may have a large spacing, such as "Lv", etc., it is easy to be recognized by the program as two recognition frames, resulting in being recognized as two "kou" characters. Therefore, manual adjustment of the recognition frame is required. The specific steps are SA1 - SA3:

[0112] SA1. Display the manual segmentation page on the human-computer interaction interface. The manual segmentation page displays the ancient Chinese character image and the recognition frame, and the character is located within the recognition frame;

[0113] SA2. Display a zoom control on the recognition frame. The zoom control is used to adjust the size of the recognition frame in response to a trigger instruction;

[0114] SA3. Based on the trigger instruction, re-determine the recognition area.

[0115] Specifically, the user can see the characters on the ancient text image and the range of the recognition box at the same time on the manual segmentation page, and a zoom control is displayed on the recognition box. For example, when the recognition box is circular, the zoom control icon can be displayed when the mouse pointer hovers over the recognition box. By clicking the icon and pulling the icon, the radius of the recognition box and the selection range can be adjusted. For example, when the recognition box is square, each recognition area can be identified and the shape features corresponding to each character can be generated. When the mouse pointer hovers over the recognition box, zoom control icons are displayed on the four sides of the recognition box. By clicking the icon and pulling the icon, the length and width of the recognition box can be adjusted. Manual segmentation of the recognition box range can achieve accurate recognition of the program and improve the recognition accuracy of ancient characters. After the recognition box range is selected, the user can input a trigger instruction by manipulating the mouse pointer or pressing a button to confirm the manual segmentation operation. At this time, the program re-recognizes the characters in the adjusted recognition box, corrects the recognition results, and adjusts the high-definition characters.

[0116] Reference Figure 1 、 Figure 4 Clustering proofreading is used to classify all ancient Chinese characters that match the same high-definition character model in S600. It applies a common clustering algorithm and classifies them based on the same high-definition character model to facilitate centralized proofreading. The specific steps are as follows: SB1-SB2:

[0117] SB1. Obtain the original characters and their corresponding high-definition characters in the ancient text image, and display both on the human-computer interaction interface to form a cluster proofreading page.

[0118] Specifically, one high-definition character is displayed. The number of original characters refers to the original text that appears in the article containing the ancient text image, and their number is related to their frequency of appearance. Each time the original character corresponding to the high-definition character appears in the article, one is displayed, along with font images corresponding to these original characters, captured from the ancient text image. Typically, one high-definition character corresponds to multiple original characters. The layout can be such that each line is aligned to the top of the line with the high-definition character, and the different original characters appearing in the article are displayed sequentially on the same line.

[0119] SB2. Display viewing controls on the human-computer interaction interface, each viewing control corresponds to an original character, and the viewing controls are used to display a comparison pop-up window in response to a trigger instruction. The comparison pop-up window displays a partial ancient character image, and the partial ancient character image contains the original character.

[0120] Specifically, the viewing control corresponds to the original characters one by one. When the user clicks the original characters with the mouse pointer, the command output is triggered. At this time, a comparison pop-up window is displayed. Part of the ancient character image, that is, a screenshot of the ancient character image, will be displayed on the comparison pop-up window. The screenshot will occupy part of the cluster proofreading page and still display high-definition characters, etc., so that the user can compare and find out whether there are any recognition errors or misclassified fonts.

[0121] SB3. Displaying a group of similar characters on the human-computer interaction interface, the group of similar characters includes a plurality of comparison models that rank at the top in similarity to the original character features or high-definition character models corresponding to the comparison models.

[0122] Specifically, when the mouse pointer hovers over an original character (the triggering method is different from SB1), multiple comparison models with the highest similarity to the original character are displayed. High-definition character models can also be displayed, and the number of rankings is pre-set by the user. If the high-definition character does not match the original character correctly, the similar characters option allows users to quickly find other comparison models.

[0123] SB4. A reselection control is displayed on the similar character, and the reselection control is used to call the high-definition character model corresponding to the similar character in response to a trigger instruction to replace the original high-definition character.

[0124] Specifically, when the user triggers it by clicking a similar character with the mouse pointer, the program will automatically adjust the corresponding relationship, replace the original high-definition character, and refresh the cluster proofreading page to re-display the new high-definition character and its corresponding original character.

[0125] During image-text proofreading, the image-text proofreading page displays a high-definition image of ancient Chinese characters, formed by typeset high-definition characters, alongside the ancient Chinese characters. The high-definition image can be considered a preliminary draft of the final output image, awaiting verification. If an article includes multiple ancient Chinese characters, a page-turning function will be added. Clicking the mouse cursor on the page-turning icon will allow users to flip through the high-definition image or ancient Chinese characters, facilitating comparison between the preliminary draft and the ancient Chinese characters. Any recognition or conversion issues can be corrected during the previous manual segmentation and clustering proofreading.

[0126] Difficult character proofreading displays and proofreads ancient characters that the program cannot recognize. Difficult characters generally represent ancient characters that are not included in the ancient character database, or recognition errors caused by incorrect range selection of the recognition box. Therefore, these difficult characters will be displayed on the corresponding difficult character proofreading page. The screening criteria are: the comparison model with the highest similarity of the character obtained in S600 is simultaneously determined to see whether the feature similarity between the comparison model and the character in the ancient character image is above a preset threshold. If the feature similarity does not exceed the preset threshold, it indicates a mismatch. Such characters will be synchronized to the difficult character group and displayed on the difficult character page when the user opens it.

[0127] The page also features a file upload control for each difficult character. This control responds to user triggers, such as when a user clicks the file upload control with their mouse pointer. A file browser is displayed, accessing a local resource manager or internet connection. The user's specified high-definition character data is then uploaded or downloaded into the program and bound to the current character, becoming the current character (i.e., the high-definition version of the difficult character). The ancient character and its high-definition counterpart are also synchronously entered into the ancient character database, serving as a comparison model and high-definition character model for the next recognition step, respectively.

[0128] S700: Execute layout adjustment and output a high-definition image with high-definition characters.

[0129] Specifically, layout adjustments primarily involve adjusting the writing column and character size, ensuring the final HD character output is of appropriate size, well-balanced, and enhances the article's visual appeal. Layout adjustments can be made similarly to how you would in a Word document. The writing column is a draggable layer, and character size is quantized, adjustable by entering numbers or stretching diagonally. HD images can also be saved in formats like PDF and JPG, and batch-printed into volumes for easier viewing.

[0130] The implementation principle of Example 1 is as follows: first, an ancient character image is input, and character parameters are determined based on the image to obtain a recognition frame of the character for easy recognition; then, based on the shape characteristics of the character, a high-definition character model of a similar font is searched in a preset ancient character database to determine the ancient character font style of the entire text and narrow the search range; finally, the corresponding high-definition character model is found within the determined search range and a high-definition character is generated; through a proofreading operation, the misrecognized characters are screened out and readjusted, and finally a high-definition image converted into a high-definition character is obtained, which reduces the difficulty of ancient character recognition and facilitates readers to read, copy and learn ancient characters.

[0131] Example 2:

[0132] Reference Figure 5A text clarity conversion system based on OCR technology includes a character parameter generation module, a recognition area determination module, a font determination module, a high-definition character generation module, a proofreading module, a feature recognition module and a high-definition image output module.

[0133] The character parameter generation module is used to obtain ancient character images and generate character parameters based on the ancient character images. It specifically includes an image loading submodule, a differentiation submodule, a graphics generation submodule and a size calculation submodule.

[0134] The image loading submodule is used to load ancient text images.

[0135] The distinguishing submodule is used to perform image binarization processing on the ancient text image, generate a binary image, and distinguish the character area and the gap area based on the binary image.

[0136] The graphics generation submodule is used to filter out closed ring graphics formed in the gap area.

[0137] The size calculation submodule is used to calculate and generate character parameters based on the sizes of all closed ring graphics.

[0138] The recognition area determination module is used to determine the recognition area of ​​each character based on the character parameters, which specifically includes a frame selection submodule and a range selection submodule.

[0139] The frame selection submodule is used to generate a closed circular recognition frame based on the closed circular figure and preset constraints, and form a recognition area of ​​the corresponding character within the recognition frame.

[0140] The range selection submodule is used to calculate the sizes of all closed circular graphics when the program automatically scans the ancient text image to generate closed circular graphics, and then screen out the size range of the closed circular graphics with the largest proportion and the most concentrated part as the preset range of the recognition frame. The character area surrounded by the closed circular graphics with a size smaller than the lower limit of the range can be ignored as a reference, or merged into the adjacent recognition frame for unified recognition. The character area with a size larger than the upper limit of the range can be manually recognized and entered separately.

[0141] The feature recognition module is used to identify each recognition area and generate shape features corresponding to each character.

[0142] The font determination module is used to identify each recognition area, generate shape features corresponding to each character, and compare the shape features of the characters with a preset ancient character database to determine the ancient character font style.

[0143] A high-definition character generation module is used to identify the shape features of characters based on the ancient Chinese font style and the ancient Chinese database, find the corresponding high-definition character model, and generate high-definition characters based on the high-definition character model;

[0144] The proofreading module is used to perform proofreading operations and adjust high-definition characters according to the proofreading results, including a manual segmentation submodule, a clustering proofreading submodule, a graphic proofreading submodule and a difficult character proofreading submodule.

[0145] The manual segmentation submodule is used to display a manual segmentation page on the human-computer interaction interface. The manual segmentation page displays an ancient character image and an identification box. The characters are located in the identification box, and a zoom control is displayed on the identification box. The zoom control is used to adjust the size of the identification box in response to a trigger instruction and redefine the identification area based on the trigger instruction.

[0146] The clustering and proofreading submodule is used to obtain the original characters and their corresponding high-definition characters in the ancient text image and display them on a human-computer interaction interface to form a clustering and proofreading page. Viewing controls are also displayed on the human-computer interaction interface, with each viewing control corresponding to an original character. The viewing controls are used to display a comparison pop-up window in response to a trigger instruction. The comparison pop-up window displays a portion of the ancient text image containing the original character. A group of similar characters is also displayed on the human-computer interaction interface. This group of similar characters includes multiple comparison models that rank highly in feature similarity to the original character, or high-definition character models corresponding to the comparison models.

[0147] The image and text proofreading submodule is used to display and proofread ancient characters that cannot be recognized by the program, and to display difficult characters whose feature similarity between the comparison model and the characters in the ancient character image is lower than a preset threshold on the difficult character proofreading page.

[0148] The difficult character proofreading submodule is used to target ancient Chinese characters that the program cannot recognize, and displays on the difficult character proofreading page those difficult characters whose feature similarity between the comparison model and the characters in the ancient Chinese image is lower than a preset threshold to facilitate proofreading.

[0149] The high-definition image output module is used to output high-definition images displaying high-definition characters.

[0150] The implementation principle of Example 2 is as follows: the character parameter generation module is used to first determine the character parameters, and the recognition area determination module is used to obtain the recognition area of ​​the character to facilitate recognition; then the font determination module is used to search for high-definition character models of similar fonts in a preset ancient character database based on the shape characteristics of the character, determine the ancient character font style of the entire text, and narrow the search range; finally, the high-definition character generation module is used to find the corresponding high-definition character model within the determined search range and generate high-definition characters; the proofreading module is used to filter out the characters that are recognized incorrectly and readjust them, and finally the high-definition image output module is used to obtain high-definition images converted into high-definition characters, thereby reducing the difficulty of recognizing ancient characters and making it easier for readers to read, copy and learn ancient characters.

[0151] Example 3:

[0152] This embodiment further provides an intelligent terminal comprising a memory and a processor. The processor may be a central processing unit such as a CPU or MPU, or a host system built around a CPU or MPU. The memory may be a storage device such as RAM, ROM, EPROM, EEPROM, FLASH, a magnetic disk, or an optical disk. The memory stores a computer program capable of being loaded by the processor and executing the above-described text clarity conversion method based on OCR technology.

[0153] Example 4:

[0154] This embodiment also provides a computer-readable storage medium, which can be a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code. The computer-readable storage medium stores a computer program capable of being loaded by a processor and executing the above-described text clarity conversion method based on OCR technology.

[0155] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.

Claims

1. A method for converting text clarity based on OCR technology, characterized by: include: Obtain ancient text images; Generate character parameters based on ancient character images; Determine the recognition area of ​​each character based on the character parameters; Identify each recognition area and generate shape features corresponding to each character; Compare the shape features of the characters with the preset ancient character database to determine the ancient character font style; Recognize the shape features of characters based on their ancient Chinese font style and ancient Chinese character database, search for corresponding high-definition character models, and generate high-definition characters based on the high-definition character models; Arrange all high-definition characters according to the original character arrangement order; Perform proofreading and adjust high-definition characters according to the proofreading results; Output high-definition images with high-definition characters. The character parameters include character size and character line spacing; The method for generating the character parameters includes: Acquire and perform image binarization processing on the ancient character image to generate a binary image; Distinguish the character area and the gap area based on the binary image; Screen out the closed ring graphics formed in the gap area; Calculate and generate character parameters based on the sizes of all closed ring graphics. After the step of determining the recognition area of ​​each character according to the character parameters, the method further includes: Acquire the closed loop graph; Based on the closed loop figure and preset constraints, a closed loop recognition frame is generated, and a recognition area corresponding to the character is formed within the recognition frame. The preset constraints can be selected as high-precision recognition and high-speed recognition. When the preset constraint is high-precision recognition, the recognition frame includes the outer contour of the closed loop figure, or includes adjacent closed loop figures, that is, increasing the range of recognized samples and reducing the missed parts. When the preset constraint is high-speed recognition, the recognition frame includes the inner contour of the closed loop figure, reducing the area of ​​the recognition area and the number of pixels. The size of the recognition frame is preset. After manually checking the ancient character image, the character size is determined and then the preset recognition frame value range is entered; Alternatively, when the program automatically scans the ancient character image to generate closed circular graphics, after calculating the sizes of all closed circular graphics, the size range of the closed circular graphics with the largest proportion and the most concentrated portion is screened out as the preset range of the recognition frame. The character area surrounded by the closed circular graphics with a size smaller than the lower limit of the range can be ignored as a reference, or merged into the adjacent recognition frame for unified recognition. The character area with a size larger than the upper limit of the range can be manually recognized and entered separately. After determining the recognition area, each recognition area is identified and the shape features corresponding to each character are generated; Displaying a zoom control on the identification frame, the zoom control being used to adjust the size of the identification frame in response to a trigger instruction; Based on the trigger instruction, the recognition area is re-determined.

2. The text clarity conversion method based on OCR technology according to claim 1, characterized in that: The preset ancient character database includes multiple groups of ancient character model groups, each group of ancient character model groups corresponds to at least one ancient character font style, and the ancient character model group includes multiple high-definition character models and multiple comparison models corresponding to the high-definition character models; The step of comparing the shape features of the characters with a preset ancient character database to determine the ancient character font style includes: Compare the shape features of the characters with the comparison models within all the ancient character model groups; Find the comparison model with the highest feature similarity; The ancient Chinese font style of the character is determined based on the comparison model.

3. The text clarity conversion method based on OCR technology according to claim 2, characterized in that: The steps of identifying the shape features of characters based on the ancient Chinese character font style and the ancient Chinese character database, searching for corresponding high-definition character models, and generating high-definition characters based on the high-definition character models include: Obtaining the comparison results of the shape features of the characters and the comparison models in all ancient character model groups; According to the above comparison results, find the comparison model with the highest feature similarity; Retrieving the high-definition character model corresponding to the comparison model; High-definition characters are generated according to the high-definition character model.

4. The text clarity conversion method based on OCR technology according to claim 3, characterized in that: The proofreading operation includes: Obtain the original characters and their corresponding high-definition characters in the ancient text image, and display them both on the human-computer interaction interface; Displaying a group of similar characters on the human-computer interaction interface, the group of similar characters including a plurality of comparison models that rank highly similar to the original character features or high-definition character models corresponding to the comparison models; A reselection control is displayed on the similar character, and the reselection control is used to call the high-definition character model corresponding to the similar character in response to a trigger instruction to replace the original high-definition character.

5. The text clarity conversion method based on OCR technology according to claim 4, characterized in that: After the step of obtaining the original characters in the ancient text image and the corresponding high-definition characters and displaying them on the human-computer interaction interface, the method further includes: View controls are displayed on the human-computer interaction interface, each view control corresponds to an original character, and the view controls are used to display a comparison pop-up window in response to a trigger instruction, wherein the comparison pop-up window displays a partial ancient character image, and the partial ancient character image includes the original character.

6. A text clarity conversion system based on OCR technology, characterized in that: include, A character parameter generation module is used to obtain an ancient character image and generate character parameters based on the ancient character image. The character parameters include character size and character line spacing. The module specifically includes an image loading submodule, a differentiation submodule, a graphic generation submodule, and a size calculation submodule. The image loading submodule is used to load ancient text images; The distinguishing submodule is used to perform image binarization processing on the ancient character image to generate a binary image, and distinguish the character area and the gap area based on the binary image; The graphics generation submodule is used to filter out closed ring graphics formed in the gap area; The size calculation submodule is used to calculate and generate character parameters based on the sizes of all closed ring graphics; A recognition area determination module is used to determine the recognition area of ​​each character based on the character parameters, which specifically includes a frame selection submodule and a range selection submodule; The frame selection submodule is used to generate a closed ring recognition frame based on the closed ring figure and preset constraints. The recognition area of ​​the corresponding character is formed within the recognition frame. The preset constraints can be selected as high-precision recognition and high-speed recognition. When the preset constraint is high-precision recognition, the recognition frame includes the outer contour of the closed ring figure, or includes adjacent closed ring figures, that is, increasing the range of recognized samples and reducing the missed parts. When the preset constraint is high-speed recognition, the recognition frame includes the inner contour of the closed ring figure, reducing the area and number of pixels of the recognition area. The range selection submodule is used to preset the size of the recognition frame. By manually viewing the ancient character image, the character size is determined and then the preset recognition frame value range is entered; or when the program automatically scans the ancient character image to generate closed ring graphics, after calculating the sizes of all closed ring graphics, the size range of the closed ring graphics with the largest and most concentrated proportion is screened out as the preset range of the recognition frame. The character area surrounded by the closed ring graphics with a size smaller than the lower limit of the range can be ignored as a reference or merged into the adjacent recognition frame for unified recognition. The character area with a size larger than the upper limit of the range can be manually recognized and entered separately; A feature recognition module is used to identify each recognition area and generate shape features corresponding to each character; The font determination module is used to identify each recognition area, generate shape features corresponding to each character, and compare the shape features of the characters with a preset ancient character database to determine the ancient character font style; A high-definition character generation module is used to identify the shape features of characters based on the ancient Chinese font style and the ancient Chinese database, find the corresponding high-definition character model, and generate high-definition characters based on the high-definition character model; A proofreading module, used for performing a proofreading operation and adjusting the high-definition characters according to the proofreading result; The high-definition image output module is used to arrange all high-definition characters according to the original character arrangement sequence and output a high-definition image showing the high-definition characters.

7. An intelligent terminal, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the text clarity conversion method based on OCR technology as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The device stores a computer program that can be loaded by a processor and execute the text clarity conversion method based on OCR technology as claimed in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Visual communication image sharpening processing method and system

    CN110544222A