Ancient book number processing method and device

Through different size segmentation and clustering processing, combined with RNN and convolution operations, the problems of mathematical symbol recognition and stain distinction in ancient books are solved, and the accurate recognition of mathematical symbols in ancient books is achieved.

CN119152508AActive Publication Date: 2024-12-17INNER MONGOLIA NORMAL UNIVERSITY
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410949731.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-12-17
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

The existing mathematical symbol recognition methods cannot recognize ancient mathematical symbols in ancient books, and the difficulty of identification increases due to the influence of defilement.

Method used

The ancient book images are segmented using different sizes, and the background is removed through correlation recognition results and clustering processing, and the ancient book numbers and symbols are identified using RNN neural network and convolution operations.

Benefits of technology

It realizes accurate identification of mathematical symbols in ancient books and stain distinction, and improves the recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152508A_ABST
    Figure CN119152508A_ABST
Patent Text Reader

Abstract

The invention discloses an ancient book number processing method and device. The method comprises the following steps: segmenting a first image based on a first size, and determining a first identification result; segmenting the first image based on the second size, and determining a second recognition result; determining an association set of the first identification result and the second identification result; obtaining a second image from which the association set is removed; obtaining spatial distribution of a plurality of pixels in the second image based on the pixels in the second image; the pixel space distribution is clustered, classification of the pixel space distribution is obtained, and the number of clusters is not smaller than the number of mathematical symbols involved in the image; and obtaining an identification result corresponding to the pixel space distribution and a background region which cannot be identified based on a clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and device for processing ancient book numbers. Background Art

[0002] China is an ancient country with a long history and a vast collection of ancient books and documents. These ancient books and documents are the precious spiritual wealth of the Chinese nation, an important source of our history and culture, an important way for the dissemination of Chinese knowledge, and an important part of Chinese culture. Ancient books are the treasures of Chinese civilization and the precious spiritual wealth of the Chinese nation.

[0003] Ancient books on mathematics contain a large number of ancient mathematical symbols. Existing mathematical symbol recognition methods can usually only recognize modern mathematical symbols. Since these ancient mathematical symbols are different from modern mathematical symbols, they cannot be recognized by existing mathematical symbol recognition methods. In addition, due to the influence of the preservation environment, there may be stains on the ancient books, which further increases the difficulty of recognition. Summary of the invention

[0004] At least one aspect or advantage of the invention will be set forth in part in the following description, or may be obvious from the description, or may be learned by practice of the disclosed subject matter.

[0005] According to a first aspect of the present invention, a method for processing ancient book numbers comprises:

[0006] Segmenting the first image based on a first size, and determining a first recognition result based on the first size segmentation data;

[0007] Segmenting the first image based on a second size, and determining a second recognition result based on the second size segmentation data;

[0008] Determine an association set of the first recognition result and the second recognition result based on the association between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result;

[0009] Processing the first image based on the association set to obtain a second image after removing the association set, wherein an image in the second image that is similar to the association set is marked as background;

[0010] Based on the pixels in the second image, a plurality of pixel spatial distributions in the second image are obtained, wherein the pixel spatial distribution includes a continuous extension size of the pixel point in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that a distance between the two is less than a first threshold;

[0011] Clustering the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of mathematical symbols involved in the image;

[0012] Based on the clustering results, the recognition results corresponding to the pixel spatial distribution and the unrecognizable background areas are obtained.

[0013] According to an embodiment of the present invention, the pixel windows corresponding to the first size and the second size are determined in the following manner:

[0014] Binarize the image, select a scanning window with the same size in the length direction and the width direction, and determine the pixel distribution according to the scanning window, wherein the pixel distribution includes the effective pixel ratio in the pixel window, the maximum spacing of the effective pixels in the length direction, and the maximum spacing of the effective pixels in the width direction;

[0015] The score of the scanning window is determined according to the pixel distribution, and the score of the scanning window is smoothed to obtain a number of peak areas of continuous distribution;

[0016] The widths of the first size and the second size are determined based on the size of the scanning window corresponding to the highest score of each peak area.

[0017] According to an embodiment of the present invention, the correlation between the first recognition result and the second recognition result is the spatial proximity relationship between the characters in the first recognition result and the digital symbols in the second recognition result;

[0018] When the spatial distance between the character corresponding to the first recognition result and the symbol corresponding to the second recognition result is lower than a preset value, the character corresponding to the first recognition result and the symbol corresponding to the second recognition result are associated.

[0019] According to an embodiment of the present invention, the spatial distribution of a plurality of pixels is obtained in the following manner: all valid pixels in the second image are obtained, the number of valid pixels within a k-pixel distance of each pixel is calculated, and the pixel points whose number of valid pixels within a k-pixel distance is greater than h are added to the first pixel point set;

[0020] The first pixel point set is traversed, and the first pixel point set is divided into a plurality of sets according to whether the distance between two pixel points in the first pixel point set is less than a first threshold, so as to obtain the pixel space distribution.

[0021] According to an embodiment of the present invention, the clustering method is a k-medoids method.

[0022] According to an embodiment of the present invention, obtaining the recognition result corresponding to the pixel spatial distribution and the unrecognizable background area based on the clustering result includes:

[0023] Reconstruct the pixels based on the clusters of the clustering results to obtain several reconstructed images;

[0024] Based on the similarity between the reconstructed image and the recognized mathematical symbol, it is determined that the reconstructed image is a mathematical symbol or a background.

[0025] According to one embodiment of the present invention, the method for obtaining the similarity includes:

[0026] Convolve the reconstructed image to obtain the feature vector of the reconstructed image;

[0027] The approximation between the feature vector of the reconstructed image and the feature vector of the mathematical symbol is obtained based on the cosine algorithm, wherein the feature vector of the mathematical symbol is obtained based on convolution.

[0028] According to one embodiment of the present invention, the size of the convolution kernel is not less than 5*5 and not more than 12*12.

[0029] According to one embodiment of the present invention, a RNN neural network is used to identify the first-size segmented data and the second-size segmented data.

[0030] According to a second aspect of the present invention, a method for processing ancient books digitally comprises:

[0031] A first recognition result acquisition unit is configured to segment the first image based on a first size and determine a first recognition result based on the first size segmentation data;

[0032] A second recognition result acquisition unit is configured to separate the first image based on a second size and determine a second recognition result based on the second size separation data;

[0033] A second image acquisition unit is configured to determine an association set of the first recognition result and the second recognition result based on the association between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result; and to process the first image based on the association set to obtain a second image after removing the association set, wherein an image in the second image that is similar to the association set is marked as a background;

[0034] The second image recognition unit obtains a plurality of pixel spatial distributions in the second image based on the pixels in the second image, wherein the spatial distribution includes continuous extension sizes of the pixel points in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that the distance between the two is lower than a first threshold value; clusters the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of mathematical symbols involved in the image; and obtains a recognition result corresponding to the pixel spatial distribution and an unrecognizable background area based on the clustering result. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Flow chart of the method for processing ancient book numbers in an embodiment of the present invention.

[0036] Figure 2 Schematic diagram of a device for processing ancient book numbers in an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The present disclosure will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and thus implement the present disclosure, rather than implying any limitation on the scope of the present disclosure.

[0038] According to one embodiment of the present invention, a method for processing ancient book numbers is disclosed, including steps 1100-1700.

[0039] Step 1100: segment a first image based on a first size, and determine a first recognition result based on the first size segmentation data.

[0040] The first image is an image of an ancient book, which refers to a book from a long time ago. The image of the ancient book contains text and digital symbols, wherein the digital symbols include ancient book numbers and ancient book symbols. The first image can be obtained by photographing the ancient book with a camera.

[0041] The first size segmentation data is an image obtained by segmenting the first image according to the first size, and the first size corresponds to the text in the first image. The first recognition result is obtained by recognizing the first size segmentation data, and the first recognition result includes the text in the ancient book image. For example, the first size segmentation data can be recognized by a pre-trained neural network to obtain the first recognition result. The first size is the size corresponding to the text in the ancient book image.

[0042] Step 1200: segment the first image based on a second size, and determine a second recognition result based on the second size segmentation data.

[0043] The second size segmentation data is an image obtained by segmenting the first image according to the second size, and the second size corresponds to the digital symbol in the first image. The second recognition result is obtained by recognizing the second size segmentation data. The second recognition result includes the digital symbol in the ancient book image. The second size is the size corresponding to the digital symbol in the ancient book image.

[0044] Step 1300: Determine an association set of the first recognition result and the second recognition result based on the association between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result.

[0045] The correlation between the first recognition result and the second recognition result is the spatial proximity between the characters in the first recognition result and the digital symbols in the second recognition result. When the spatial distance between the characters corresponding to the first recognition result and the digital symbols corresponding to the second recognition result is less than a preset value, the characters corresponding to the first recognition result and the digital symbols corresponding to the second recognition result are associated.

[0046] The characters in the first recognition result are ancient book characters, and the digital symbols in the second recognition result include ancient book numbers and ancient book symbols. The first recognition result includes multiple characters, and the second recognition result includes multiple digital symbols. The correlation between the characters in the first recognition result and the digital symbols in the second recognition result can be determined based on the distance between the characters in the first recognition result and the digital symbols in the second recognition result.

[0047] If the distance between the character in the first recognition result and the digital symbol in the second recognition result is lower than the preset value, it means that the character and the digital symbol are close in the ancient book and have semantic relevance, so the character is considered to be associated with the digital symbol. The distance between the character in the first recognition result and the digital symbol in the second recognition result can be a pixel distance, such as 20 pixels. The preset value can be determined according to the image size, the size of the text and the size of the digital symbol, for example, the preset value can be 30 pixels.

[0048] The association set includes the characters associated with the ancient book numbers or symbols.

[0049] Step 1400: Process the first image based on the association set to obtain a second image after removing the association set, wherein the image in the second image that is similar to the association set is marked as background.

[0050] The ancient book image contains text and digital symbols. The text can be divided into text associated with digital symbols and text not associated with digital symbols. The text in the association set is text associated with digital symbols. The association set is text, and the image similar to the association set is also text. The image in the second image that is similar to the association set is the text not associated with the digital symbol in the second image.

[0051] The image obtained by removing the association set from the first image contains the digital symbol and the text not associated with the digital symbol. Then the image similar to the association set is marked as the background, that is, the text not associated with the digital symbol is marked as the background, and the area other than the background in the second image represents the digital symbol.

[0052] Step 1500: Based on the pixels in the second image, a plurality of pixel spatial distributions in the second image are obtained, wherein the pixel spatial distribution includes continuous extension dimensions of the pixel points in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that the distance between the two is lower than a first threshold.

[0053] Step 1600: clustering the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of digital symbols involved in the image.

[0054] If the number of clusters is lower than the number of digital symbols involved in the image, the pixels corresponding to different digital symbols will be classified into the same cluster, which greatly reduces the accuracy of the clustering results. In order to ensure the accuracy of the clustering results, the number of clusters should not be lower than the number of digital symbols involved in the image.

[0055] In addition, due to the influence of the environment, there may be some stains on the ancient book. In this case, the area of ​​the second image other than the background contains not only the digital symbol but also the stain area. By increasing the number of clusters, the pixels corresponding to the stain area and the pixels corresponding to the digital symbol are divided into different clusters. After clustering, each cluster corresponds to a digital symbol or a stain area.

[0056] Step 1700: Obtain recognition results corresponding to the pixel spatial distribution and unrecognizable background areas based on the clustering results.

[0057] According to one embodiment of the present invention, step 1700 includes: reconstructing the image of pixels based on the clusters of the clustering results to obtain a number of reconstructed images; and determining whether the reconstructed image is a mathematical symbol or a background based on the similarity between the reconstructed image and the recognized mathematical symbol.

[0058] After obtaining the reconstructed image, the approximation between the reconstructed image and the recognized mathematical symbol is calculated. If the approximation is high, the reconstructed image is considered to be a mathematical symbol. If the approximation is low, the reconstructed image is considered to be a background. A similarity threshold can be set in advance. If the approximation between the reconstructed image and the recognized mathematical symbol is greater than the similarity threshold, the reconstructed image is considered to be a mathematical symbol. If the approximation between the reconstructed image and the recognized mathematical symbol is less than the similarity threshold, the reconstructed image is considered to be a background.

[0059] The present invention divides the ancient book image into different sizes to obtain the first recognition result corresponding to the text and the second recognition result corresponding to the digital symbol, and then distinguishes the text corresponding to the ordinary text and the mathematical symbol according to the correlation between the first recognition result and the second recognition result, so that the remaining mathematical symbols and the background area of ​​the ancient book image are screened out. The pixel points are clustered to obtain the pixel points corresponding to each symbol and the pixel points corresponding to the stain area, and finally the mathematical symbols and the stain area in the ancient book image are accurately identified.

[0060] According to an embodiment of the present invention, the pixel windows corresponding to the first size and the second size are determined in the following manner.

[0061] Step 2100: Binarize the image, select a scanning window with the same size in the length direction and the width direction, and determine the pixel distribution based on the scanning window, wherein the pixel distribution includes the proportion of valid pixels in the pixel window, the maximum spacing of valid pixels in the length direction, and the maximum spacing of valid pixels in the width direction.

[0062] After binarization of the image, a binary image is obtained, which contains only black pixels and white pixels. In the binarization process, if the pixel value of a pixel exceeds the threshold, the pixel value of the pixel is set to 255, otherwise the pixel value of the pixel is set to 0. For example, the image of ancient books includes paper and text and digital symbols written on the paper, where the color of the paper is yellow and the text and digital symbols written on the paper are black. After binarization, the black pixels in the binary image represent text and digital symbols, and the black pixels are valid pixels. In some cases, such as when the original text of the ancient book is damaged, the three color weighted values ​​of RGB should be considered to determine whether a pixel is a valid pixel.

[0063] The binary image is scanned through a scanning window, and the pixel window contains valid pixels and invalid pixels. The effective pixel ratio is the ratio of the number of valid pixels in the pixel window to the total number of pixels in the pixel window. For example, for a 20*20 scanning window, the total number of pixels obtained after scanning the binary image is 400, of which 20 pixels are valid pixels, then the effective pixel ratio is 5%.

[0064] The maximum spacing of valid pixels in the length direction is the difference between the maximum value of the valid pixel coordinates in the length direction and the minimum value of the valid pixel coordinates in the length direction. For example, for a 20*20 scanning window, the first pixel in the first row is a valid pixel, the 19th pixel in the first row is a valid pixel, and the remaining valid pixels in the length direction are between the above two valid pixels. Then, the maximum value of the valid pixel coordinates in the length direction is 19, the minimum value of the valid pixel coordinates in the length direction is 1, and the maximum spacing of the valid pixels is 18.

[0065] The maximum spacing of valid pixels in the width direction is the difference between the maximum value of the coordinates of the valid pixels in the width direction and the minimum value of the coordinates of the valid pixels in the width direction. For example, for a 20*20 scanning window, the 3rd pixel in the first column is a valid pixel, the 15th pixel in the first column is a valid pixel, and the remaining valid pixels in the width direction are between the above two valid pixels. Then, the maximum value of the coordinates of the valid pixels in the width direction is 15, the minimum value of the coordinates of the valid pixels in the width direction is 3, and the maximum spacing of the valid pixels in the width direction is 12.

[0066] You can select multiple scanning windows of different sizes for scanning. In order to adapt to scanning windows of different sizes, you can normalize the maximum spacing of effective pixels in the length direction and the maximum spacing of effective pixels in the width direction. For example, for a 20*20 scanning window, the maximum spacing of effective pixels in the length direction is 18, and the maximum spacing of effective pixels in the width direction is 12. After normalization, the maximum spacing of effective pixels in the length direction is 18 / 20=0.9, and the maximum spacing of effective pixels in the width direction is 12 / 20=0.6.

[0067] Step 2200: Determine the score of the scanning window according to the pixel distribution, and smooth the score of the scanning window to obtain a plurality of peak areas of continuous distribution.

[0068] The score calculation formula of the scanning window is: V=R*10+DL / 3+DW / 3.

[0069] Among them, V is the score of the scanning window, R is the effective pixel ratio, DL is the maximum spacing of effective pixels in the length direction, and DW is the maximum spacing of effective pixels in the width direction.

[0070] Step 2300: Determine the width of the first size and the width of the second size based on the size of the scanning window corresponding to the highest score of each peak area.

[0071] When scanning a binary image, multiple scanning windows of different sizes are selected for scanning. After each scan, the score corresponding to each size of the scanning window is calculated. The score calculated in this way has a tendency to increase along the length direction and gradually decrease. There are two peaks, corresponding to the size of the digital symbol and the size of the ancient book text.

[0072] In order to avoid the identification errors of multiple consecutive peaks during the identification process, the peak graph is processed. For a window size of m, the specific pseudo code is as follows.

[0073] (1) Set i to 0.

[0074] (2) Check whether the value of i is greater than m-10. If so, exit the loop.

[0075] (3) If not, obtain all values ​​from i to i+10, that is, the scores of all sliding windows with window sizes from i to i+10. For example, if the window size m is 30 and the value of i is 5, then all values ​​from i to i+10 are the scores of all sliding windows with window sizes from 5 to 15.

[0076] (4) Obtain the first index value and the second index value corresponding to the maximum value and the minimum value respectively from i to i+10. The first index value is the window size corresponding to the sliding window with the highest score among all sliding windows with window sizes from i to i+10, and the second index value is the window size corresponding to the sliding window with the lowest score.

[0077] (5) Obtain a maximum index value and a minimum index value other than the first index value, and whose value range is from i to i+10, and assign them to values ​​corresponding to the second index value, and use a linear fitting method to assign values ​​between the maximum index value and the first index value, and between the minimum index value and the first index value, wherein the maximum index value is greater than the first index value, and the minimum index value is less than the first index value.

[0078] For example, if i is 5 and the first index value is 8, then the maximum index value is 15 and the minimum index value is 5. The minimum index value 5 to the first index value 8 is assigned by linear fitting, and the peak area between the minimum index value 5 and the first index value 8 is eliminated. The maximum index value 15 to the first index value 8 is also assigned by linear fitting, and the peak area between the maximum index value 15 and the first index value 8 is eliminated.

[0079] (6) Set the value of i to i+1.

[0080] In this way, irrelevant peaks can be eliminated, and windows with the same size as the symbol and the same size as the Chinese character can be screened out.

[0081] According to one embodiment of the present invention, a plurality of pixel spatial distributions are obtained in the following manner: all valid pixel points in the second image are obtained, the number of valid pixel points within a distance of k pixels of each pixel point is calculated, and the pixel points whose number of valid pixel points within a distance of k pixels is greater than h are added to the first pixel point set; the first pixel point set is traversed, and the first pixel point set is divided into a plurality of sets according to whether the distance between two pixel points in the first pixel point set is less than a first threshold value, to obtain the pixel spatial distribution.

[0082] The second image includes the background and the area other than the background. The valid pixels in the second image are the pixels in the area other than the background in the second image, including the pixels corresponding to the digital symbols and the pixels corresponding to the stain area. A digital symbol corresponds to multiple pixels in the image, and the distances between these multiple pixels are relatively close. There may also be small stain areas in the ancient book image, and compared with the digital symbols, the number of pixels in these small stain areas is less.

[0083] For a pixel, if the number of valid pixels within the k-pixel distance is less than h, it means that the number of valid pixels around the pixel is small, and the pixel is considered to be a pixel of a small stain area. If the number of valid pixels within the k-pixel distance is greater than h, it means that the number of valid pixels around the pixel is large, and the pixel may be a pixel of a digital symbol or a pixel of a large stain area.

[0084] The pixels in the first pixel set include the pixels of the digital symbol and the pixels of the large stain area. On this basis, the first pixel set is divided into several sets according to the distance between two pixels in the first pixel set. If the distance between two pixels is greater than the first threshold, it means that the distance between the two pixels is far and they are not the pixels of the same digital symbol. If the distance between the two pixels is less than the first threshold, it means that the distance between the two pixels is close and they may be the pixels of the same digital symbol or the pixels of two adjacent digital symbols. In this case, they need to be further distinguished by clustering.

[0085] According to an embodiment of the present invention, the clustering method is a k-medoids method.

[0086] Due to the small number of data sets and the damage of some contents, there is overfitting when using machine classification methods to analyze images that cannot be processed. Therefore, the similarity between images is analyzed by clustering methods. Due to the limitations of ancient book versions, there are irregularities in the glyphs, and the kmeans clustering method is not effective. However, when trying the k-medoids method, it is found that it has a better classification effect on images with incomplete pixels.

[0087] According to one embodiment of the present invention, the method for obtaining the approximation includes: performing convolution on the reconstructed image to obtain a feature vector of the reconstructed image; obtaining the approximation between the feature vector of the reconstructed image and the feature vector of the mathematical symbol based on the cosine algorithm, wherein the feature vector of the mathematical symbol is obtained based on convolution.

[0088] Convolution operations are performed on the reconstructed image and the recognized digital symbol respectively to obtain the feature vector of the reconstructed image and the feature vector of the digital symbol. Then, the approximation between the feature vector of the reconstructed image and the feature vector of the digital symbol is calculated according to the cosine algorithm, and the approximation between the feature vector of the reconstructed image and the feature vector of the digital symbol is used as the approximation between the reconstructed image and the recognized mathematical symbol. Specifically, the cosine value of the angle between the feature vector of the reconstructed image and the feature vector of the digital symbol is calculated. The closer the cosine value is to 1, the higher the approximation between the two feature vectors is.

[0089] According to one embodiment of the present invention, the size of the convolution kernel of the convolution operation is not less than 5*5 and not more than 12*12.

[0090] According to an embodiment of the present invention, a RNN (Recurrent Neural Network) neural network is used to identify the first size segmented data and the second size segmented data.

[0091] like Figure 2 As shown, according to one embodiment of the present invention, a device for processing ancient book numbers is disclosed, including a first recognition result acquisition unit, a second recognition result acquisition unit, a second image acquisition unit, and a second image recognition unit.

[0092] The first recognition result acquisition unit segments the first image based on a first size, and determines a first recognition result based on the first size segmentation data.

[0093] The second recognition result acquisition unit separates the first image based on the second size and determines the second recognition result based on the second size separation data.

[0094] The second image acquisition unit determines an association set of the first recognition result and the second recognition result based on the correlation between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result; processes the first image based on the association set to obtain a second image after removing the association set, wherein images in the second image that are similar to the association set are marked as background.

[0095] The second image recognition unit obtains a plurality of pixel spatial distributions in the second image based on the pixels in the second image, wherein the spatial distribution includes continuous extension sizes of the pixel points in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that the distance between the two is lower than a first threshold value; clusters the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of mathematical symbols involved in the image; and obtains a recognition result corresponding to the pixel spatial distribution and an unrecognizable background area based on the clustering result.

[0096] Those of ordinary skill in the art will appreciate that the modules and algorithm steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0097] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and equipment can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0098] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0099] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0100] In addition, each functional module in the embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0101] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the energy-saving signal sending / receiving method of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.

[0102] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.

[0103] It should be understood that the size of the sequence number of each step in the content of the invention and the embodiments of the present invention does not absolutely mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. For the purpose of example and description, the foregoing description of the implementation of the present disclosure has been given. The foregoing description is not exhaustive and is not intended to limit the present disclosure to the exact form disclosed. Various deformations and modifications may exist according to the above teachings, or various deformations and modifications may be obtained from the practice of the present disclosure. These embodiments are selected and described to illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can use the present disclosure in various embodiments and various modifications suitable for the specific purpose conceived.

Claims

1. A method for processing ancient book numbers, characterized in that: include: Segmenting the first image based on a first size, and determining a first recognition result based on the first size segmentation data; Segmenting the first image based on a second size, and determining a second recognition result based on the second size segmentation data; Determine an association set of the first recognition result and the second recognition result based on the association between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result; Processing the first image based on the association set to obtain a second image after removing the association set, wherein an image in the second image that is similar to the association set is marked as background; Based on the pixels in the second image, a plurality of pixel spatial distributions in the second image are obtained, wherein the pixel spatial distribution includes a continuous extension size of the pixel point in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that a distance between the two is less than a first threshold; Clustering the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of mathematical symbols involved in the image; Based on the clustering results, the recognition results corresponding to the pixel spatial distribution and the unrecognizable background areas are obtained.

2. The method for processing ancient book numbers according to claim 1, characterized in that: The pixel windows corresponding to the first size and the second size are determined in the following manner: Binarize the image, select a scanning window with the same size in the length direction and the width direction, and determine the pixel distribution according to the scanning window, wherein the pixel distribution includes the effective pixel ratio in the pixel window, the maximum spacing of the effective pixels in the length direction, and the maximum spacing of the effective pixels in the width direction; The score of the scanning window is determined according to the pixel distribution, and the score of the scanning window is smoothed to obtain a number of peak areas of continuous distribution; The widths of the first size and the second size are determined based on the size of the scanning window corresponding to the highest score of each peak area.

3. The method for processing ancient book numbers according to claim 1, characterized in that: The correlation between the first recognition result and the second recognition result is the spatial proximity relationship between the characters in the first recognition result and the digital symbols in the second recognition result; When the spatial distance between the character corresponding to the first recognition result and the numeric symbol corresponding to the second recognition result is lower than a preset value, the character corresponding to the first recognition result and the numeric symbol corresponding to the second recognition result are associated.

4. The method for processing ancient book numbers according to claim 1, characterized in that: The spatial distribution of a plurality of pixels is obtained in the following manner: all valid pixels in the second image are obtained, the number of valid pixels within a distance of k pixels from each pixel is calculated, and the pixel points whose number of valid pixels within a distance of k pixels is greater than h are added to the first pixel point set; The first pixel point set is traversed, and the first pixel point set is divided into a plurality of sets according to whether the distance between two pixel points in the first pixel point set is less than a first threshold, so as to obtain the pixel space distribution.

5. The method for processing ancient book numbers according to claim 1, characterized in that: The clustering method is the k-medoids method.

6. The method for processing ancient book numbers according to claim 1, characterized in that: The recognition result corresponding to the pixel spatial distribution and the unrecognizable background area obtained based on the clustering result includes: Reconstruct the pixels based on the clusters of the clustering results to obtain several reconstructed images; Based on the similarity between the reconstructed image and the recognized mathematical symbol, it is determined that the reconstructed image is a mathematical symbol or a background.

7. The method for processing ancient book numbers according to claim 6, characterized in that: The method for obtaining the approximation includes: Convolve the reconstructed image to obtain the feature vector of the reconstructed image; The approximation between the feature vector of the reconstructed image and the feature vector of the mathematical symbol is obtained based on the cosine algorithm, wherein the feature vector of the mathematical symbol is obtained based on convolution.

8. The method for processing ancient book numbers according to claim 7, characterized in that: The size of the convolution kernel of the convolution operation is not less than 5*5 and not more than 12*12.

9. The method for processing ancient book numbers according to claim 1, characterized in that: The RNN neural network is used to identify the first size segmented data and the second size segmented data.

10. A device for processing ancient book numbers, characterized in that: include: A first recognition result acquisition unit is configured to segment the first image based on a first size and determine a first recognition result based on the first size segmentation data; a second recognition result obtaining unit, which separates the first image based on a second size and determines a second recognition result based on the second size separation data; A second image acquisition unit determines an association set of the first recognition result and the second recognition result based on the association between the first recognition result and the second recognition result, wherein the association set includes the first recognition result associated with the ancient book numbers or ancient book symbols in the second recognition result; Processing the first image based on the association set to obtain a second image after removing the association set, wherein an image in the second image that is similar to the association set is marked as background; The second image recognition unit obtains a plurality of pixel spatial distributions in the second image based on the pixels in the second image, wherein the spatial distribution includes continuous extension sizes of the pixel points in a first direction and a second direction, and corresponding to any point in the pixel spatial distribution, there is at least one pixel point in the same pixel space such that the distance between the two is lower than a first threshold value; clusters the pixel spatial distribution to obtain a classification of the pixel spatial distribution, wherein the number of clusters is not less than the number of mathematical symbols involved in the image; and obtains a recognition result corresponding to the pixel spatial distribution and an unrecognizable background area based on the clustering result.

Citation Information

Patent Citations

  • Character recognition method and device for ancient books, computer equipment and storage medium

    CN113989484A

  • Ancient book mathematical symbol identification method based on pre-classification

    CN116343232A

  • Handwritten character recognition method and device, electronic equipment and computer program product

    CN116935022A

  • Ancient book recognition method and apparatus, storage medium, and device

    WO2023173949A1

  • AU2020103315A4