CN116580129A - Method, device and storage medium for improving calligraphy character skeleton based on distance transformation - Google Patents

Method, device and storage medium for improving calligraphy character skeleton based on distance transformation Download PDF

Info

Publication number
CN116580129A
CN116580129A CN202310410681.8A CN202310410681A CN116580129A CN 116580129 A CN116580129 A CN 116580129A CN 202310410681 A CN202310410681 A CN 202310410681A CN 116580129 A CN116580129 A CN 116580129A
Authority
CN
China
Prior art keywords
point
skeleton
distance
black pixel
points
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202310410681.8A
Other languages
Chinese (zh)
Other versions
CN116580129B (en
Inventor
徐占洋
熊宁阳
李丁宇
秦飞扬
王晶弘
张家瑞
汤正博
徐益鸣
马彪
杨盛凯
林巍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Children's Spring Internet Education Technology Co ltd
Nanjing University of Information Science and Technology
Original Assignee
Jiangsu Children's Spring Internet Education Technology Co ltd
Nanjing University of Information Science and Technology
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 Jiangsu Children's Spring Internet Education Technology Co ltd, Nanjing University of Information Science and Technology filed Critical Jiangsu Children's Spring Internet Education Technology Co ltd
Priority to CN202310410681.8A priority Critical patent/CN116580129B/en
Publication of CN116580129A publication Critical patent/CN116580129A/en
Application granted granted Critical
Publication of CN116580129B publication Critical patent/CN116580129B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • 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/16Image preprocessing
    • G06V30/162Quantising the image signal
    • 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/18Extraction of features or characteristics of the image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The application discloses a method, a device and a storage medium for improving a calligraphy character skeleton based on distance transformation, which comprise the steps of obtaining skeleton endpoints and boundary points of original characters; if the skeleton end point is not the boundary point, carrying out stroke extension by taking the skeleton end point as a center point: and repeatedly executing the following steps to obtain a plurality of black pixel points by taking the distance value of the center point after the distance conversion operation as a stop condition, and carrying out stroke extension: taking a skeleton endpoint as a center point, taking the center point as a symmetrical center, acquiring a first point opposite to the original black pixel point, acquiring a second point and a third point adjacent to the first point, performing distance transformation operation on the first point, the second point and the third point, selecting a point with the largest distance value after the distance transformation operation as a new black pixel point, and taking the new black pixel point as the new center point. The application can solve the problem that the key strokes are lost in the Chinese character skeleton extraction method, so that the stroke length is shortened.

Description

Method, device and storage medium for improving calligraphy character skeleton based on distance transformation
Technical Field
The application relates to a method and a device for improving a calligraphy character skeleton based on distance transformation and a storage medium, belonging to the technical field of Chinese character skeleton restoration.
Background
Chinese handwriting is a special Chinese art and a unique visual art. In the long history of five thousand years up and down of China, chinese calligraphies have undergone the development stages from seal script to clerical script, cursive script, regular script and line book since the appearance of oracle bone, and have a brilliant history of nearly three thousand years. Extraction of the skeleton may also be referred to as refinement, and generally refers to a process of successively deleting image edge pixels until a single pixel width skeleton is reached, under the premise of maintaining the topological link relationship of original pixels of the image. The skeleton extracted by image refinement is not only an important topological description of the target image, but also reduces redundant information in the image.
When the method is applied to thinning the handwritten Chinese character image, the defects of the skeleton extracted by the traditional many thinning algorithms mainly exist as the Chinese character structure is complex and the writing style of the handwritten Chinese character is random: the phenomenon of distortion, more burrs, and the lack of key strokes of Chinese characters, and the algorithm needs to repeatedly iterate the Chinese character image, which takes a long time.
Meanwhile, due to the refinement characteristic that the handwriting word is deleted from the outside to the inside, the result of the existing refinement method is correspondingly shortened relative to the original word, and the refined handwriting word is distorted.
Disclosure of Invention
The application aims to overcome the defects of the prior art, and provides a distance-transformation-based calligraphy character skeleton improvement method, a distance-transformation-based calligraphy character skeleton improvement device and a storage medium, which solve the problems that key strokes are lost, the stroke length is shortened, redundancy and burrs exist, and the extraction time is overlong in the traditional Chinese character refinement method.
In order to achieve the above object, in a first aspect, the present application provides a method for improving a calligraphy skeleton based on distance transformation, comprising the steps of:
acquiring skeleton endpoints in the skeleton image of the Chinese character after refinement treatment;
acquiring boundary points of original characters in original character images of the Chinese characters before refinement treatment;
in the skeleton image, if the skeleton end point is not a boundary point, carrying out stroke extension by taking the skeleton end point as a center point;
the stroke extension by taking the skeleton end point as the center point specifically comprises the following steps:
and repeatedly executing the following steps to obtain a plurality of black pixel points by taking the condition that the distance value of the center point reaches a preset value after the distance conversion operation as a stop condition, and forming an extended stroke by all the black pixel points together:
taking a skeleton endpoint as a center point, taking the center point as a symmetry center based on original black pixel points in eight adjacent areas of the center point, acquiring a first point opposite to the original black pixel points, acquiring a second point and a third point adjacent to the first point, performing distance transformation operation on the first point, the second point and the third point, selecting a point with the largest distance value after the distance transformation operation as a new black pixel point, and taking the new black pixel point as the new center point.
Further, the stop condition includes:
in the extension direction, the value of the point in the distance conversion array at which the distance value is largest is 1.
Further, the obtaining the skeleton endpoint includes:
if only one black pixel point exists in the eight adjacent points with the current pixel point as the center, the current pixel point is a skeleton endpoint:
wherein n is the number of image pixel points;the point with the sum of the eight neighborhood gray values corresponding to the ith center point after binarization being 1; />As a function of the solution gray values +.>J=2, 3 … … 9 for the corresponding j-1 th point in the eight neighborhood.
Further, the obtaining the boundary point of the original word includes:
and performing distance transformation operation on all pixel points in the original character image to obtain the point with the distance value of 1 as the boundary point of the original character.
Further, the refinement process includes:
and performing distance transformation on the binarized Chinese character image to obtain distance values, sequentially arranging the distance values, extracting corresponding indexes, deleting pixels meeting the conditions according to the index sequence, acquiring skeleton shake positions based on pixel shake features, eliminating pixel shake, and finishing Chinese character refinement.
Further, the distance transformation includes:
in the binarized image, the Euclidean distance from the non-zero point to the nearest background point is calculated, and the background point and the non-background point are distinguished by using color marks.
Further, when the non-background points are marked with colors, colors of different depths are marked based on different distances between the non-background points and the background points.
Further, the calculating the euclidean distance from the non-zero point to the nearest background point includes:
wherein ,a Euclidean distance calculation formula; />Is a non-zero coordinate>X-axis coordinate values for non-zero, +.>Y-axis coordinate values that are non-zero; />For the nearest background point coordinates +.>For the x-axis coordinate of the nearest background spot, < >>Is the y-axis coordinate closest to the background point.
Further, the sequentially arranging the distance values, extracting the corresponding index, includes:
and (3) unifying the distance values, sorting from small to large based on the stack sorting, and returning the original corresponding index value.
Further, the deleting the pixels meeting the condition according to the index sequence includes:
in the image after binarization processing, if the number of connected domains in the eight neighborhood with the black pixel point as the center is greater than 1, the current pixel point is reserved;
if the current pixel point is equal to 1 and the current pixel point is an endpoint, reserving the current pixel point;
otherwise, deleting the current pixel point.
Further, the obtaining the skeleton shake position based on the pixel shake feature, eliminating the pixel shake, includes:
a white pixel point is arranged between two black pixel points in the same horizontal or vertical direction at intervals, a third black pixel point adjacent to the white pixel point exists, meanwhile, only two black pixel points exist in eight neighborhood of the third black pixel point, the third black pixel point is judged to be a dithering pixel point, the dithering pixel point is converted into the white pixel point, the white pixel point between the dithering pixel point and the two black pixel points is converted into the black pixel point, and pixel dithering is eliminated;
and if two opposite angle neighborhoods positioned on the same side of the length direction of the two black pixel points are black pixel points, and meanwhile, the eight neighborhoods of the two continuous black pixel points are only two black pixel points, the two continuous black pixel points are judged to be dithering pixel points, the dithering pixel points are changed into white pixel points, the white pixel points between the dithering pixel points and the opposite angle neighborhoods are changed into black pixel points, and the pixel dithering is eliminated.
In a second aspect, the application provides a distance transformation-based calligraphy skeleton improvement device, comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method of any of the first aspects.
In a third aspect, the present application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method according to any of the first aspects.
The application has the beneficial effects that:
the application provides a distance transformation-based calligraphy character skeleton improvement method, a distance transformation-based calligraphy character skeleton improvement device and a storage medium.
When eliminating the pixel jitter, the application divides the jitter degree into one pixel jitter and two pixel jitter, and after eliminating the jitter, the strokes of Chinese characters are more reasonable and accurate.
Meanwhile, the application aims at the problem that the skeleton length is shortened in the existing skeleton extraction method, and the thinned strokes of the skeleton shortened are prolonged according to a certain rule, so that the due length of the original Chinese character strokes is achieved, the original characteristic information of the Chinese character is not changed, and a more accurate skeleton is provided for handwriting evaluation.
Drawings
FIG. 1 is a flow chart of a calligraphy character skeleton improvement method based on distance transformation provided by an embodiment of the application;
FIG. 2 is a diagram of the distance values of the Chinese characters after the distance conversion;
FIG. 3 is a diagram of a process of repairing one pixel dithering in the same column in a distance transformation-based calligraphy character skeleton improvement method according to an embodiment of the present application;
FIG. 4 is a diagram of a two-pixel dithering repair process in the same column in a distance transformation-based calligraphy character skeleton improvement method provided by an embodiment of the application;
FIG. 5 is a diagram of refined Chinese characters in a calligraphy character skeleton improvement method based on distance transformation provided by an embodiment of the application;
FIG. 6 is a diagram after recovering the pixel dithering of Chinese characters in a calligraphy character skeleton improvement method based on distance transformation according to an embodiment of the application;
FIG. 7 is an image eight neighborhood schematic;
FIG. 8 is an array of distance values stored after a distance transformation;
FIG. 9 is a first original handwriting graph referenced by the present application;
FIG. 10 is a handwriting skeleton after pixel dithering elimination in a refinement of the present application;
FIG. 11 is a skeleton of the application after extended strokes;
FIG. 12 is a diagram of a second original handwriting incorporating the present application;
FIG. 13 is a skeleton after treatment by a prior art method;
FIG. 14 is a skeleton after treatment by the method of the present application.
Description of the embodiments
The application is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present application, and are not intended to limit the scope of the present application.
The embodiment of the application provides a handwriting word skeleton improvement method based on distance transformation, which mainly solves the problem that the refinement is not in place due to the complex structure of Chinese characters, and solves the problems that key strokes are easy to lose and the details of Chinese characters cannot be completely displayed due to long time consumption and high complexity of the traditional Chinese character refinement method; in order to solve the problems, when a skeleton diagram is acquired, the method is used for refining Chinese characters by adopting a distance transformation-based method, the Euclidean distance from a non-zero point to a nearest background point in an image is calculated, the images are sorted, and then the sorted pixel points are sequentially traversed to judge whether the pixel points need to be deleted, so that the operation efficiency is improved to a great extent, repeated traversal is avoided, and key information of the Chinese characters is basically reserved; when eliminating the pixel jitter, the application divides the jitter degree into one pixel jitter and two pixel jitter, and after eliminating the jitter, the strokes of Chinese characters are more reasonable and accurate; when the strokes are prolonged, the strokes are prolonged completely according to the strokes of the original characters on the basis of distance transformation, and accurate skeleton strokes are provided for handwriting evaluation.
In a specific design, as shown in fig. 1 to 14, the method comprises the following steps:
step 1: acquiring a Chinese character image and preprocessing:
and acquiring a Chinese character image to be processed, and performing image graying and binarization processing to obtain a preprocessed image.
And converting the image type into an array type, wherein a white point with a gray value of 255 is set as a background point to be 0, and a black target point with the gray value of 0 is set as 1.
Step 2: performing distance conversion operation on the preprocessed image, and storing the obtained distance value into an array:
first, non-zero point in the preprocessed image is calculatedTo nearest background point->European distance between->
wherein ,a Euclidean distance calculation formula; />Is a non-zero coordinate>X-axis coordinate values for non-zero, +.>Y-axis coordinate values that are non-zero; />For the nearest background point coordinates +.>For the x-axis coordinate of the nearest background spot, < >>Is the y-axis coordinate closest to the background point.
Then calculating to obtain the final distance value of the target point P after the distance conversionI.e. minimum euclidean distance:
and then the obtained minimum Euclidean distance is stored into an array according to the corresponding index, as shown in FIG. 2, which is a schematic diagram of the distance value of the Chinese character after the distance conversion. The background points and the non-background points are marked and distinguished by adopting different colors, in the embodiment, the background points are marked by adopting blue, the non-background points are marked by adopting red, and meanwhile, when the non-background points are marked, the non-background points are marked by adopting colors with different depths based on different distances between the non-background points and the background points, namely, the more distant the non-background points are from the background points, the darker the red of the non-background points is.
Step 3: the distance values in the array are arranged in order from small to large, and the corresponding indexes are extracted:
firstly, the distance values in the array in the step 2 are unidimensioned, then the unidimensioned array elements are arranged from small to large through heap sorting, and an array of the index values corresponding to the stored values is returned.
Step 4: deleting the eligible pixels in index order against the given template:
counting the number of connected domains in eight adjacent domains with the current black pixel point as the center for each black pixel point, and if the number of connected domains is larger than 1, reserving the current black pixel point;
if the current black pixel point is equal to 1 and the current black pixel point is the endpoint, reserving the current black pixel point;
otherwise, deleting the current black pixel point;
when counting the number of connected domains, traversing the eight adjacent domains with the current black pixel point as the center clockwise, and counting the times from 0 to 1, namely the number of the connected domains.
Step 5: according to the pixel dithering characteristics, the dithering position of the Chinese character skeleton is found, and the pixel dithering is eliminated:
as shown in fig. 3 and 4, the present application provides a method for repairing one pixel dithering and a method for repairing two pixel dithering;
when one pixel dithering repair is performed, as shown in fig. 3, when two black pixel points p1, p3 are arranged between two black pixel points p2 in the same column (or the same row), and one black pixel point p4 is arranged between two black pixel points p3, and only two black pixel points p1 and p2 are arranged in eight adjacent areas of the black pixel point p4, the black pixel point p4 is a dithering pixel, the p4 is changed into a white pixel, and the p3 is changed into a black pixel, so that the repair of one pixel dithering is completed;
when two-pixel dithering repair is performed, as shown in fig. 4, when two continuous pixel points p1 and p2 on the same column in the kanji image are black pixel points, the upper left (right) corner p3 of p1 and the lower left (right) corner p4 of p2 are also black pixel points, and the eight adjacent areas of p1 and p2 only have two black pixel points, p1 and p2 are dithering pixels, p1 and p2 are changed into white pixels, and the two left (right) pixels p5 and p6 of p1 and p2 are changed into black pixels, so that the repair of the two-pixel dithering in the vertical direction is completed; the same applies to the restoration of the horizontal two-pixel dithering.
As shown in fig. 5 and 6, fig. 5 is a result diagram of the refinement algorithm of the present application, and fig. 6 is a result diagram after the pixel dithering is recovered, so that it can be obviously seen that the Chinese character after the dithering is recovered is more close to the structure of the Chinese character itself.
Step 6: extending the shortened stroke end based on the distance transformed image:
referring to fig. 7, which is a schematic diagram of eight neighborhoods of an image, traversing the thinned skeleton image, traversing the eight neighborhoods with the current pixel point as the center, and setting the current pixel point as a skeleton endpoint when only one black pixel point exists in the eight neighborhoods, namely
Where n is the number of image pixels,is a point with the sum of eight neighborhood gray values corresponding to the ith center point after binarization being 1,/h>As a function of the solution gray values +.>J=2, 3 … … 9 for the corresponding j-1 th point in the eight neighborhood.
The coordinates of all skeleton endpoints are stored in an array end_points.
Performing distance transformation operation on the original word image before refinement, wherein the distance transformation operation is the same as that of the second step, and obtaining a distance value and storing the distance value into an array distance:
distance = ndimg.distance_transform_edt(image);
and (3) circularly traversing to obtain all points with the distance value of 1, wherein the points are boundary points of the original characters, and storing the coordinates of the boundary points of all the original characters into an array boundary_points.
For a skeleton image, if the end point end_points of the skeleton are not in the boundary point boundary_points, taking the end point of the skeleton as a center point, and acquiring black pixel points M in eight adjacent areas; let eight neighborhood arrays be:
if the subscript in the array corresponding to the M pixel point is num, that is, m=n [ num ], and the center point is taken as the symmetry center, the M1 point in the opposite direction and the M2 and M3 points adjacent to M1 are respectively the first point, the second point and the third point, and the subscript of the corresponding array is respectively:
M1:num1 = (num + 4) % 8 ;
M2:num2 = (num1 + 1) % 8;
M3:num3 = (num1 - 1) % 8;
selecting the point with the largest distance value in distance in M1, M2 and M3, and setting the point as a black pixel point:
wherein ,coordinates of black pixel points;/>A point corresponding to a distance value having a maximum distance value; />Is the point in distance with subscript i.
And so on, taking the pixel point with black color in the round as a new center point, if the distance value of the point is 1, setting the point as the black pixel point, and stopping operation; if the distance value of the point is greater than 1, repeating the steps until the distance value is 1.
As shown in FIG. 8, the array of distance values stored after the distance transformation is shown, the eight neighborhoods with skeleton end points as center points are shown in the box, and the pixel points drawn by the straight lines are the points which need to be blackened in the above steps.
As shown in fig. 9-11, fig. 9 is a first original calligraphy character cited by the present application, fig. 10 is a skeleton for eliminating pixel shake after refinement, fig. 11 is a skeleton contrast diagram after extending strokes of the present application, and it can be seen that the extended strokes are extended completely according to the original character stroke trend.
Fig. 12-14 show, fig. 12 is a second original handwriting cited by the application, fig. 13 is a result diagram of the existing refining algorithm, fig. 14 is a result diagram of the refining method of the application, and it can be obviously seen that the application makes strokes of Chinese characters more reasonable and accurate after refining and eliminating jitter compared with the prior art.
Based on the same inventive concept, the application provides a calligraphy character skeleton improvement device based on distance transformation, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method of any of the embodiments.
Based on the same inventive concept, the present application provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, realizes the steps of the method according to any of the first aspects.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely a preferred embodiment of the present application, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present application, and such modifications and variations should also be regarded as being within the scope of the application.

Claims (13)

1. A calligraphy character skeleton improvement method based on distance transformation is characterized in that:
the method comprises the following steps:
acquiring skeleton endpoints in the skeleton image of the Chinese character after refinement treatment;
acquiring boundary points of original characters in original character images of the Chinese characters before refinement treatment;
in the skeleton image, if the skeleton end point is not a boundary point, carrying out stroke extension by taking the skeleton end point as a center point;
the stroke extension by taking the skeleton end point as the center point specifically comprises the following steps:
and repeatedly executing the following steps to obtain a plurality of black pixel points by taking the condition that the distance value of the center point reaches a preset value after the distance conversion operation as a stop condition, and forming an extended stroke by all the black pixel points together:
taking a skeleton endpoint as a center point, taking the center point as a symmetry center based on original black pixel points in eight adjacent areas of the center point, acquiring a first point opposite to the original black pixel points, acquiring a second point and a third point adjacent to the first point, performing distance transformation operation on the first point, the second point and the third point, selecting a point with the largest distance value after the distance transformation operation as a new black pixel point, and taking the new black pixel point as the new center point.
2. The distance transformation-based calligraphy skeleton improvement method according to claim 1, characterized by:
the stop condition includes:
in the extension direction, the value of the point in the distance conversion array at which the distance value is largest is 1.
3. The distance transformation-based calligraphy skeleton improvement method according to claim 1, characterized by:
the obtaining skeleton end point includes:
if only one black pixel point exists in the eight adjacent points with the current pixel point as the center, the current pixel point is a skeleton endpoint:
wherein n is the number of image pixel points;the point with the sum of the eight neighborhood gray values corresponding to the ith center point after binarization being 1; />As a function of the solution gray values +.>J=2, 3 … … 9 for the corresponding j-1 th point in the eight neighborhood.
4. The distance transformation-based calligraphy skeleton improvement method according to claim 1, characterized by:
the obtaining the boundary point of the original word comprises the following steps:
and performing distance transformation operation on all pixel points in the original character image to obtain the point with the distance value of 1 as the boundary point of the original character.
5. The distance transformation-based calligraphy skeleton improvement method according to claim 1, characterized by:
the refinement process includes:
and performing distance transformation on the binarized Chinese character image to obtain distance values, sequentially arranging the distance values, extracting corresponding indexes, deleting pixels meeting the conditions according to the index sequence, acquiring skeleton shake positions based on pixel shake features, eliminating pixel shake, and finishing Chinese character refinement.
6. The distance transformation-based calligraphy skeleton improvement method according to claim 5, characterized by:
the distance transformation includes:
in the binarized image, the Euclidean distance from the non-zero point to the nearest background point is calculated, and the background point and the non-background point are distinguished by using color marks.
7. The distance transformation-based calligraphy skeleton improvement method according to claim 6, characterized by:
when the non-background points are marked with colors, colors of different depths are marked based on different distances between the non-background points and the background points.
8. The distance transformation-based calligraphy skeleton improvement method according to claim 6, characterized by:
the calculating the Euclidean distance from the non-zero point to the nearest background point comprises the following steps:
wherein ,a Euclidean distance calculation formula; />Is a non-zero coordinate>X-axis coordinate values for non-zero, +.>Y-axis coordinate values that are non-zero; />For the nearest background point coordinates +.>For the x-axis coordinate of the nearest background spot, < >>Is the y-axis coordinate closest to the background point.
9. The distance transformation-based calligraphy skeleton improvement method according to claim 5, characterized by:
the step of sequentially arranging the distance values and extracting the corresponding indexes comprises the following steps:
and (3) unifying the distance values, sorting from small to large based on the stack sorting, and returning the original corresponding index value.
10. The distance transformation-based calligraphy skeleton improvement method according to claim 5, characterized by:
the deleting the pixels meeting the condition according to the index sequence comprises the following steps:
in the image after binarization processing, if the number of connected domains in the eight neighborhood with the black pixel point as the center is greater than 1, the current pixel point is reserved;
if the current pixel point is equal to 1 and the current pixel point is an endpoint, reserving the current pixel point;
otherwise, deleting the current pixel point.
11. The distance transformation-based calligraphy skeleton improvement method according to claim 5, characterized by:
the method for acquiring the skeleton shake position based on the pixel shake features and eliminating the pixel shake comprises the following steps:
a white pixel point is arranged between two black pixel points in the same horizontal or vertical direction at intervals, a third black pixel point adjacent to the white pixel point exists, meanwhile, only two black pixel points exist in eight neighborhood of the third black pixel point, the third black pixel point is judged to be a dithering pixel point, the dithering pixel point is converted into the white pixel point, the white pixel point between the dithering pixel point and the two black pixel points is converted into the black pixel point, and pixel dithering is eliminated;
and if two opposite angle neighborhoods positioned on the same side of the length direction of the two black pixel points are black pixel points, and meanwhile, the eight neighborhoods of the two continuous black pixel points are only two black pixel points, the two continuous black pixel points are judged to be dithering pixel points, the dithering pixel points are changed into white pixel points, the white pixel points between the dithering pixel points and the opposite angle neighborhoods are changed into black pixel points, and the pixel dithering is eliminated.
12. Calligraphy word skeleton improves device based on distance transformation, its characterized in that:
comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1 to 11.
13. A computer readable storage medium having stored thereon a computer program characterized by:
the program when executed by a processor performs the steps of the method of any of claims 1 to 11.
CN202310410681.8A 2023-04-18 2023-04-18 Method, device and storage medium for improving calligraphy character skeleton based on distance transformation Active CN116580129B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310410681.8A CN116580129B (en) 2023-04-18 2023-04-18 Method, device and storage medium for improving calligraphy character skeleton based on distance transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310410681.8A CN116580129B (en) 2023-04-18 2023-04-18 Method, device and storage medium for improving calligraphy character skeleton based on distance transformation

Publications (2)

Publication Number Publication Date
CN116580129A true CN116580129A (en) 2023-08-11
CN116580129B CN116580129B (en) 2024-05-14

Family

ID=87538612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310410681.8A Active CN116580129B (en) 2023-04-18 2023-04-18 Method, device and storage medium for improving calligraphy character skeleton based on distance transformation

Country Status (1)

Country Link
CN (1) CN116580129B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699517A (en) * 2009-10-30 2010-04-28 华南理工大学 Skeleton transformation method for beautifying hand-written Chinese characters
CN107045634A (en) * 2017-05-02 2017-08-15 电子科技大学 A kind of text positioning method based on maximum stable extremal region and stroke width
CN109325483A (en) * 2018-09-11 2019-02-12 北京语言大学 The treating method and apparatus of internal short pen section
CN109409211A (en) * 2018-09-11 2019-03-01 北京语言大学 The processing method and system of Chinese character skeleton pen section
US20190096123A1 (en) * 2017-09-25 2019-03-28 Microsoft Technology Licensing, Llc Generating Ink Effects for a Digital Ink Stroke
CN110659644A (en) * 2019-06-26 2020-01-07 西安理工大学 Automatic extraction method for strokes of calligraphy single characters
CN110909563A (en) * 2018-09-14 2020-03-24 北大方正集团有限公司 Method, device and equipment for extracting character skeleton and computer readable storage medium
CN112990183A (en) * 2021-05-19 2021-06-18 中国科学院自动化研究所 Method, system and device for extracting homonymous strokes of offline handwritten Chinese characters
CN113642542A (en) * 2021-10-14 2021-11-12 中国科学院自动化研究所 Method for extracting homonymous strokes of handwritten Chinese characters based on position constraint
CN115497108A (en) * 2022-11-16 2022-12-20 南京信息工程大学 Chinese character framework angular point detection method based on elliptical eccentricity
CN115841671A (en) * 2023-02-21 2023-03-24 南京信息工程大学 Calligraphy character skeleton correction method, system and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101699517A (en) * 2009-10-30 2010-04-28 华南理工大学 Skeleton transformation method for beautifying hand-written Chinese characters
CN107045634A (en) * 2017-05-02 2017-08-15 电子科技大学 A kind of text positioning method based on maximum stable extremal region and stroke width
US20190096123A1 (en) * 2017-09-25 2019-03-28 Microsoft Technology Licensing, Llc Generating Ink Effects for a Digital Ink Stroke
CN109325483A (en) * 2018-09-11 2019-02-12 北京语言大学 The treating method and apparatus of internal short pen section
CN109409211A (en) * 2018-09-11 2019-03-01 北京语言大学 The processing method and system of Chinese character skeleton pen section
CN110909563A (en) * 2018-09-14 2020-03-24 北大方正集团有限公司 Method, device and equipment for extracting character skeleton and computer readable storage medium
CN110659644A (en) * 2019-06-26 2020-01-07 西安理工大学 Automatic extraction method for strokes of calligraphy single characters
CN112990183A (en) * 2021-05-19 2021-06-18 中国科学院自动化研究所 Method, system and device for extracting homonymous strokes of offline handwritten Chinese characters
CN113642542A (en) * 2021-10-14 2021-11-12 中国科学院自动化研究所 Method for extracting homonymous strokes of handwritten Chinese characters based on position constraint
CN115497108A (en) * 2022-11-16 2022-12-20 南京信息工程大学 Chinese character framework angular point detection method based on elliptical eccentricity
CN115841671A (en) * 2023-02-21 2023-03-24 南京信息工程大学 Calligraphy character skeleton correction method, system and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
刘亚亚;于凤芹;陈莹;: "基于笔画宽度变换的场景文本定位", 小型微型计算机系统, no. 02, 15 February 2016 (2016-02-15) *
朱志伟: "毛笔运笔书写视频中动态墨迹及字形骨架提取方法研究", 中国优秀硕士学位论文全文数据库 哲学与人文科学辑, no. 06, 15 June 2022 (2022-06-15), pages 088 - 365 *
邓晓健;李彬;张俊松;: "基于统计的汉字字形视觉重心计算", 中文信息学报, no. 04, 15 July 2015 (2015-07-15) *
陈军 等;: "一种基于分区标记的快速细化方法", 计算机应用与软件, vol. 25, no. 3, 31 March 2008 (2008-03-31) *

Also Published As

Publication number Publication date
CN116580129B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
CN109409366B (en) Distorted image correction method and device based on angular point detection
CN102096795B (en) Method for recognizing worn two-dimensional barcode image
CN104751142B (en) A kind of natural scene Method for text detection based on stroke feature
CN104063723B (en) The stroke restoring method and device of the Off-line Handwritten Chinese
CN108615058A (en) A kind of method, apparatus of character recognition, equipment and readable storage medium storing program for executing
CN112906695B (en) Form recognition method adapting to multi-class OCR recognition interface and related equipment
CN112364834A (en) Form identification restoration method based on deep learning and image processing
CN108038484B (en) Method for quickly identifying hollow verification code
CN112712273B (en) Handwriting Chinese character aesthetic degree judging method based on skeleton similarity
Al Abodi et al. An effective approach to offline Arabic handwriting recognition
CN111275049B (en) Method and device for acquiring text image skeleton feature descriptors
CN113688688A (en) Completion method of table lines in picture and identification method of table in picture
CN109271882B (en) Method for extracting color-distinguished handwritten Chinese characters
CN112541370B (en) QR code position detection graph positioning method based on FPGA
EP2223265A1 (en) A method for resolving contradicting output data from an optical character recognition (ocr) system, wherein the output data comprises more than one recognition alternative for an image of a character
CN115841671B (en) Handwriting skeleton correction method, system and storage medium
CN117576699A (en) Locomotive work order information intelligent recognition method and system based on deep learning
CN116580129B (en) Method, device and storage medium for improving calligraphy character skeleton based on distance transformation
Li An effective approach to offline arabic handwriting recognition
CN107358138B (en) Correction method of nonlinear distortion EAN bar code, mobile terminal and storage device
Tian et al. Table frame line detection in low quality document images based on hough transform
Wang et al. Calligraphy image processing with stroke extraction and representation
CN113901936A (en) Hard-pen calligraphy field character grid section image extraction method, system and equipment
CN114550176A (en) Examination paper correcting method based on deep learning
CN109871910A (en) A kind of hand-written character recognition method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant