CN113034649B - Chinese character drawing and displaying method and device, electronic equipment and medium - Google Patents
Chinese character drawing and displaying method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN113034649B CN113034649B CN202110562537.7A CN202110562537A CN113034649B CN 113034649 B CN113034649 B CN 113034649B CN 202110562537 A CN202110562537 A CN 202110562537A CN 113034649 B CN113034649 B CN 113034649B
- Authority
- CN
- China
- Prior art keywords
- point
- stroke
- current
- drawn
- chinese character
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/80—Creating or modifying a manually drawn or painted image using a manual input device, e.g. mouse, light pen, direction keys on keyboard
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
The disclosure relates to a Chinese character drawing and displaying method, a Chinese character drawing and displaying device, electronic equipment and a medium. The method comprises the following steps: extracting a current drawing point position of a current drawing stroke on a Chinese character to be drawn; based on the position of the current drawing point location, two current contour point locations with the closest distance to the current drawing point location are screened out from contour point locations on two sides of a predetermined current drawing stroke; constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides; and displaying the drawing area of the current drawing stroke. Through the technical scheme, the accurate Chinese character display drawing process is realized, so that the Chinese character teaching requirement is met.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for displaying chinese character drawing, an electronic device, and a medium.
Background
With the development of Computer technology, electronic devices such as PCs (Personal computers), mobile phones, tablet PCs, PDAs (Personal Digital assistants), and the like are widely used, and operate interactively through a human-Computer interface of the electronic devices.
At present, in a scene of Chinese character teaching, electronic equipment needs to show a drawing process of Chinese characters for a user. Because the Chinese characters are not regular graphs, many Chinese characters have the characteristic of stroke edge, and the electronic equipment needs to accurately display the drawing process of the Chinese characters so as to meet the teaching requirement of the Chinese characters.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the disclosure provides a method, a device, an electronic device and a medium for displaying Chinese character drawing, which can accurately display a Chinese character drawing process so as to meet the teaching requirement of Chinese characters.
The present disclosure provides a Chinese character drawing and displaying method, which includes:
extracting a current drawing point position of a current drawing stroke on a Chinese character to be drawn;
based on the position of the current drawing point location, two current contour point locations with the closest distance to the current drawing point location are screened out from contour point locations on two sides of a predetermined current drawing stroke;
constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides;
and displaying the drawing area of the current drawing stroke.
The present disclosure provides a Chinese character drawing and displaying device, which comprises:
the point location extraction module is used for extracting the current drawing point location of the current drawing stroke on the Chinese character to be drawn;
the point location screening module is used for screening two current contour point locations which are closest to the current drawing point location from contour point locations on two sides of a predetermined current drawing stroke based on the position of the current drawing point location;
the drawing area construction module is used for constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides;
and the drawing area display module is used for displaying the drawing area of the current drawing stroke.
An embodiment of the present invention further provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the chinese character drawing and displaying method provided by any embodiment of the present invention.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the Chinese character drawing and displaying method provided by any embodiment of the invention is realized.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the method comprises the steps of predetermining outline point positions on two sides of a current drawn stroke of a Chinese character to be drawn, extracting the current drawn point position of the current drawn stroke on the Chinese character to be drawn when a user is drawing the Chinese character to be drawn, screening out two current outline point positions with the shortest distance from the current drawn point position from the outline point positions on the two sides of the predetermined current drawn stroke based on the position of the current drawn point position, the position of the current drawn point position and the outline point positions on the two sides, quickly and accurately constructing a drawn area of the current drawn stroke, and displaying the drawn area of the current drawn stroke so as to display the drawing progress of the user in real time and visually, improve the drawing experience of the user and meet the teaching requirement on a Chinese character line.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic interface diagram of a Chinese character drawing display method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a method for displaying chinese character drawing according to an embodiment of the present disclosure;
FIG. 3 is another interface diagram of a Chinese character drawing display method according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of another method for displaying chinese character drawing according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a chinese character drawing and displaying apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
In a Chinese teaching scenario, the electronic device needs to show the user the drawing process of Chinese characters. Because the Chinese characters are not regular graphs, many Chinese characters have the characteristic of stroke edge, and the electronic equipment needs to accurately display the drawing process of the Chinese characters so as to meet the teaching requirement of the Chinese characters.
In the related art, the first display mode of the chinese character drawing process is: based on the drawing process of the Chinese characters, generating a small video or generating a Graphic Interchange Format (GIF) picture, and playing the generated small video or GIF picture to show the drawing process of the Chinese characters to a user. The display mode has the defects that the flow is consumed to display the drawing process of the Chinese characters, the stroke colors of the Chinese characters cannot be dynamically changed, and the writing process of the Chinese characters cannot be displayed in a personalized mode.
In the related art, the second display mode of the chinese character drawing process is: the electronic equipment draws a stroke line by using a relatively thick brush and cuts off the part outside the outline according to the stroke outline. The display mode has the disadvantages that more canvas space is needed in the process of drawing the Chinese characters, the Chinese characters need to be drawn twice, the process is complicated, and the performance of the electronic equipment is influenced.
In order to solve the above problems, embodiments of the present disclosure provide a method and an apparatus for displaying chinese character drawing, an electronic device, and a medium. The method for drawing and displaying the Chinese characters provided by the embodiment of the disclosure can refer to an interface schematic diagram shown in fig. 1. Referring to fig. 1, when a user draws a chinese character on an electronic device using a finger or a drawing pen, a drawing position (i.e., a position where the finger is located in fig. 1) is determined in real time, a current drawing point location is extracted based on the drawing position, and two current contour point locations closest to the current drawing point location are screened out from contour point locations on both sides of a predetermined current drawing stroke according to the position of the current drawing point location; further, according to the position of the current contour point, the position of the current drawing point and the contour point positions on both sides of the current drawing stroke, the drawing area of the current drawing stroke is determined, that is, the drawing area formed by the point positions in fig. 1 is obtained.
By the mode, the drawing area of the current drawing stroke is determined in real time based on the current drawing point position in the drawing process, the drawing area with any drawing progress can be displayed, the drawing process of Chinese characters is visually displayed for a user, and the requirement of Chinese character teaching is met. In addition, the electronic equipment can determine the current contour point position and the current drawing point position in an off-line state so as to determine a drawing area in the off-line state and reduce flow consumption; in addition, the Chinese character drawing process displayed by the embodiment of the disclosure does not need to use a thicker painting brush to draw stroke lines, does not occupy more canvas space, and only needs to draw once, so that the drawing process is simplified, and the performance of the electronic equipment is ensured.
Next, a method for drawing and displaying a chinese character according to an embodiment of the present disclosure is specifically explained. Fig. 2 is a schematic flow chart of a chinese character drawing and displaying method. Referring to fig. 2, the method includes:
and S110, extracting the current drawing point position of the current drawing stroke on the Chinese character to be drawn.
In the embodiment of the present disclosure, the chinese characters to be drawn refer to chinese characters that need to be drawn by the user and are displayed on the electronic device, and may be any font or any style of chinese characters. The current drawing stroke refers to the stroke being drawn by the user, and can be any one of horizontal stroke, vertical stroke, left falling stroke, point stroke and right falling stroke.
In the embodiment of the present disclosure, before extracting a current drawing point location of a currently drawn stroke on a chinese character to be drawn, the method further includes: and extracting point locations of the Chinese character to be drawn, wherein the point locations comprise point locations of the central line of each stroke and point locations of the outline of each stroke on the Chinese character to be drawn.
Specifically, the point locations of the Chinese character to be drawn refer to feature points of each stroke of the Chinese character to be drawn, and the point locations may include a point location of a center line of each stroke and a point location of a contour of each stroke. Referring to fig. 1, the point locations of the outline of each stroke may include a point location at the tip location, a point location at the midpoint location, and other point locations on the outline of each stroke. The point locations on the centerline of each stroke may be a point location at the midpoint of the centerline, a point location at one third, and other location points. The point location of the Chinese character to be drawn can be directly extracted from the open-source font library.
In the embodiment of the present disclosure, the current drawing point location refers to a point location corresponding to the current drawing location, and the current drawing location may be a location pointed by a user finger in fig. 1 or a location pointed by a drawing pen. Specifically, the electronic device monitors the current drawing position of the user in the drawing process in real time, determines the current drawing progress based on the current drawing position, and determines the current drawing point location pointed by the finger in fig. 3 by combining the point location of the center line of the current drawing stroke on the Chinese character to be drawn.
And S120, based on the position of the current drawing point, screening out two current contour point positions with the shortest distance to the current drawing point position from the predetermined contour point positions on two sides of the current drawing stroke.
In an embodiment of the present disclosure, the two-sided silhouette points include a point on a first side silhouette and a point on a second side silhouette of the currently drawn stroke. Specifically, a starting point position and an ending point position may be selected on the current contour, each point between the starting point position and the ending point position is used as a point on the first side contour, and each point between the ending point position and the starting point position is used as a point on the second side contour. For example, referring to fig. 1, the point of the upper half of the stroke to be drawn in fig. 1 is taken as the point of the first side outline, and the point of the lower half is taken as the point of the second side outline.
In the embodiment of the present disclosure, based on the position of the current drawing point location, a distance between any point location on the first side contour of the current drawing stroke and the current drawing point location is calculated, and a distance between any point location on the second side contour of the current drawing stroke and the current drawing point location is calculated, so that two current contour point locations closest to the current drawing point location are screened out from the contour point locations on both sides of the current drawing stroke based on the calculated distances.
S130, constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on two sides.
In the disclosed embodiment, S130 includes:
extracting starting point positions of contour point positions on two sides of the current drawn stroke;
and connecting the contour point positions on two sides between the starting point position and the current contour point position in sequence, and connecting the two current contour point positions with the current drawing point position to construct a drawing area of the current drawing stroke.
In the embodiment of the present disclosure, the start point position refers to a position of the first rendering point. Specifically, the two side contour points between the starting point location and the current contour point on the first side contour are connected, the two side contour points between the starting point location and the current contour point on the second side contour are connected, and the two current contour points are connected with the current drawing point location, so that the drawing region of the current drawing stroke is constructed, and the black region formed by the point locations in fig. 3 is obtained.
And S140, displaying the drawing area of the current drawing stroke.
In an embodiment of the present disclosure, the displaying the drawing area of the current drawing stroke includes: and filling the drawing area with a predefined color, so as to display the drawing area filled with the predefined color.
In the embodiment of the disclosure, the preset color of the drawing area can be obtained, when a user draws a Chinese character to be drawn, the drawing area can be determined in real time, the predefined color is filled in the drawing area, the drawing progress of the Chinese character to be drawn is displayed for the user in a personalized manner, and the drawing experience of the user is further improved.
The technical scheme provided by the embodiment of the disclosure includes that outline point positions on two sides of a current drawn stroke of a Chinese character to be drawn are predetermined, when a user draws the Chinese character to be drawn, the current drawn point position of the current drawn stroke on the Chinese character to be drawn is extracted, based on the position of the current drawn point position, two current outline point positions with the closest distance to the current drawn point position are screened out from the outline point positions on two sides of the predetermined current drawn stroke, the drawing area of the current drawn stroke can be quickly and accurately constructed based on the positions of the two current outline point positions, the position of the current drawn point position and the outline point positions on two sides, and the drawing area of the current drawn stroke is displayed, so that the drawing progress can be displayed to the user in real time and visually, the drawing experience of the user is improved, and the teaching requirement on a Chinese character line is met.
Fig. 4 is a schematic flow chart of another chinese character drawing and displaying method. Referring to fig. 4, the method includes:
s210, extracting point positions of the Chinese character to be drawn, wherein the point positions comprise point positions of the central line of each stroke and point positions of the outline of each stroke on the Chinese character to be drawn.
In the embodiment of the present disclosure, extracting point locations of chinese characters to be drawn includes:
s1: carrying out trend analysis on each stroke of the Chinese character to be drawn, and extracting a point position of the outline of each stroke of the Chinese character to be drawn;
s2: and matching each stroke of the Chinese character to be drawn with a pre-acquired standard stroke, and determining the point position of the central line of each stroke matched with the standard stroke based on the point position of the central line of the standard stroke.
With respect to step S1, performing trend analysis on each stroke may be understood as feature mental state analysis to determine a stroke front feature point, a start point, and an end point of each stroke, extract a plurality of feature points from the start point to the end point of each stroke, and extract a plurality of feature points from the extracted stroke front feature point, the start point, the end point, and the start point to the end point of each stroke as point points of the outline of the stroke.
With respect to step S2, a point location of a center line of a standard stroke is predetermined in the electronic device, and the standard stroke may include: the method comprises the steps of obtaining the point location of the central line of a standard stroke from an open-source font library, matching each stroke of a Chinese character to be drawn with the standard stroke, determining the standard stroke matched with each stroke, and determining the point location of the central line of each stroke matched with the standard stroke based on the point location of the central line of the standard stroke.
The method has the advantages that the point location of the outline of each stroke can be accurately determined by analyzing the trend of each stroke of the Chinese character to be drawn, the point location of the central line of each stroke can be accurately determined by matching each stroke with the pre-acquired standard strokes, the current drawing point location and the current outline point location can be accurately determined, the drawing area can be further determined, and the real drawing condition can be displayed for a user.
S220, determining a first side contour point position and a second side contour point position of each stroke of the Chinese character to be drawn based on the point position of the central line of the stroke and the point position of the contour of the stroke to obtain the two side contour point positions of each stroke of the Chinese character to be drawn.
In an embodiment of the present disclosure, a method for determining a first side silhouette point and a second side silhouette point includes:
a1, extracting the starting point position and the end point position of the central line of the stroke;
a2, based on the position of the starting point, screening out the first point position which is closest to the starting point from the outline points of the strokes, and based on the position of the ending point, screening out the second point position which is closest to the ending point from the outline points of the strokes;
a3, using all points from the first point to the second point as the first side contour point, and using all points from the second point to the first point as the second side contour point.
In the embodiment of the disclosure, the stroke drawing sequence of the Chinese character to be drawn can be predetermined, and the starting point position and the ending point position of the central line of the stroke are extracted based on the stroke drawing sequence. Then, based on the position of the starting point, calculating the distance between each contour point of the stroke and the starting point to screen out a first point closest to the starting point from the contour points of the stroke, and based on the position of the ending point, calculating the distance between each contour point of the stroke and the ending point to screen out a second point closest to the starting point from the contour points of the stroke; further, all the point locations between the first point location and the second point location are taken as first side contour point locations, and all the point locations between the second point location and the first point location are taken as second side contour point locations. For example, all the outline points of the upper half of the "horizontal" stroke in fig. 1 are taken as first side outline points, and all the outline points of the lower half are taken as first side outline points.
The starting point position and the end point position of the central line of the stroke are extracted, the first point position which is closest to the starting point position and the second point position which is closest to the end point position are extracted, outline points on two sides can be accurately determined, the follow-up accuracy of determining the current outline point position and the drawing area is improved, when the drawing area is displayed, the drawing progress of displaying Chinese characters can be accurately displayed for a user, the drawing experience of the user is improved, and the teaching requirement on the Chinese character line is met.
And S230, extracting the current drawing point position of the current drawing stroke on the Chinese character to be drawn.
S240, based on the position of the current drawing point, two current contour point positions with the shortest distance to the current drawing point position are screened out from the contour point positions on two sides of the predetermined current drawing stroke.
And S250, constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on two sides.
And S260, displaying the drawing area of the current drawing stroke.
In the embodiment of the disclosure, in order to show the real drawing situation of the user, the drawing deviation information and the sequence deviation information can be shown in real time.
In an optional embodiment, the method further comprises:
comparing the drawing region with a standard region of the current drawing stroke;
if the drawing area is inconsistent with the standard area, generating drawing deviation information based on the position of each point location on the drawing area and the position of each point location on the standard area;
and in the process of drawing the current drawing stroke, or after the current drawing stroke is drawn, displaying the drawing deviation information.
Specifically, a standard area of each stroke is obtained in advance, and the standard area refers to a standard area of each stroke meeting teaching requirements. In the process of drawing the Chinese characters, a drawing area of the current drawing stroke can be generated in real time, and the drawing area is compared with a standard area of the current drawing stroke; if the drawing area is inconsistent with the standard area, the drawing area generated in the drawing process is inconsistent with the teaching requirement, and drawing deviation information is generated based on the position of each point location on the drawing area and the position of each point location on the standard area, and the drawing deviation information may include: deviation position and information such as drawing improvement suggestions; further, based on the setting of the user, the drawing deviation information is displayed in the process of drawing the current drawing stroke, or the drawing deviation information is displayed after the current drawing stroke is drawn. Therefore, the drawing deviation information can be accurately generated and displayed to the user, so that the user can correct the drawing deviation information, the Chinese character drawing capability of the user is further improved, and the Chinese character teaching requirement is met.
In an optional embodiment, the method further comprises:
determining a current drawing sequence based on the position of the last drawing point location of the last drawn stroke and the position of the first drawing point location of the current drawn stroke;
comparing the current drawing sequence with the standard drawing sequence of the Chinese characters to be drawn;
and if the current drawing sequence is inconsistent with the standard drawing sequence, generating sequence deviation information, and displaying the sequence deviation information.
Specifically, a standard drawing sequence of the Chinese characters to be drawn is obtained in advance. The standard drawing sequence refers to the drawing sequence of each stroke meeting the teaching requirement. When a user draws a generation of a drawn Chinese character, a current drawing order may be determined based on a position of a last drawing point location of a last drawn stroke and a position of a first drawing point location of a current drawn stroke; then, comparing the current drawing sequence with the standard drawing sequence of the Chinese characters to be drawn, if the current drawing sequence is inconsistent with the standard drawing sequence of the Chinese characters to be drawn, the drawing sequence does not meet the teaching requirement in the drawing process, and generating drawing deviation information, wherein the drawing deviation information comprises information such as strokes with sequence deviation, deviation results, drawing improvement suggestions and the like; further, based on the setting of the user, after the current stroke is drawn, the sequence deviation information is displayed, or after the Chinese character to be drawn is drawn, the sequence deviation information is displayed. Therefore, the sequence deviation information can be accurately generated and displayed to the user, so that the user can correct the sequence deviation information, the Chinese character drawing capability of the user is further improved, and the Chinese character teaching requirement is met.
The following is an embodiment of the chinese character drawing and displaying device provided by the embodiment of the present invention, the device and the chinese character drawing and displaying method of the above embodiments belong to the same inventive concept, and details not described in detail in the embodiment of the chinese character drawing and displaying device may refer to the above embodiment of the chinese character drawing and displaying method.
As shown in fig. 5, the chinese character drawing and displaying apparatus includes: a point location extraction module 310, a point location filtering module 320, a drawing region construction module 330, and a drawing region presentation module 340.
The point location extracting module 310 is configured to extract a current drawing point location of a currently drawn stroke of a Chinese character to be drawn;
a point location screening module 320, configured to screen, based on the location of the current drawing point location, two current contour point locations closest to the current drawing point location from contour point locations on two sides of a predetermined current drawing stroke;
a drawing region constructing module 330, configured to construct a drawing region of the current drawing stroke based on the positions of the two current contour point locations, the position of the current drawing point location, and the contour point locations on both sides;
and a drawing area display module 340, configured to display the drawing area of the current drawing stroke.
The technical scheme provided by the embodiment of the disclosure includes that outline point positions on two sides of a current drawn stroke of a Chinese character to be drawn are predetermined, when a user draws the Chinese character to be drawn, the current drawn point position of the current drawn stroke on the Chinese character to be drawn is extracted, based on the position of the current drawn point position, two current outline point positions with the closest distance to the current drawn point position are screened out from the outline point positions on two sides of the predetermined current drawn stroke, the drawing area of the current drawn stroke can be quickly and accurately constructed based on the positions of the two current outline point positions, the position of the current drawn point position and the outline point positions on two sides, and the drawing area of the current drawn stroke is displayed, so that the drawing progress can be displayed to the user in real time and visually, the drawing experience of the user is improved, and the teaching requirement on a Chinese character line is met.
Optionally, the apparatus further comprises: two side contour point extraction modules; wherein, both sides profile point location extraction module includes: a point location extraction unit and a contour point location extraction unit of the Chinese character to be drawn;
the point location extraction unit is used for extracting point locations of the Chinese characters to be drawn, wherein the point locations comprise point locations of the central line of each stroke and point locations of the outline of each stroke on the Chinese characters to be drawn;
and the contour point position extraction unit is used for determining a first side contour point position and a second side contour point position of each stroke of the Chinese character to be drawn based on the point position of the central line of the stroke and the point position of the contour of the stroke to obtain the contour point positions on two sides of each stroke of the Chinese character to be drawn.
Optionally, the point location extracting unit of the Chinese character to be drawn is specifically configured to perform trend analysis on each stroke of the Chinese character to be drawn, and extract a point location of a contour of each stroke of the Chinese character to be drawn;
and matching each stroke of the Chinese character to be drawn with a pre-acquired standard stroke, and determining the point position of the central line of each stroke matched with the standard stroke based on the point position of the central line of the standard stroke.
Optionally, the contour point location extracting unit is specifically configured to extract a starting point location and an ending point location of a center line of the stroke;
based on the position of a starting point, screening out a first point position which is closest to the starting point from the outline points of the strokes, and based on the position of an end point, screening out a second point position which is closest to the end point from the outline points of the strokes;
and taking all the point locations between the first point location and the second point location as the first side contour point location, and taking all the point locations between the second point location and the first point location as the second side contour point location.
Optionally, the drawing region constructing module 330 is specifically configured to extract starting point positions of contour point positions on two sides of the current drawing stroke;
and connecting the contour point positions on two sides between the starting point position and the current contour point position in sequence, and connecting the two current contour point positions with the current drawing point position to construct a drawing area of the current drawing stroke.
Optionally, the drawing region displaying module 340 is specifically configured to fill the drawing region with a predefined color, so as to display the drawing region filled with the predefined color.
Optionally, the apparatus further comprises: the system comprises a drawing region comparison module and a drawing deviation information generation module;
the drawing area comparison module is used for comparing the drawing area with a standard area of the current drawing stroke;
a drawing deviation information generating module, configured to generate drawing deviation information based on a position of each point location on the drawing area and a position of each point location on the standard area if the drawing area is inconsistent with the standard area;
the drawing region displaying module 340 is further configured to display the drawing deviation information during the process of drawing the current drawing stroke, or after the current drawing stroke is drawn.
Optionally, the apparatus further comprises: the device comprises a current drawing sequence determining module and a drawing sequence comparing module;
a current drawing order determination module for determining a current drawing order based on a position of a last drawing point location of a last drawn stroke and a position of a first drawing point location of a current drawn stroke;
the drawing sequence comparison module is used for comparing the current drawing sequence with the standard drawing sequence of the Chinese characters to be drawn;
the drawing region displaying module 340 is further configured to generate sequence deviation information and display the sequence deviation information if the current drawing sequence is inconsistent with the standard drawing sequence.
The following is an embodiment of the electronic device provided in the embodiments of the present invention, the electronic device and the chinese character drawing and displaying method in the embodiments described above belong to the same inventive concept, and details that are not described in detail in the embodiments of the electronic device may refer to the embodiments of the chinese character drawing and displaying method described above.
Referring to fig. 6, the present embodiment provides an electronic device 600, which includes: one or more processors 620; the storage device 610 is used for storing one or more programs, and when the one or more programs are executed by the one or more processors 620, the one or more processors 620 implement the chinese character drawing and displaying method provided by the embodiment of the present invention, including:
extracting a current drawing point position of a current drawing stroke on a Chinese character to be drawn;
based on the position of the current drawing point location, two current contour point locations with the closest distance to the current drawing point location are screened out from contour point locations on two sides of a predetermined current drawing stroke;
constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides;
and displaying the drawing area of the current drawing stroke.
Of course, those skilled in the art can understand that the processor 620 may also implement the technical solution of the chinese character drawing display method provided in any embodiment of the present invention.
The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 includes a processor 620, a storage device 610, an input device 630, and an output device 640; the number of the processors 620 in the device may be one or more, and one processor 620 is taken as an example in fig. 6; the processor 620, the storage means 610, the input means 630 and the output means 640 in the device may be connected by a bus or other means, as exemplified by the bus connection in fig. 6.
The storage device 610, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the chinese character drawing presentation method in the embodiment of the present invention (for example, the point location extracting module 310, the point location filtering module 320, the drawing region constructing module 330, and the drawing region presenting module 340 in the chinese character drawing presentation device).
The storage device 610 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. In addition, the storage 610 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage 610 may further include memory located remotely from the processor 620, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the device, and may include at least one of a mouse, a keyboard, and a touch screen, for example. The output device 640 may include a display device such as a display screen.
The following is an embodiment of a computer-readable storage medium provided in an embodiment of the present invention, the computer-readable storage medium and the chinese character drawing display method in the foregoing embodiments belong to the same inventive concept, and details that are not described in detail in the embodiment of the computer-readable storage medium may refer to the above embodiment of the chinese character drawing display method.
The present embodiments provide a storage medium containing computer-executable instructions which, when executed by a computer processor, perform a method of chinese character rendering presentation, the method comprising:
extracting a current drawing point position of a current drawing stroke on a Chinese character to be drawn;
based on the position of the current drawing point location, two current contour point locations with the closest distance to the current drawing point location are screened out from contour point locations on two sides of a predetermined current drawing stroke;
constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides;
and displaying the drawing area of the current drawing stroke.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the above-described method operations, and may also perform related operations in the chinese character drawing and displaying method provided by any embodiments of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, where the computer software product may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute the chinese character drawing display method provided in the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (9)
1. A Chinese character drawing and displaying method is characterized by comprising the following steps:
extracting point locations of the Chinese character to be drawn, wherein the point locations comprise point locations of the central line of each stroke and point locations of the outline of each stroke on the Chinese character to be drawn;
determining a first side contour point position and a second side contour point position of each stroke of the Chinese character to be drawn based on the point position of the central line of the stroke and the point position of the contour of the stroke to obtain the two side contour point positions of each stroke of the Chinese character to be drawn;
extracting a current drawing point position of a current drawing stroke on the Chinese character to be drawn;
based on the position of the current drawing point location, two current contour point locations with the closest distance to the current drawing point location are screened out from contour point locations on two sides of a predetermined current drawing stroke;
extracting a starting point position and an end point position of the central line of the stroke;
based on the position of a starting point, screening out a first point position which is closest to the starting point from the outline points of the strokes, and based on the position of an end point, screening out a second point position which is closest to the end point from the outline points of the strokes;
taking all the point locations between the first point location and the second point location as the first side contour point location, and taking all the point locations between the second point location and the first point location as the second side contour point location;
and displaying the drawing area of the current drawing stroke.
2. The method of claim 1, wherein the extracting the point locations of the chinese characters to be drawn comprises:
carrying out trend analysis on each stroke of the Chinese character to be drawn, and extracting a point position of the outline of each stroke of the Chinese character to be drawn;
and matching each stroke of the Chinese character to be drawn with a pre-acquired standard stroke, and determining the point position of the central line of each stroke matched with the standard stroke based on the point position of the central line of the standard stroke.
3. The method of claim 1, wherein constructing a rendering region of a current rendering stroke based on the locations of the two current silhouette points, the location of the current rendering point location, and the two silhouette points comprises:
extracting starting point positions of contour point positions on two sides of the current drawn stroke;
and connecting the contour point positions on two sides between the starting point position and the current contour point position in sequence, and connecting the two current contour point positions with the current drawing point position to construct a drawing area of the current drawing stroke.
4. The method of claim 1, wherein said exposing a drawing area of said current drawing stroke comprises:
and filling the drawing area with a predefined color, so as to display the drawing area filled with the predefined color.
5. The method of claim 1, further comprising:
comparing the drawing region with a standard region of the current drawing stroke;
if the drawing area is inconsistent with the standard area, generating drawing deviation information based on the position of each point location on the drawing area and the position of each point location on the standard area;
and in the process of drawing the current drawing stroke, or after the current drawing stroke is drawn, displaying the drawing deviation information.
6. The method of claim 1, further comprising:
determining a current drawing sequence based on the position of the last drawing point location of the last drawn stroke and the position of the first drawing point location of the current drawn stroke;
comparing the current drawing sequence with the standard drawing sequence of the Chinese characters to be drawn;
and if the current drawing sequence is inconsistent with the standard drawing sequence, generating sequence deviation information, and displaying the sequence deviation information.
7. A Chinese character drawing and displaying device is characterized by comprising:
two side contour point extraction modules;
the two-side contour point extraction module comprises: a point location extraction unit and a contour point location extraction unit of the Chinese character to be drawn;
the point location extraction unit is used for extracting point locations of the Chinese characters to be drawn, wherein the point locations comprise point locations of the central line of each stroke and point locations of the outline of each stroke on the Chinese characters to be drawn;
the outline point location extraction unit is used for determining a first side outline point location and a second side outline point location of each stroke of the Chinese character to be drawn based on the point location of the central line of the stroke and the point location of the outline of the stroke to obtain the outline point locations on two sides of each stroke of the Chinese character to be drawn;
the point location extraction module is used for extracting the current drawing point location of the current drawing stroke on the Chinese character to be drawn;
the point location screening module is used for screening two current contour point locations which are closest to the current drawing point location from contour point locations on two sides of a predetermined current drawing stroke based on the position of the current drawing point location;
the drawing area construction module is used for constructing a drawing area of the current drawing stroke based on the positions of the two current contour point positions, the position of the current drawing point position and the contour point positions on the two sides;
the drawing area display module is used for displaying the drawing area of the current drawing stroke;
the drawing region construction module is specifically used for extracting a starting point position and an end point position of the central line of the stroke;
based on the position of a starting point, screening out a first point position which is closest to the starting point from the outline points of the strokes, and based on the position of an end point, screening out a second point position which is closest to the end point from the outline points of the strokes;
and taking all the point locations between the first point location and the second point location as the first side contour point location, and taking all the point locations between the second point location and the first point location as the second side contour point location.
8. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of chinese character rendering presentation of any of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing a chinese character rendering presentation method as claimed in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110562537.7A CN113034649B (en) | 2021-05-24 | 2021-05-24 | Chinese character drawing and displaying method and device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110562537.7A CN113034649B (en) | 2021-05-24 | 2021-05-24 | Chinese character drawing and displaying method and device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113034649A CN113034649A (en) | 2021-06-25 |
CN113034649B true CN113034649B (en) | 2021-09-10 |
Family
ID=76455703
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110562537.7A Active CN113034649B (en) | 2021-05-24 | 2021-05-24 | Chinese character drawing and displaying method and device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113034649B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113641288B (en) * | 2021-10-10 | 2022-02-25 | 北京易言科技有限公司 | Chinese character splicing and adjusting method and device based on Chinese character composition units |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102542264A (en) * | 2011-12-22 | 2012-07-04 | 北京语言大学 | Method and device for automatically evaluating right and wrong of Chinese character writing on basis of digital handwriting equipment |
-
2021
- 2021-05-24 CN CN202110562537.7A patent/CN113034649B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102542264A (en) * | 2011-12-22 | 2012-07-04 | 北京语言大学 | Method and device for automatically evaluating right and wrong of Chinese character writing on basis of digital handwriting equipment |
Non-Patent Citations (2)
Title |
---|
"Outline Font Handler for Industrial Robots";Maki K. Habib 等;《Proceedings of 2018 IEEE International Conference on Mechatronics and Automation》;20180808;全文 * |
"一种基于NAO机器人软笔书法手写的研究";黄寅光;《中国优秀硕士学位论文全文数据库(电子期刊)信息科技辑》;20210115;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113034649A (en) | 2021-06-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109766053B (en) | User interface display method, device, terminal and storage medium | |
CN110096277B (en) | Dynamic page display method and device, electronic equipment and storage medium | |
CN108932053B (en) | Drawing method and device based on gestures, storage medium and computer equipment | |
CN112115678B (en) | Information display method and device, storage medium and electronic equipment | |
CN107943363B (en) | Background image configuration method and device, interactive intelligent panel and storage medium | |
CN110795177B (en) | Graph drawing method and device | |
WO2022105005A1 (en) | Smart classroom information exchange method, apparatus, and electronic device | |
CN106598410B (en) | Display methods, device and the terminal device of e-book | |
JP2012058947A (en) | Translation device, translation method, computer program and storage medium | |
CN112449230B (en) | Character string display processing method, device, terminal and storage medium | |
CN112783595A (en) | Display method and device for interactive writing and electronic equipment | |
CN113034649B (en) | Chinese character drawing and displaying method and device, electronic equipment and medium | |
WO2017000898A1 (en) | Software icon display method and apparatus | |
CN117576388A (en) | Image processing method and device, storage medium and electronic equipment | |
CN108572776B (en) | Rendering processing method, device and equipment based on special characters and storage medium | |
CN112764606A (en) | Identification display method and device and electronic equipment | |
WO2020124454A1 (en) | Font switching method and related product | |
CN114339373B (en) | Queue barrage generation method and device, storage medium and equipment | |
CN114925656A (en) | Rich text display method, device, equipment and storage medium | |
WO2022105004A1 (en) | Method and apparatus for electronizing written form, and electronic device | |
CN111857499B (en) | Information prompting method and device | |
CN117930995B (en) | Text drawing method and device | |
CN118228689A (en) | Visual font editing method, operating system, control device and storage medium | |
US20230237253A1 (en) | Method and apparatus for managing interface, device and readable storage medium | |
CN113900758A (en) | Content display method, content display device, computer equipment and computer-readable storage medium |
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 |