WO2021068364A1 - 笔画骨架信息提取方法、装置、电子设备及存储介质 - Google Patents

笔画骨架信息提取方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021068364A1
WO2021068364A1 PCT/CN2019/119898 CN2019119898W WO2021068364A1 WO 2021068364 A1 WO2021068364 A1 WO 2021068364A1 CN 2019119898 W CN2019119898 W CN 2019119898W WO 2021068364 A1 WO2021068364 A1 WO 2021068364A1
Authority
WO
WIPO (PCT)
Prior art keywords
skeleton
stroke
target
image
skeleton information
Prior art date
Application number
PCT/CN2019/119898
Other languages
English (en)
French (fr)
Inventor
蒋建斌
连宙辉
肖建国
张纯
宛慧军
唐英敏
Original Assignee
北京方正手迹数字技术有限公司
北京大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京方正手迹数字技术有限公司, 北京大学 filed Critical 北京方正手迹数字技术有限公司
Publication of WO2021068364A1 publication Critical patent/WO2021068364A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/24Character recognition characterised by the processing or recognition method
    • G06V30/242Division of the character sequences into groups prior to recognition; Selection of dictionaries
    • G06V30/244Division of the character sequences into groups prior to recognition; Selection of dictionaries using graphical properties, e.g. alphabet type or font
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Definitions

  • This application relates to the technical field of computer graphics, and in particular to a method, device, electronic device, and storage medium for extracting stroke skeleton information.
  • the glyphs are composed of strokes, which are the basic unit of text.
  • Stroke skeleton extraction is an important technical support in font-related fields.
  • the ability to accurately extract stroke skeleton information is of self-evident importance for promoting the development of related technologies in this field.
  • the extraction of stroke skeleton information has always been a technical problem in this field.
  • the extraction of stroke skeletons mostly relies on manual work, which requires more manpower and material resources, and the extraction efficiency and accuracy are low.
  • the present application provides a method, device, electronic device, and storage medium for extracting stroke skeleton information, so as to solve the technical problem of low efficiency and accuracy in extracting stroke skeleton information in the prior art.
  • this application provides a method for extracting stroke skeleton information, including:
  • Target image Acquiring a target image, where the target image includes a target text image
  • the target stroke skeleton information is determined according to the target text image and the reference stroke skeleton information.
  • the determining target stroke skeleton information according to the target text image and the reference stroke skeleton information includes:
  • the target stroke skeleton information is determined according to the third skeleton data and the reference stroke skeleton information.
  • the determining each single-stroke skeleton point set of the target text image according to the feature point set includes:
  • the key point subset includes the endpoint subset and the intersection subset
  • the feature point set includes the random Point subset
  • the target text image skeleton point set is matched with the reference stroke skeleton information to obtain each single-stroke skeleton point set of the target text image.
  • the determining the third skeleton data according to the second skeleton data and a preset processing algorithm includes:
  • the third skeleton data is determined according to all the skeleton segment data and a preset clustering algorithm.
  • the obtaining the target image includes:
  • the input image is preprocessed to determine the target image.
  • this application provides a device for extracting stroke skeleton information, including:
  • An acquisition module for acquiring a target image includes a target text image
  • the first processing module is configured to determine the reference text corresponding to the target text image according to the target image and a preset reference database;
  • a second processing module configured to determine reference stroke skeleton information according to the reference text and the preset reference database, the preset reference database including the mapping relationship between the reference text and the reference stroke skeleton information;
  • the third processing module is configured to determine target stroke skeleton information according to the target text image and the reference stroke skeleton information.
  • the third processing module is specifically used for:
  • the target stroke skeleton information is determined according to the third skeleton data and the reference stroke skeleton information.
  • the third processing module is specifically used for:
  • the key point subset includes the endpoint subset and the intersection subset
  • the feature point set includes the random Point subset
  • the target text image skeleton point set is matched with the reference stroke skeleton information to obtain each single-stroke skeleton point set of the target text image.
  • the third processing module is specifically used for:
  • the third skeleton data is determined according to all the skeleton segment data and a preset clustering algorithm.
  • the acquisition module is specifically used for:
  • the input image is preprocessed to determine the target image.
  • this application provides an electronic device, including:
  • At least one processor At least one processor
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the strokes involved in the first aspect and optional solutions Skeleton information extraction method.
  • the present application provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the stroke skeleton information extraction method involved in the first aspect and optional solutions.
  • the stroke skeleton information extraction method, device, electronic device and storage medium provided in this application first acquire a target image, the acquired target image includes the target text image, and then determine the reference text corresponding to the target text image according to the target image, and then, The reference stroke skeleton information is determined according to the determined reference text and a preset reference database, where the preset reference database includes the mapping relationship between the reference text and the reference stroke skeleton information, and finally the target stroke skeleton is determined according to the target text image and the reference stroke skeleton information Therefore, the automatic extraction of stroke skeleton information can be realized, and the entire extraction process does not require manual intervention, which reduces the extraction cost while improving efficiency and accuracy.
  • FIG. 1 is a schematic diagram of an application scenario of a method for extracting stroke skeleton information provided by an embodiment of the application;
  • FIG. 2 is a schematic flowchart of a method for extracting stroke skeleton information according to an embodiment of the application
  • FIG. 3 is a schematic diagram of a reference stroke skeleton provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of a process for determining skeleton information of a target stroke provided by an embodiment of this application;
  • FIG. 5 is a schematic diagram of first skeleton data provided by an embodiment of this application.
  • FIG. 6 is a schematic diagram of a process for determining a skeleton point set of a single stroke according to an embodiment of the application
  • FIG. 7 is a schematic diagram of a second skeleton data provided by an embodiment of this application.
  • FIG. 8 is a schematic diagram of a process for determining third skeleton data according to an embodiment of the application.
  • FIG. 9 is a schematic diagram of an extracted target stroke skeleton provided by an embodiment of the application.
  • FIG. 10 is a schematic structural diagram of a device for extracting stroke skeleton information according to an embodiment of the application.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • the glyphs of characters especially Chinese, Japanese, and Korean
  • the glyphs are composed of strokes, which are the basic units that make up characters. Therefore, the extraction of stroke skeletons is an important technical support in font-related fields.
  • the extraction work mostly relies on manual work, which requires a large cost of manpower and material resources. , The extraction efficiency and accuracy are still very low.
  • this application provides a method, device, electronic device, and storage medium for extracting stroke skeleton information.
  • the acquired target image includes a target text image, and then determining according to the target image
  • the reference text corresponding to the target text image is then determined according to the determined reference text and the preset reference database.
  • the preset reference database includes the mapping relationship between the reference text and the reference stroke skeleton information, and finally according to the target text
  • the image and the reference stroke skeleton information determine the target stroke skeleton information, thereby realizing the automatic extraction of the stroke skeleton information.
  • the entire extraction process does not require manual intervention, which reduces the extraction cost and improves the efficiency and accuracy.
  • FIG. 1 is a schematic diagram of an application scenario of the method for extracting stroke skeleton information provided by an embodiment of the application.
  • the method for extracting stroke skeleton information provided by the present application is executed by an electronic device, where the electronic device may be a mobile phone, a computer, a tablet computer, etc.
  • the computer 1 is shown as an example in FIG. 1.
  • the stroke skeleton information extraction method provided by the present application can realize the extraction of the stroke skeleton information of the text contained in the target image.
  • the target image includes the target text image, refer to Figure 1, for example, the target text is the Chinese character " ⁇ ", obtain an image containing the target text image 2 and then determine the target text based on the target image
  • the reference text corresponding to image 2 for example, the reference text corresponding to the target text image 2 is determined in the preset reference database.
  • the reference text is also the Chinese character " ⁇ "
  • the difference is the Chinese character " ⁇ ” of the reference text and the target text
  • the font of the Chinese character " ⁇ ” may be different.
  • the reference stroke skeleton information is determined according to the reference text and the preset reference database.
  • the preset reference database includes the mapping relationship between the reference text and the reference stroke skeleton information.
  • the determined reference stroke skeleton information is The stroke skeleton information of the reference text
  • the target stroke skeleton information is determined according to the target text image and the reference stroke skeleton information, so as to realize the automatic extraction of the stroke skeleton information of the target text "thing" without manual intervention in the entire extraction process, which reduces the extraction
  • the cost also improves efficiency and accuracy.
  • FIG. 2 is a schematic flowchart of a method for extracting stroke skeleton information according to an embodiment of the application. As shown in FIG. 2, the method for extracting stroke skeleton information provided by this embodiment can be executed by an electronic device, and the method includes:
  • S21 Acquire a target image, and the target image includes a target text image.
  • the target image includes a target text image.
  • the target text is the Chinese character " ⁇ ”
  • the target text image 2 is the image of the Chinese character " ⁇ ”.
  • the target text is photographed or scanned to obtain the target text image, and the image containing the target text image is the target image.
  • obtaining the target image includes:
  • Inputting the target text and obtaining an image containing the input target text can be understood as taking a picture or scanning of the input target text to obtain the input image.
  • S212 Perform preprocessing on the input image to determine the target image.
  • the input image containing the target text is preprocessed to obtain the target image.
  • Preprocessing can be image denoising and image binarization. For example, Gaussian smoothing can be used to remove noise in the acquired input image, and then image binarization can be used to binarize the input image. Finally, the target image is obtained after preprocessing.
  • the image denoising processing can also adopt other methods, such as the domain average method, and any means that can perform denoising processing on the image to achieve the target processing result can be used, which is not limited in the embodiment of the present application.
  • the reference word corresponding to the target text image is determined according to the acquired target image and the preset reference database.
  • the reference text corresponding to the target text image can be determined in a preset reference database according to the target image.
  • the target text in the target image may be based on the target text in the target image to find a glyph similar to the target text in a preset reference database, where the preset reference database contains multiple sets of binary graphs of glyphs in different fonts, each The binary image corresponds to a text. It is understandable that according to the target image, it is found in the preset reference database that there may be multiple texts that are similar to the target text. Multiple texts have the same font but different fonts. .
  • the text is determined to be the reference text corresponding to the target text image; if the preset reference database has multiple texts with similar fonts to the target text, it can be determined according to The font difference value between the target text and multiple texts determines the reference text, and the text corresponding to the smallest difference value is the reference text.
  • the determination is made based on the same text.
  • the target text and the reference text belong to the same text, have similar glyphs and different fonts.
  • the preset reference database includes the mapping relationship between the reference text and the reference stroke skeleton information.
  • the preset reference database can be built offline, which can contain multiple sets of binary graphs of glyphs in different fonts and the mapping relationship between reference text and reference stroke skeleton information.
  • the mapping relationship refers to the corresponding relationship between each text in the preset reference database and each stroke skeleton information of the respective glyph. It is understandable that after the reference text is determined, it is based on the determined reference text and the preset reference The database can determine the reference stroke skeleton information. It is worth understanding that the reference stroke skeleton information is each stroke skeleton information of the reference character.
  • the reference stroke skeleton information is determined according to the reference text and the preset reference database, in order to determine the skeleton information of each stroke of the reference text "thing", thereby determining the reference stroke skeleton information, as shown in FIG. 3, which is an embodiment of the application A schematic diagram of a reference stroke skeleton is provided.
  • S24 Determine the target stroke skeleton information according to the target text image and the reference stroke skeleton information.
  • the target stroke skeleton information is determined according to the target text image and the reference stroke skeleton information. It can be understood that the target text in the target text image and the reference text corresponding to the reference stroke skeleton information belong to the same text. The two have similar glyphs.
  • each stroke skeleton information of the target text font can be determined according to the reference stroke skeleton information, so as to determine the stroke skeleton information of the target text, that is, the target stroke skeleton information. Realize the automatic extraction of the skeleton information of the target text strokes.
  • the stroke skeleton information extraction method first acquires a target image, the acquired target image includes the target text image, and then determines the reference text corresponding to the target text image according to the target image and a preset reference database.
  • the preset reference database includes the mapping relationship between the reference text and the reference stroke skeleton information
  • each stroke skeleton information of the reference text can be determined, that is, the reference stroke skeleton information, and the target text in the target text image and the reference
  • the text belongs to the same text. Therefore, when the reference stroke skeleton information is determined, the target stroke skeleton information can be determined according to the target text image and the reference stroke skeleton information, so as to achieve the extraction of the target text stroke skeleton information.
  • the stroke skeleton information extraction method provided in this embodiment does not require manual intervention in the entire process, realizes automatic extraction, reduces extraction costs, and improves efficiency and accuracy.
  • FIG. 4 is a schematic flowchart of determining target stroke skeleton information provided by an embodiment of this application, and the implementation includes :
  • S241 Determine the first skeleton data according to the target text image and the preset image processing algorithm.
  • the first skeleton data includes a feature point set.
  • the target text image is processed by using a preset image processing algorithm to determine the skeleton data of the target text in the target text image, which is the first skeleton data.
  • the preset image processing algorithm may be an image thinning processing algorithm, and the target text image after the image binarization is processed by the image thinning processing algorithm, then the skeleton data of the target text can be obtained.
  • the skeleton data can be presented in various forms such as matrices and graphics.
  • the skeleton data can be displayed in a concrete manner by using a graphic presentation, as shown in FIG. 5, which is a first example provided by an embodiment of this application.
  • FIG. 5 is a first example provided by an embodiment of this application.
  • the embodiment of the present application does not limit the presentation form of the skeleton data.
  • the first skeleton data includes a plurality of data constituting the skeleton data. If each data is called a feature point, the feature point set constitutes the first skeleton data. In other words, the first skeleton data includes a feature point set. .
  • S242 Determine each single-stroke skeleton point set of the target text image according to the feature point set.
  • the feature point set constitutes the first skeleton data, in other words, the first skeleton data includes the feature point set. It is understandable that each single stroke corresponding to the first skeleton data is composed of feature points. According to the feature point set, each single stroke skeleton point set of the target text image can be determined, where each single stroke skeleton The point set can be understood as the set of skeleton points that constitute each single stroke.
  • determining the skeleton point set of each single-stroke drawing of the target text image according to the feature point set can be implemented through the steps shown in FIG. 6, which is an embodiment of the application to determine a single-stroke skeleton point set Schematic diagram of the process, the implementation steps include:
  • S2421 Determine the endpoint subset according to the feature point set and the preset two-dimensional convolution algorithm.
  • the first skeleton data includes a feature point set, and a preset two-dimensional convolution algorithm operation is performed on the first skeleton data to determine multiple endpoints of the first skeleton data, and the point set composed of multiple endpoints is a subset of the endpoints.
  • the endpoint subset is determined according to the feature point set and the preset two-dimensional convolution algorithm.
  • S2422 Determine a subset of intersection points according to the feature point set and the preset intersection point extraction algorithm.
  • the first skeleton data includes a feature point set
  • the first skeleton data is processed with a preset intersection point extraction algorithm to determine multiple intersection points of the first skeleton data, and the point set composed of multiple intersection points is It is a subset of intersections, so as to determine the subset of intersections according to the feature point set and the preset intersection extraction algorithm.
  • S2423 Determine the target text skeleton point set according to the random point subset, the key point subset, and the reference stroke skeleton information.
  • the key point subset includes the endpoint subset and the intersection subset
  • the feature point set includes a random sampling point subset
  • the endpoints and intersections are stored as the key points of the first skeleton data, and the point set composed of the key points is the key point subset.
  • the key point subset includes the endpoint subset and the intersection subset.
  • Random sampling is performed on the feature points in the feature point set included in the first skeleton data, and the obtained feature points are random points, and the point set formed by the random points is a random point subset.
  • CPD Coherent Point Drift
  • S2424 Match the skeleton point set of the target text image with the reference stroke skeleton information to obtain each single-stroke skeleton point set of the target text image.
  • the preset reference database includes a mapping relationship between reference characters and reference stroke skeleton information, and the mapping relationship refers to the corresponding relationship between each character in the preset reference database and each stroke skeleton information of the respective glyph.
  • each stroke skeleton information of each text in the preset reference database is known, and each stroke skeleton information of each text can be classified offline.
  • the classification can be understood as referring to reference stroke skeleton information belonging to the same category In one category, for example, each stroke skeleton information of each character in the preset reference database can be classified according to the direction of the stroke skeleton and the order of the stroke skeleton.
  • each single-stroke skeleton point of the target text can be obtained, and the point set composed of each single-stroke skeleton point is each single Stroke skeleton point set, so as to obtain each single-stroke skeleton point set of the target text image.
  • the target text image skeleton point set is matched with the reference stroke skeleton information, the points that can be matched are selected to form each single-stroke skeleton point of the target text, and the points that cannot be matched are eliminated.
  • the second skeleton data of the target text image can be obtained, as described above, a concrete
  • the skeleton data is presented in a skeleton diagram, as shown in FIG. 7, which is a schematic diagram of a second skeleton data provided by an embodiment of the application.
  • each single stroke can reproduce each single stroke, and each single stroke can constitute the second skeleton data.
  • S244 Determine the third skeleton data according to the second skeleton data and the preset processing algorithm.
  • the third skeleton data can be determined by performing preset processing algorithm processing on the second skeleton data.
  • FIG. 8 is a process for determining the third skeleton data according to an embodiment of the application.
  • a preset connection algorithm is used to connect the second skeleton data to obtain a series of skeleton segment data, that is, a plurality of skeleton segment data is determined.
  • the preset connection algorithm may be a preset edge connection algorithm, and any algorithm that can realize skeleton point connection to obtain skeleton segment data can be used, which is not limited in the embodiment of the present application.
  • S2442 Determine the third skeleton data according to all the skeleton segment data and the preset clustering algorithm.
  • a preset clustering algorithm can be used to cluster all the skeleton segment data to evaluate the clustering effect, and retain the category with the best clustering effect and the best category
  • the corresponding skeleton segment constitutes the third skeleton data, thereby determining the third skeleton data.
  • Steps S2441 and S2442 are described in detail below.
  • the second skeleton data is presented through the second skeleton diagram
  • the third skeleton data is presented through the third skeleton diagram.
  • the second skeleton diagram is determined, and a series of skeleton segments are obtained according to the preset edge connection algorithm.
  • the start and end points of each skeleton segment are selected, and the start and The distance between the end points, select the skeleton segment with the shortest distance, connect the selected skeleton segment, and then calculate the distance between the connected skeleton segment and the remaining skeleton segments, continue to select the connected skeleton segment with the shortest distance, and then Connect the skeleton segment with the shortest distance selected at one time that has been connected once. Repeat this operation until an edge connection graph connecting all the skeleton segments of the target text is established.
  • the created edge connection graph select the optimal connection path, and perform the skeleton pruning operation on the optimal connection path to obtain the final connection path.
  • the final connection path is the optimal stroke path
  • the optimal stroke path constitutes the third skeleton diagram
  • the data corresponding to the third skeleton diagram is the third skeleton data.
  • S245 Determine target stroke skeleton information according to the third skeleton data and the reference stroke skeleton information.
  • the target stroke skeleton information is determined according to the third skeleton data and the reference stroke skeleton information.
  • the CPD algorithm is used again for the point set constituting the third skeleton data, and the non-rigid point set registration is performed with the corresponding reference stroke skeleton information, and the point set corresponding to the result obtained constitutes the skeleton data of the target text in the target text image
  • the target stroke skeleton information is determined, so that the extraction operation of the target stroke skeleton information is completed, as shown in FIG. 9, which is a schematic diagram of an extracted target stroke skeleton according to an embodiment of the application.
  • the stroke skeleton information extraction method provided in this embodiment first determines the first skeleton data according to the target text image and a preset image processing algorithm.
  • the first skeleton data includes a feature point set, and then the target text image is determined according to the feature point set.
  • Each single-stroke skeleton point set when each single-stroke skeleton point set is determined, the second skeleton data can be determined according to all the determined single-stroke skeleton point sets, which can be understood as the preliminary extraction of the skeleton information of the stroke
  • the skeleton data formed by the result determines the third skeleton data according to the second skeleton data and the preset processing algorithm, and finally determines the target stroke skeleton information according to the third skeleton data and the reference stroke skeleton information to complete the extraction of the stroke skeleton information.
  • FIG. 10 is a schematic structural diagram of a device for extracting stroke skeleton information according to an embodiment of the application.
  • the stroke skeleton information extraction device provided in this embodiment is used to implement the stroke skeleton information extraction methods provided in the foregoing embodiments.
  • the stroke skeleton information extraction device 100 provided in this embodiment includes:
  • the obtaining module 101 is used to obtain a target image, and the target image includes a target text image.
  • the first processing module 102 is configured to determine the reference text corresponding to the target text image according to the target image and a preset reference database.
  • the second processing module 103 is configured to determine reference stroke skeleton information according to the reference text and a preset reference database.
  • the preset reference database includes a mapping relationship between the reference text and the reference stroke skeleton information.
  • the third processing module 104 is configured to determine the target stroke skeleton information according to the target text image and the reference stroke skeleton information.
  • the obtaining module 101 is specifically used for:
  • the third processing module 104 is specifically used for:
  • the target stroke skeleton information is determined according to the third skeleton data and the reference stroke skeleton information.
  • the third processing module 104 is specifically used for:
  • the key point subset includes the end point subset and the intersection point subset
  • the feature point set includes the random point subset
  • the target text image skeleton point set is matched with the reference stroke skeleton information to obtain each single-stroke skeleton point set of the target text image.
  • the third processing module 104 is specifically used for:
  • the third skeleton data is determined according to all the skeleton segment data and the preset clustering algorithm.
  • FIG. 11 is a schematic structural diagram of an electronic device provided by an embodiment of the application. As shown in FIG. 11, the electronic device 800 provided in this embodiment includes:
  • At least one processor 801 and
  • the memory 802 stores instructions that can be executed by at least one processor 801, and the instructions are executed by at least one processor 801 so that at least one processor 801 can execute each step of the stroke skeleton information extraction method described above. Specifically, you can participate in the aforementioned method. Related description in the embodiment.
  • the embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to make a computer execute each step of the stroke skeleton information extraction method in the foregoing embodiments.
  • the readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Character Discrimination (AREA)

Abstract

本申请提供一种笔画骨架信息提取方法、装置、电子设备及存储介质。本申请提供的笔画骨架信息提取方法通过获取目标图像,所获取的目标图像中包括目标文字图像,然后根据目标图像确定目标文字图像对应的参考文字,之后,再根据所确定的参考文字以及预设参考数据库确定参考笔画骨架信息,其中,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系,最后根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息,从而,能够实现笔画骨架信息的自动化提取,整个提取过程无需人工干预,降低提取成本的同时还提高了效率以及精确度。

Description

笔画骨架信息提取方法、装置、电子设备及存储介质 技术领域
本申请涉及计算机图形学技术领域,尤其涉及一种笔画骨架信息提取方法、装置、电子设备及存储介质。
背景技术
对于文字字形而言,尤其是像中文、日文以及韩文等,其字形均由笔画构成,笔画是组成文字的基本单位。
笔画骨架提取是字体相关领域重要的技术支撑。能够精确地提取笔画骨架信息,对促进本领域相关技术的发展具有不言而喻的重要性。然而,由于文字结构的复杂性以及多样性,笔画骨架信息的提取一直是本领域的技术难题。尤其针对较为复杂的字形,笔画骨架提取工作多依赖于人工手动进行,需要较多的人力物力成本,提取效率与精确度较低。
可见,亟需一种笔画骨架信息提取方法,以克服现有技术中的各种技术问题。
发明内容
本申请提供一种笔画骨架信息提取方法、装置、电子设备及存储介质,以解决现有技术中笔画骨架信息提取的效率与精确度较低的技术问题。
第一方面,本申请提供一种笔画骨架信息提取方法,包括:
获取目标图像,所述目标图像中包括目标文字图像;
根据所述目标图像以及预设参考数据库确定所述目标文字图像对应的参考文字;
根据所述参考文字以及所述预设参考数据库确定参考笔画骨架信息,所述预设参考数据库包括所述参考文字与所述参考笔画骨架信息的映射关系;
根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息。
在一种可能的设计中,所述根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息,包括:
根据所述目标文字图像以及预设图像处理算法确定第一骨架数据,所述第一骨架数据包括特征点集;
根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集;
根据所有的所述单一笔画骨架点集确定第二骨架数据;
根据所述第二骨架数据以及预设处理算法确定第三骨架数据;
根据所述第三骨架数据以及所述参考笔画骨架信息确定所述目标笔画骨架信息。
在一种可能的设计中,所述根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集,包括:
根据所述特征点集以及预设二维卷积算法确定端点子集;
根据所述特征点集以及预设交叉点提取算法确定交叉点子集;
根据随机点子集、关键点子集以及所述参考笔画骨架信息确定目标文字图像骨架点集,所述关键点子集包括所述端点子集与所述交叉点子集,所述特征点集包括所述随机点子集;
将所述目标文字图像骨架点集与所述参考笔画骨架信息进行匹配,以获得所述目标文字图像的每个单一笔画骨架点集。
在一种可能的设计中,所述根据所述第二骨架数据以及预设处理算法确定第三骨架数据,包括:
根据所述第二骨架数据以及预设连接算法确定多个骨架段数据;
根据所有的所述骨架段数据以及预设聚类算法确定第三骨架数据。
在一种可能的设计中,所述获取目标图像,包括:
获取输入图像;
对所述输入图像进行预处理以确定所述目标图像。
第二方面,本申请提供一种笔画骨架信息提取装置,包括:
获取模块,用于获取目标图像,所述目标图像中包括目标文字图像;
第一处理模块,用于根据所述目标图像以及预设参考数据库确定所述目标文字图像对应的参考文字;
第二处理模块,用于根据所述参考文字以及所述预设参考数据库确定参考笔画骨架信息,所述预设参考数据库包括所述参考文字与所述参考笔画骨架信息的映射关系;
第三处理模块,用于根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息。
在一种可能的设计中,所述第三处理模块,具体用于:
根据所述目标文字图像以及预设图像处理算法确定第一骨架数据,所述第一骨架数据包括特征点集;
根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集;
根据所有的所述单一笔画骨架点集确定第二骨架数据;
根据所述第二骨架数据以及预设处理算法确定第三骨架数据;
根据所述第三骨架数据以及所述参考笔画骨架信息确定所述目标笔画骨架信息。
在一种可能的设计中,所述第三处理模块,具体用于:
根据所述特征点集以及预设二维卷积算法确定端点子集;
根据所述特征点集以及预设交叉点提取算法确定交叉点子集;
根据随机点子集、关键点子集以及所述参考笔画骨架信息确定目标文字图像骨架点集,所述关键点子集包括所述端点子集与所述交叉点子集,所述特征点集包括所述随机点子集;
将所述目标文字图像骨架点集与所述参考笔画骨架信息进行匹配,以获得所述目标文字图像的每个单一笔画骨架点集。
在一种可能的设计中,所述第三处理模块,具体用于:
根据所述第二骨架数据以及预设连接算法确定多个骨架段数据;
根据所有的所述骨架段数据以及预设聚类算法确定第三骨架数据。
在一种可能的设计中,所述获取模块,具体用于:
获取输入图像;
对所述输入图像进行预处理以确定所述目标图像。
第三方面,本申请提供一种电子设备,包括:
至少一个处理器;以及
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行第一方面及可选的方案涉及的笔画骨架信息提取方法。
第四方面,本申请提供一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使所述计算机执行第一方面及可选的方案涉及的笔画骨架信息提取方法。
本申请提供的笔画骨架信息提取方法、装置、电子设备及存储介质,通过首先获取目标图像,所获取的目标图像中包括目标文字图像,然后根据目标图像确定目标文字图像对应的参考文字,之后,再根据所确定的参考文字以及预设参考数据库确定参考笔画骨架信息,其中,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系,最后根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息,从而,能够实现笔画骨架信息的自动化提取,整个提取过程无需人工干预,降低提取成本的同 时还提高了效率以及精确度。
附图说明
图1为本申请实施例提供的笔画骨架信息提取方法的一种应用场景示意图;
图2为本申请实施例提供的一种笔画骨架信息提取方法的流程示意图;
图3为本申请实施例提供的一种参考笔画骨架示意图;
图4为本申请实施例提供的一种确定目标笔画骨架信息的流程示意图;
图5为本申请实施例提供的一种第一骨架数据的示意图;
图6为本申请实施例提供的一种确定单一笔画骨架点集的流程示意图;
图7为本申请实施例提供的一种第二骨架数据的示意图;
图8为本申请实施例提供的一种确定第三骨架数据的流程示意图;
图9为本申请实施例提供的一种提取后的目标笔画骨架示意图;
图10为本申请实施例提供的一种笔画骨架信息提取装置的结构示意图;
图11为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的方法和装置的例子。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
对于文字的字形而言,尤其像中文、日文以及韩文等,其字形均由笔画构成,笔画是组成文字的基本单元,因此,笔画骨架提取是字体相关领域一项重要的技术支撑。然而,由于文字结构的复杂性以及多样性,笔画骨架的提取一直是本领域的技术难题,尤其针对较为复杂的字形,其提取工作多依赖于人工手动进行,需要较大的人力物力 成本的同时,提取效率以及精确度还很低。
针对现有技术中的上述问题,本申请提供一种笔画骨架信息提取方法、装置、电子设备及存储介质,通过首先获取目标图像,所获取的目标图像中包括目标文字图像,然后根据目标图像确定目标文字图像对应的参考文字,之后,再根据所确定的参考文字以及预设参考数据库确定参考笔画骨架信息,其中,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系,最后根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息,从而,实现笔画骨架信息的自动化提取,整个提取过程无需人工干预,降低提取成本的同时还提高了效率以及精确度。
下面以具体地实施例对本申请的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图1为本申请实施例提供的笔画骨架信息提取方法的一种应用场景示意图。如图1所示,本申请提供的笔画骨架信息提取方法由电子设备执行,其中,电子设备可以是手机、计算机、平板电脑等,图1中以计算机1为例示出。通过本申请提供的笔画骨架信息提取方法可以实现对目标图像中包含的文字的笔画骨架信息提取。
首先获取目标图像,该目标图像中包括目标文字图像,参照图1所示,例如目标文字是汉字“事”,获取一张包含有该目标文字图像2的图像,然后根据该目标图像确定目标文字图像2对应的参考文字,例如,在预设参考数据库中确定目标文字图像2对应的参考文字,显然,该参考文字也为汉字“事”,不同的是参考文字的汉字“事”与目标文字的汉字“事”的字体可能不相同。在确定了参考文字之后,根据该参考文字以及预设参考数据库确定参考笔画骨架信息,其中,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系,因此,所确定的参考笔画骨架信息是该参考文字的笔画骨架信息,最后根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息,从而实现目标文字“事”的笔画骨架信息自动提取,在整个提取过程中无需人工干预,降低了提取成本的同时还提高了效率以及精确度。
图2为本申请实施例提供的一种笔画骨架信息提取方法的流程示意图。如图2所示,本实施例提供的笔画骨架信息提取方法可以由电子设备执行,该方法包括:
S21:获取目标图像,目标图像中包括目标文字图像。
获取目标图像,其中,目标图像中包括目标文字图像,例如,目标文字为汉字“事”,可以参考图1中的目标文字图像2,目标文字图像2则是汉字“事”的图像,可以通过对目标文字拍照或扫描获取目标文字图像,包含有目标文字图像的图像则为目标图像。
可选地,获取目标图像包括:
S211:获取输入图像。
输入目标文字,获取包含有输入目标文字的图像,可以理解为对输入目标文字进行拍照或扫描,获取输入图像。
S212:对输入图像进行预处理确定目标图像。
对输入的包含有目标文字的图像进行预处理得到目标图像。预处理可以为图像去噪处理以及图像二值化处理,例如,对所获取的输入图像可以采用高斯平滑操作去除图像中的噪声,之后,运用图像二值化处理对输入图像进行二值化,最终经过预处理之后得到目标图像。其中,图像去噪处理也可以采用其他方法,例如采用领域平均法,凡是能够对图像进行去噪处理以达到目标处理结果的手段均可以采用,对此,本申请实施例不作限定。
S22:根据目标图像以及预设参考数据库确定目标文字图像对应的参考文字。
在获取了目标图像之后,根据所获取的目标图像以及预设参考数据库确定目标文字图像对应的参考字。例如,可以根据目标图像在预设参考数据库中确定目标文字图像对应的参考文字。
具体地,可以是根据目标图像中的目标文字,在预设参考数据库中找出与目标文字字形相似的字形,其中,预设参考数据库中包含有多套不同字体的字形二值图,每个二值图则对应一个文字,可以理解的是,根据目标图像在预设参考数据库中找出与目标文字字形相似的可能为多个文字,多个文字之间具有相同的字形,但字体不相同。若预设参考数据库中与目标文字字形相似的文字为一个,则确定该文字为目标文字图像对应的参考文字;若预设参考数据库中与目标文字字形相似的文字为多个文字,则可以根据目标文字与多个文字之间的字形差异值确定参考文字,最小差异值对应的文字即为参考文字。
值得说明的是,根据目标图像确定目标文字图像对应的参考文字时,是根据同一个文字进行确定,换言之,目标文字与参考文字属于同一个文字,具有相似的字形,不同的字体。
S23:根据参考文字以及预设参考数据库确定参考笔画骨架信息。
其中,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系。
预设参考数据库可以离线进行搭建的,其中可以包含有多套不同字体的字形二值图以及参考文字与参考笔画骨架信息的映射关系。映射关系是指预设参考数据库中的每个文字与各自字形的每个笔画骨架信息之间对应的关系,可以理解的是,当参考文 字被确定之后,根据所确定的参考文字和预设参考数据库则可以确定参考笔画骨架信息。值得理解的是,参考笔画骨架信息为参考字的每个笔画骨架信息。
具体地,继续参照图1的目标文字图像2,其中目标文字为“事”,故而,在预设数据库中所确定的参考文字也为“事”。根据参考文字以及预设参考数据库确定参考笔画骨架信息,则为确定参考文字“事”的每个笔画骨架信息,从而确定了参考笔画骨架信息,如图3所示,图3为本申请实施例提供的一种参考笔画骨架示意图。
S24:根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息。
在确定了参考笔画骨架信息之后,根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息,可以理解为,目标文字图像中的目标文字,与参考笔画骨架信息对应的参考文字属于同一个文字,两者具有相似的字形,当参考笔画骨架信息确定的情况下,目标文字字形的每个笔画骨架信息则可以根据参考笔画骨架信息确定,从而确定目标文字的笔画骨架信息,即目标笔画骨架信息,实现目标文字笔画骨架信息的自动提取。
本实施例提供的笔画骨架信息提取方法,通过首先获取目标图像,所获取的目标图像中包括目标文字图像,然后根据目标图像以及预设参考数据库确定目标文字图像对应的参考文字,当确定了参考文字之后,因预设参考数据库中包括参考文字与参考笔画骨架信息的映射关系,则可以确定参考文字的每个笔画骨架信息,即为参考笔画骨架信息,而目标文字图像中的目标文字与参考文字属于同一个文字,故而,在参考笔画骨架信息确定的情况下,根据目标文字图像以及参考笔画骨架信息则能确定目标笔画骨架信息,从而实现目标文字笔画骨架信息的提取。克服了现有技术中需要人工的手动操作增加提取成本,以及提取效率与精确度较低的问题。本实施例提供的笔画骨架信息提取方法在整个过程中无需人工干预,实现自动化提取,降低了提取成本,提高了效率以及精确度。
在图2所示实施例的基础上,步骤S24的一种可能的实现方式如图4所示,图4为本申请实施例提供的一种确定目标笔画骨架信息的流程示意图,该实现方式包括:
S241:根据目标文字图像以及预设图像处理算法确定第一骨架数据。
其中,第一骨架数据包括特征点集。
对目标文字图像采用预设图像处理算法进行处理,以确定目标文字图像中的目标文字的骨架数据,即为第一骨架数据。其中,预设图像处理算法可以为图像细化处理算法,对经过图像二值化处理的目标文字图像采用图像细化处理算法进行处理,则可以得到目标文字的骨架数据。其中,骨架数据可以采用矩阵、图形等各种形式进行呈 现,例如,采用图形呈现,可以具象化地将骨架数据进行展示,如图5所示,图5为本申请实施例提供的一种第一骨架数据的示意图,其中目标文字为汉字“事”,目标文字图像为图1中的2,所得到的第一骨架数据为图5所示。本申请实施例对于骨架数据的呈现形式不作限定。
可以理解的是,第一骨架数据包括构成骨架数据的多个数据,若将每个数据称之为特征点,则特征点集构成了第一骨架数据,换言之,第一骨架数据包括特征点集。
S242:根据特征点集确定目标文字图像的每个单一笔画骨架点集。
特征点集构成第一骨架数据,换言之,第一骨架数据包括特征点集。可以理解的是,第一骨架数据所对应的每个单一笔画均是由特征点构成,根据该特征点集则可以确定目标文字图像的每个单一笔画骨架点集,其中,每个单一笔画骨架点集可以理解为构成每个单一笔画骨架点所组成的集合,
一种可能的设计中,根据特征点集确定目标文字图像的每个单一笔画骨架点集可以通过图6所示的步骤实现,图6为本申请实施例提供的一种确定单一笔画骨架点集的流程示意图,该实现步骤包括:
S2421:根据特征点集以及预设二维卷积算法确定端点子集。
第一骨架数据包括特征点集,对第一骨架数据进行预设二维卷积算法运算,可以确定第一骨架数据的多个端点,多个端点所组成的点集合则为端点子集,从而实现根据特征点集以及预设二维卷积算法确定端点子集。
S2422:根据特征点集以及预设交叉点提取算法确定交叉点子集。
与步骤S2421类似,第一骨架数据包括特征点集,对第一骨架数据进行预设交叉点提取算法处理,可以确定第一骨架数据的多个交叉点,多个交叉点所组成的点集合则为交叉点子集,从而实现根据特征点集以及预设交叉点提取算法确定交叉点子集。
S2423:根据随机点子集、关键点子集以及参考笔画骨架信息确定目标文字骨架点集。
其中,关键点子集包括端点子集与交叉点子集,特征点集包括随机采样点子集。
在根据步骤S2421和步骤S2422确定了端点子集与交叉点子集之后,将端点以及交叉点作为第一骨架数据的关键点进行保存,关键点所组成的点集合则为关键点子集。换言之,关键点子集包括端点子集与交叉点子集。
对第一骨架数据包括的特征点集中的特征点进行随机采样,所得到的特征点则为随机点,随机点所组成的点集合即为随机点子集。
对随机点子集与关键点子集采用一致性点集漂移算法(Coherent Point Drift, 简称CPD),以使其与参考笔画骨架信息进行非刚性点集注册,所获得的点集注册结果构成目标文字图像骨架点集。
S2424:将目标文字图像骨架点集与参考笔画骨架信息进行匹配,以获得目标文字图像的每个单一笔画骨架点集。
预设参考数据库包括参考文字与参考笔画骨架信息的映射关系,映射关系是指预设参考数据库中的每个文字与各自字形的每个笔画骨架信息之间对应的关系。换言之,预设参考数据库中每个文字的每个笔画骨架信息是已知的,则可以离线对每个文字的每个笔画骨架信息进行分类,分类可以理解为将属于同一类的参考笔画骨架信息归为一类,例如可以根据笔画骨架的方向、笔画骨架的顺序对预设参考数据库中每个文字的每个笔画骨架信息进行归类。
将目标文字图像骨架点集与已经提前完成归类的参考笔画骨架信息进行匹配,则可以得到目标文字的每个单一笔画骨架点,每个单一笔画骨架点所组成的点集合则为每个单一笔画骨架点集,从而获取目标文字图像的每个单一笔画骨架点集。
可以理解的是,将目标文字图像骨架点集与参考笔画骨架信息进行匹配,选取能够完成匹配的点构成目标文字的每个单一笔画骨架点,剔除不能完成匹配的点。
S243:根据所有的单一笔画骨架点集确定第二骨架数据。
在确定了目标文字图像的每个单一笔画骨架点集之后,通过对所有的单一笔画骨架点集进行文字重现,则可以获得目标文字图像的第二骨架数据,如前所描述,一种具象化地呈现骨架数据的方式为骨架图,如图7所示,图7为本申请实施例提供的一种第二骨架数据的示意图,
可以理解的是,每个单一笔画骨架点集中的点可以重现每个单一笔画,每个单一笔画则可以构成第二骨架数据。
S244:根据第二骨架数据以及预设处理算法确定第三骨架数据。
在确定了目标文字图像的第二骨架数据之后,通过对第二骨架数据进行预设处理算法处理可以确定第三骨架数据。
一种可能的设计中,根据第二骨架数据以及预设处理算法确定第三骨架数据可以通过图8所示的步骤实现,图8为本申请实施例提供的一种确定第三骨架数据的流程示意图,如图8所示,该实现方式包括:
S2441:根据第二骨架数据以及预设连接算法确定多个骨架段数据。
在确定了第二骨架数据之后,对第二骨架数据采用预设连接算法进行连接,可以得到一系列的骨架段数据,即确定了多个骨架段数据。其中,预设连接算法可以是预 设边缘连接算法,凡是可以实现骨架点连接得到骨架段数据的算法均可以采用,对此,本申请实施例不作限定。
S2442:根据所有的骨架段数据以及预设聚类算法确定第三骨架数据。
可以理解的是,在确定了多个骨架段数据之后,可以对所有的骨架段数据采用预设聚类算法进行聚类,评价聚类效果,保留聚类效果最优的类别,最优的类别对应的骨架段构成第三骨架数据,从而确定第三骨架数据。
下面对步骤S2441和步骤S2442详细进行说明,为了描述方便,通过第二骨架图呈现第二骨架数据,通过第三骨架图呈现第三骨架数据。
在确定了第二骨架数据之后,即确定了第二骨架图,根据预设边缘连接算法得到一系列骨架段,选取每个骨架段的起点和终点,分别计算两两骨架段之间的起点和终点之间的距离,选取距离最短的骨架段,连接所选取的骨架段,再把连接的骨架段与剩余的骨架段之间的距离进行计算,继续选取距离最短的已连接的骨架段,再一次连接所选取距离最短的已进行过一次连接的骨架段。重复进行该操作,直至建立连通目标文字所有骨架段的边连接图,在所建立的边连接图中,选取最优连接通路,对最优连接通路进行骨架剪枝操作,得到最终的连接通路,最终的连接通路则为最优笔画通路,最优笔画通路构成第三骨架图,第三骨架图对应的数据则为第三骨架数据。
S245:根据第三骨架数据以及参考笔画骨架信息确定目标笔画骨架信息。
在确定了第三骨架数据之后,根据第三骨架数据以及参考笔画骨架信息确定目标笔画骨架信息。
具体地,对构成第三骨架数据的点集再一次采用CPD算法,与其对应的参考笔画骨架信息进行非刚性点集注册,所得到的结果对应的点集构成目标文字图像中目标文字的骨架数据,换言之,确定了目标笔画骨架信息,从而,完成目标笔画骨架信息的提取操作,如图9所示,图9为本申请实施例提供的一种提取后的目标笔画骨架示意图。
本实施例提供的笔画骨架信息提取方法,首先通过根据目标文字图像以及预设图像处理算法确定第一骨架数据,其中,第一骨架数据包括特征点集,然后根据特征点集确定目标文字图像的每个单一笔画骨架点集,当每个单一笔画骨架点集确定之后,根据所确定的所有单一笔画骨架点集则可以确定第二骨架数据,第二骨架数据可以理解为笔画骨架信息的初步提取结果所构成的骨架数据,再根据第二骨架数据以及预设处理算法确定第三骨架数据,最后再根据第三骨架数据以及参考笔画骨架信息确定目标笔画骨架信息,完成笔画骨架信息的提取。克服了现有技术中需要人工的手动操作 增加提取的成本,以及提取效率与精确度较低的问题。在整个提取过程中无需人工干预,实现自动化操作,降低了提取成本,提高了效率以及精确度。
图10为本申请实施例提供的一种笔画骨架信息提取装置的结构示意图。本实施例提供的笔画骨架信息提取装置,用于执行上述各实施例提供的笔画骨架信息提取方法。如图10所示,本实施例提供的笔画骨架信息提取装置100,包括:
获取模块101,用于获取目标图像,目标图像中包括目标文字图像。
第一处理模块102,用于根据目标图像以及预设参考数据库确定目标文字图像对应的参考文字。
第二处理模块103,用于根据参考文字以及预设参考数据库确定参考笔画骨架信息,预设参考数据库包括参考文字与参考笔画骨架信息的映射关系。
第三处理模块104,用于根据目标文字图像以及参考笔画骨架信息确定目标笔画骨架信息。
本实施例提供的笔画骨架信息提取装置与上述图2的方法实施例的实现原理以及效果类似,在此不作赘述。
可选地,获取模块101,具体用于:
获取输入图像;
对输入图像进行预处理以确定目标图像。
本实施例与上述方法实施例中的步骤S211-S212的实现原理以及效果类似,在此不作赘述。
一种可能的设计中,第三处理模块104,具体用于:
根据目标文字图像以及预设图像处理算法确定第一骨架数据,第一骨架数据包括特征点集;
根据特征点集确定目标文字图像的每个单一笔画骨架点集;
根据所有的单一笔画骨架点集确定第二骨架数据;
根据第二骨架数据以及预设处理算法确定第三骨架数据;
根据第三骨架数据以及参考笔画骨架信息确定目标笔画骨架信息。
本实施例与上述图4的方法实施例的实现原理以及效果类似,在此不作赘述。
一种可能的设计中,第三处理模块104,具体用于:
根据特征点集以及预设二维卷积算法确定端点子集;
根据特征点集以及预设交叉点提取算法确定交叉点子集;
根据随机点子集、关键点子集以及参考笔画骨架信息确定目标文字图像骨架点集, 关键点子集包括端点子集与交叉点子集,特征点集包括随机点子集;
将目标文字图像骨架点集与参考笔画骨架信息进行匹配,以获得目标文字图像的每个单一笔画骨架点集。
本实施例与上述图6的方法实施例的实现原理以及效果类似,在此不作赘述。
一种可能的设计中,第三处理模块104,具体用于:
根据第二骨架数据以及预设连接算法确定多个骨架段数据;
根据所有的骨架段数据以及预设聚类算法确定第三骨架数据。
本实施例与上述图8的方法实施例的实现原理以及效果类似,在此不作赘述。
图11为本申请实施例提供的一种电子设备的结构示意图。如图11所示,本实施例提供的电子设备800包括:
至少一个处理器801;以及
与至少一个处理器801通信连接的存储器802;其中,
存储器802存储有可被至少一个处理器801执行的指令,该指令被至少一个处理器801执行,以使至少一个处理器801能够执行上述的笔画骨架信息提取方法的各个步骤,具体可以参加前述方法实施例中的相关描述。
在示例性实施例中,本申请实施例提供了一种存储有计算机指令的非瞬时计算机可读存储介质,计算机指令用于使计算机执行上述各实施例中笔画骨架信息提取方法的各个步骤。例如,可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求书指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求书来限制。

Claims (10)

  1. 一种笔画骨架信息提取方法,其特征在于,包括:
    获取目标图像,所述目标图像中包括目标文字图像;
    根据所述目标图像以及预设参考数据库确定所述目标文字图像对应的参考文字;
    根据所述参考文字以及所述预设参考数据库确定参考笔画骨架信息,所述预设参考数据库包括所述参考文字与所述参考笔画骨架信息的映射关系;
    根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息。
  2. 根据权利要求1所述的笔画骨架信息提取方法,其特征在于,所述根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息,包括:
    根据所述目标文字图像以及预设图像处理算法确定第一骨架数据,所述第一骨架数据包括特征点集;
    根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集;
    根据所有的所述单一笔画骨架点集确定第二骨架数据;
    根据所述第二骨架数据以及预设处理算法确定第三骨架数据;
    根据所述第三骨架数据以及所述参考笔画骨架信息确定所述目标笔画骨架信息。
  3. 根据权利要求2所述的笔画骨架信息提取方法,其特征在于,所述根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集,包括:
    根据所述特征点集以及预设二维卷积算法确定端点子集;
    根据所述特征点集以及预设交叉点提取算法确定交叉点子集;
    根据随机点子集、关键点子集以及所述参考笔画骨架信息确定目标文字图像骨架点集,所述关键点子集包括所述端点子集与所述交叉点子集,所述特征点集包括所述随机点子集;
    将所述目标文字图像骨架点集与所述参考笔画骨架信息进行匹配,以获得所述目标文字图像的每个单一笔画骨架点集。
  4. 根据权利要求2所述的笔画骨架信息提取方法,其特征在于,所述根据所述第二骨架数据以及预设处理算法确定第三骨架数据,包括:
    根据所述第二骨架数据以及预设连接算法确定多个骨架段数据;
    根据所有的所述骨架段数据以及预设聚类算法确定第三骨架数据。
  5. 根据权利要求1-4中任意一项所述的笔画骨架信息提取方法,其特征在于,所述获取目标图像,包括:
    获取输入图像;
    对所述输入图像进行预处理以确定所述目标图像。
  6. 一种笔画骨架信息提取装置,其特征在于,包括:
    获取模块,用于获取目标图像,所述目标图像中包括目标文字图像;
    第一处理模块,用于根据所述目标图像以及预设参考数据库确定所述目标文字图像对应的参考文字;
    第二处理模块,用于根据所述参考文字以及所述预设参考数据库确定参考笔画骨架信息,所述预设参考数据库包括所述参考文字与所述参考笔画骨架信息的映射关系;
    第三处理模块,用于根据所述目标文字图像以及所述参考笔画骨架信息确定目标笔画骨架信息。
  7. 根据权利要求6所述的笔画骨架信息提取装置,其特征在于,所述第三处理模块,具体用于:
    根据所述目标文字图像以及预设图像处理算法确定第一骨架数据,所述第一骨架数据包括特征点集;
    根据所述特征点集确定所述目标文字图像的每个单一笔画骨架点集;
    根据所有的所述单一笔画骨架点集确定第二骨架数据;
    根据所述第二骨架数据以及预设处理算法确定第三骨架数据;
    根据所述第三骨架数据以及所述参考笔画骨架信息确定所述目标笔画骨架信息。
  8. 根据权利要求6所述的笔画骨架信息提取装置,其特征在于,所述第三处理模块,具体用于:
    根据所述特征点集以及预设二维卷积算法确定端点子集;
    根据所述特征点集以及预设交叉点提取算法确定交叉点子集;
    根据随机点子集、关键点子集以及所述参考笔画骨架信息确定目标文字图像骨架点集,所述关键点子集包括所述端点子集与所述交叉点子集,所述特征点集包括所述随机点子集;
    将所述目标文字图像骨架点集与所述参考笔画骨架信息进行匹配,以获得所述目标文字图像的每个单一笔画骨架点集。
  9. 一种电子设备,其特征在于,包括:
    至少一个处理器;以及
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一 个处理器执行,以使所述至少一个处理器能够执行权利要求1-5中任一项所述的笔画骨架信息提取方法。
  10. 一种存储有计算机指令的非瞬时计算机可读存储介质,其特征在于,所述计算机指令用于使所述计算机执行权利要求1-5中任一项所述的笔画骨架信息提取方法。
PCT/CN2019/119898 2019-10-09 2019-11-21 笔画骨架信息提取方法、装置、电子设备及存储介质 WO2021068364A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910955021.1A CN112633428A (zh) 2019-10-09 2019-10-09 笔画骨架信息提取方法、装置、电子设备及存储介质
CN201910955021.1 2019-10-09

Publications (1)

Publication Number Publication Date
WO2021068364A1 true WO2021068364A1 (zh) 2021-04-15

Family

ID=75283285

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119898 WO2021068364A1 (zh) 2019-10-09 2019-11-21 笔画骨架信息提取方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN112633428A (zh)
WO (1) WO2021068364A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505252A (zh) * 2021-06-11 2021-10-15 清华大学 一种甲骨文数据库的构建方法和装置
CN115471849A (zh) * 2022-11-03 2022-12-13 南京信息工程大学 一种手写汉字图像评估方法及系统
CN117496537A (zh) * 2023-11-08 2024-02-02 广东新裕信息科技有限公司 一种基于改进的形状特征匹配的书法书写质量评价方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114530064A (zh) * 2022-02-22 2022-05-24 北京思明启创科技有限公司 一种基于视频的书法练习方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020072863A1 (en) * 1992-02-06 2002-06-13 Fujitsu Limited Method and apparatus for extracting and evaluating mutually similar portions in one-dimensional sequences in molecules and/or three-dimensional structures of molecules
CN104992143A (zh) * 2015-06-04 2015-10-21 北京大学 一种面向矢量字形的汉字笔画自动提取方法
CN109064522A (zh) * 2018-08-03 2018-12-21 厦门大学 基于条件生成对抗网络的汉字字体生成方法
CN109784146A (zh) * 2018-12-05 2019-05-21 广州企图腾科技有限公司 一种字体种类识别方法、电子设备、存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3448606B2 (ja) * 1997-01-22 2003-09-22 威鋒數位開發股▲ふん▼有限公司 全解像度空間における筆画ベース文字発生方法及び装置
CN107092917B (zh) * 2017-03-24 2020-06-02 北京大学 一种基于流形学习的汉字笔画自动提取方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020072863A1 (en) * 1992-02-06 2002-06-13 Fujitsu Limited Method and apparatus for extracting and evaluating mutually similar portions in one-dimensional sequences in molecules and/or three-dimensional structures of molecules
CN104992143A (zh) * 2015-06-04 2015-10-21 北京大学 一种面向矢量字形的汉字笔画自动提取方法
CN109064522A (zh) * 2018-08-03 2018-12-21 厦门大学 基于条件生成对抗网络的汉字字体生成方法
CN109784146A (zh) * 2018-12-05 2019-05-21 广州企图腾科技有限公司 一种字体种类识别方法、电子设备、存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113505252A (zh) * 2021-06-11 2021-10-15 清华大学 一种甲骨文数据库的构建方法和装置
CN115471849A (zh) * 2022-11-03 2022-12-13 南京信息工程大学 一种手写汉字图像评估方法及系统
CN117496537A (zh) * 2023-11-08 2024-02-02 广东新裕信息科技有限公司 一种基于改进的形状特征匹配的书法书写质量评价方法
CN117496537B (zh) * 2023-11-08 2024-04-23 广东新裕信息科技有限公司 一种基于改进的形状特征匹配的书法书写质量评价方法

Also Published As

Publication number Publication date
CN112633428A (zh) 2021-04-09

Similar Documents

Publication Publication Date Title
WO2021068364A1 (zh) 笔画骨架信息提取方法、装置、电子设备及存储介质
US11410407B2 (en) Method and device for generating collection of incorrectly-answered questions
CN109948510B (zh) 一种文档图像实例分割方法及装置
CN110135530B (zh) 转换图像中汉字字体的方法及系统、计算机设备及介质
CN104182750A (zh) 一种在自然场景图像中基于极值连通域的中文检测方法
CN110298353B (zh) 一种字符识别方法及系统
CN112434690A (zh) 动态解析文本图像特征现象的元素自动捕获理解方法、系统及存储介质
Chiang et al. Recognition of multi-oriented, multi-sized, and curved text
CN105719243A (zh) 图像处理装置和方法
CN112446259A (zh) 图像处理方法、装置、终端和计算机可读存储介质
CN113705286A (zh) 一种表格检测与识别方法和介质
CN113158895A (zh) 票据识别方法、装置、电子设备及存储介质
CN103455816B (zh) 一种笔画宽度提取方法、装置及一种文字识别方法、系统
Abdalkafor et al. A Novel Database for Arabic Handwritten Recognition (NDAHR) System
CN115393865A (zh) 文字检索方法、设备以及计算机可读存储介质
CN113269102B (zh) 一种印章信息识别方法、装置、计算机设备和存储介质
CN115565193A (zh) 问卷信息录入方法、装置、电子设备及存储介质
CN104462111A (zh) 图像检索数据库建立方法
CN112101347B (zh) 文本检测方法、装置、电子设备及计算机存储介质
Callier et al. Automatic road area extraction from printed maps based on linear feature detection
CN108573253B (zh) 车牌字符二值图的生成方法
JP2021056796A (ja) 構造認識システム、構造認識装置、構造認識方法、及びプログラム
US11244190B1 (en) System and method for patterned artifact removal for bitonal images
RU2792743C1 (ru) Идентификация используемых в документах систем письма
US20230306771A1 (en) Template agnostic document reader

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19948669

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19948669

Country of ref document: EP

Kind code of ref document: A1