CN114296584A - Drawing processing method and device - Google Patents
Drawing processing method and device Download PDFInfo
- Publication number
- CN114296584A CN114296584A CN202111615263.XA CN202111615263A CN114296584A CN 114296584 A CN114296584 A CN 114296584A CN 202111615263 A CN202111615263 A CN 202111615263A CN 114296584 A CN114296584 A CN 114296584A
- Authority
- CN
- China
- Prior art keywords
- line
- area
- graph
- coordinates
- sampling point
- 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.)
- Pending
Links
Images
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a drawing processing method and device, and belongs to the technical field of data processing. The drawing processing method comprises the following steps: acquiring a first line and a second line drawn in a drawing area; the first line and the second line are two separated lines adjacent in drawing time; and displaying a third line formed by connecting the first line and the second line in the drawing area under the condition that the first line and the second line are separated from each other by the same line.
Description
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a drawing processing method and device.
Background
With the development of screen technology, touch screens have been widely applied to electronic devices, and users can use electronic devices conveniently to a great extent.
One of the convenient operations brought to the user by the touch screen is: the user can draw the text information to be input in the handwriting input area of the electronic equipment in a handwriting mode, and the input mode provides convenience for information input for the user who does not use the pinyin input method. In addition, the convenient operation brought to the user by the touch screen can further comprise: drawing is performed through the touch screen, so that the electronic equipment meets the drawing requirements of users.
However, in the process of inputting on the touch screen by the user, the condition of broken drawing strokes may occur due to misoperation and the like, and the integrity of the input is affected.
Disclosure of Invention
The embodiment of the application aims to provide a drawing processing method and device, and the problem that in the prior art, when a graph is drawn through a touch screen, a graph line is disconnected due to drawing errors can be solved.
In a first aspect, an embodiment of the present application provides a method for processing a drawing, where the method includes:
acquiring a first line and a second line drawn in a drawing area; the first line and the second line are two separated lines adjacent in drawing time;
and displaying a third line formed by connecting the first line and the second line in the drawing area under the condition that the first line and the second line are separated from each other by the same line.
In a second aspect, an embodiment of the present application provides a graphics processing apparatus, including:
the acquisition module is used for acquiring a first line and a second line which are drawn in the drawing area; the first line and the second line are two separated lines adjacent in drawing time;
and the display module is used for displaying a third line formed after the first line and the second line are connected in the drawing area under the condition that the first line and the second line are separated from each other.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps in the drawing processing method according to the first aspect.
In a fourth aspect, the present application provides a readable storage medium, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the program or instructions implement the steps in the drawing processing method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the drawing processing method according to the first aspect.
In a sixth aspect, the present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the drawing processing method according to the first aspect.
In the embodiment of the application, the electronic equipment can automatically perform line repairing under the condition that the two lines are determined to be separated from the same line, connect the two lines, and display the connected lines in the drawing area, so that firstly, drawing errors can be made up, and the integrity of the graph is improved; secondly, the operation of manually repairing the line by a user can be saved; and thirdly, under the condition that the user does not sense the disconnection of the lines, the lines can be repaired, and the problem that the lines are not used to draw in the drawing process is reduced.
Drawings
Fig. 1 is a schematic flow chart diagram illustrating a graphics processing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a folding screen provided in an embodiment of the present application;
fig. 3 is a second schematic structural diagram of a foldable screen according to an embodiment of the present application;
fig. 4 is a third schematic structural diagram of a foldable screen according to an embodiment of the present application;
fig. 5 is a schematic block diagram of a graphics processing apparatus provided in an embodiment of the present application;
FIG. 6 is a block diagram of an electronic device provided by an embodiment of the application;
fig. 7 is a second schematic block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in other sequences than those illustrated or otherwise described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense to distinguish one object from another, and not necessarily to limit the number of objects, e.g., the first object may be one or more. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The following describes in detail the drawing processing method provided in the embodiments of the present application with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a schematic flow chart of a drawing processing method according to an embodiment of the present disclosure, where the drawing processing method is applied to an electronic device with a touch screen, such as a mobile phone, a tablet computer, and a notebook computer.
The drawing processing method may include:
step 101: a first line and a second line drawn in a drawing area are acquired.
The first line and the second line in this step are two separate lines adjacent to each other in drawing time, that is, no other line is drawn in a time period between the drawing times of the two lines. For example, when the drawing start time is counted as 0 second, the drawing time of the first line is 12 seconds to 14 seconds, the drawing time of the second line is 15 seconds to 16 seconds, and no line is drawn between 14 seconds to 15 seconds, the drawing time is: 12 to 14 seconds and plot time: 15-16 seconds, which are adjacent drawing time, and the first line and the second line are two separated lines adjacent to the drawing time.
The drawing area described in this step may include, but is not limited to: for inputting text information into a handwriting input area in an electronic device (e.g., a handwriting input area in an input method application), a drawing area (e.g., a canvas area in a drawing board application), etc.
Step 102: and under the condition that the first line and the second line are separated from each other, displaying a third line formed by connecting the first line and the second line in the drawing area.
When a user draws a graph, the separation of some lines is intended by the user, for example, when a Chinese character 'three' graph is drawn in a handwriting input area of an input method application, in order to enable the input method application to more accurately recognize the graph, the user draws three superimposed and separated lines in the handwriting input area. However, sometimes the separation between lines may be caused by drawing errors, for example, a user writes characters in a handwriting input area in an input method application in a running vehicle, but due to vehicle jolt, a touch body (such as a finger, a touch pen, etc.) is unstable, and an original stroke is disconnected to form two strokes, in this case, the separation between lines is caused by the drawing errors, which may affect the accuracy of the input method application for the user to recognize the written characters, resulting in character recognition errors, and for this reason, the user may need to manually repair the lines to avoid the occurrence of character recognition errors.
In view of the foregoing problems, in the embodiment of the present application, when it is determined that two lines are separated from the same line (that is, separated due to a drawing error), the electronic device may automatically perform line repairing, connect the two lines, and display the connected lines in the drawing area, so that firstly, the drawing error may be compensated, and the integrity of the graph may be improved; secondly, the operation of manually repairing the line by a user can be saved; and thirdly, the lines can be repaired under the condition that the user does not sense the disconnection of the lines, the problem that the lines are not used during drawing is reduced, and the use experience of the user is improved. The technical scheme provided by the embodiment of the application can improve the accuracy of text and graphic recognition especially under the condition of inputting text information through a handwriting input area.
Wherein the drawing error may include: at least one of a user-induced drawing error and an electronic device-induced drawing error. The following explains a drawing error caused by an electronic device as an example.
As an alternative embodiment, at step 102: in a case where it is determined that the first line and the second line are separated from each other, before a third line formed by connecting the first line and the second line is displayed in the drawing area, the drawing processing method may further include:
determining a target area according to the foldable area and the drawing area of the screen; obtaining drawing tracks of a first line and a second line; determining whether the first line and the second line meet preset conditions or not according to the target area and the drawing track; under the condition that the first line and the second line meet preset conditions, acquiring a first graph and a second graph; and determining that the first line and the second line are separated from the same line based on the first graph and the second graph.
The target area may be an area determined according to an overlapping area of the screen foldable area and the drawing area, and the target area includes the overlapping area, that is, the overlapping area may be the same area as the target area or a local area in the target area.
Wherein the first graph is a graph included in the drawing area when the first line is separated from the second line; the second pattern is a pattern included in the drawing region when the first line and the second line are connected.
Along with the pursuit of a user on a large screen, the folding screen is produced, and the user can fold or unfold the folding screen so as to meet the use requirements of the user on screens with different sizes. Some of the foldable screens are foldable in a fixed position, such as the foldable screen shown in fig. 2, and the middle area 201 (i.e., the area outlined by the dashed line) of the foldable screen is a foldable area. For such a folding screen, since the foldable area is a connection area of two screens and needs to support a flexible and foldable function, when the screen is completely unfolded, there may be a problem that the foldable area is not in the same horizontal plane as other areas of the screen, resulting in unevenness of the entire screen. Therefore, when a graph is drawn on the touch screen, the touch body cannot contact the screen area when the middle section of one line is drawn due to the fact that the screen is not flat, so that the line is broken, and the problem of two independent lines is solved. For a scene of inputting text information in a handwriting mode, due to stroke breakage, a recognition result of the handwriting input text information is likely to be influenced, and a situation of recognition error occurs.
For the folding screen of the type mentioned above, the position of the foldable area is fixed, so that when the drawing area draws a figure, the area (i.e. the target area) where the drawing line is easy to break can be determined according to the foldable area of the screen and the drawing area. As shown in fig. 3, the folding screen includes a first screen 301 and a second screen 302, and the first screen 301 and the second screen 302 are connected by a foldable area 303. Fig. 3 shows 304 a handwriting input area (i.e., drawing area) in the input method application. As shown in fig. 3, the overlapping area 305 between the foldable area 303 and the handwriting input area 304 is an area where a line is likely to be broken when drawing a graphic, and therefore the overlapping area 305 can be determined as a drawing line breaking-prone area (i.e., a target area). Further, since there may be a problem of screen unevenness also in the vicinity of the overlap area 305, that is, there may be a problem of line breakage due to screen unevenness when lines are drawn in the vicinity of the overlap area 305, the range of the line-drawing easy-to-break area may be expanded on the basis of the overlap area 305, for example, an area where the overlap area 305 is expanded by a preset multiple (a value greater than 1) may be determined as the line-drawing easy-to-break area, as shown at 306 in fig. 3, which reduces the occurrence of a missed judgment. The specific expansion multiple can be determined according to the actual situation of the screen, and the implementation of the application does not limit the specific expansion multiple.
Alternatively, the coordinate region of the drawing line easily-breaking region may be determined based on the screen coordinate system according to a first coordinate region of the drawing region in the screen coordinate system and a second coordinate region of the screen foldable region in the screen coordinate system. For example, if the screen coordinate system uses the lower left corner of the screen as the origin (0, 0), the range of the abscissa of the foldable area 303 is: 1100-1300, the ordinate range is: 0 to 2000; input method application the defined abscissa range of handwriting input area 304: 10-2300, the ordinate range is: 900 — 1500, the abscissa range of the easy-to-break area of the drawn line (i.e. the overlap area 305) can be determined as: 1100-1300, the ordinate range is: 900-1500.
As can be seen from the above, in the embodiment of the present application, it can be determined whether two separate lines are possibly caused by unevenness of the foldable area of the screen based on the easy-to-break area of the drawn line and the drawing track of the line, that is: determining whether the first line and the second line meet a preset condition according to the target area, the drawing track of the first line and the drawing track of the second line, wherein the implementation manner of the determination method may be as follows:
the step of determining whether the first line and the second line satisfy the preset condition according to the target area and the drawing trajectory may include:
acquiring the coordinates of the last first sampling point in the drawing track of the first line and the coordinates of the first second sampling point in the drawing track of the second line; and under the condition that the coordinates of the last first sampling point of the first line and the coordinates of the first second sampling point of the second line are both located in the target area in the drawing area, determining that the first line and the second line meet the preset condition.
The coordinates of the first sampling point are acquired in the drawing process of the first line, and the coordinates of the second sampling point are acquired in the drawing process of the second line.
When a user draws a graph in the drawing area, the electronic equipment can sample the drawn lines to obtain drawing track information of the lines. For example, the drawing trace information obtained by sampling the line a and the line B in fig. 4 may be as follows: [[1019,1211,0],[1079,1204,77],[1141,1166,94],[1184,1147,110],[1200,1148,127],[1200,1148,128],[ -1,0,128],[ -1, -1,128],[1380,1086,283],[1382,1134,345],[1382,1200,361],[1382,1248,377],[1382,1275,394],[1382,1275,395],[ -1,0,395],[ -1, -1,395]]. And every three numbers form a group and respectively represent the x position of an abscissa, the y position of an ordinate and the sampling time t of the touch body contacting the screen. When the touch body is separated from the screen and then contacted again, the division symbols [ -1,0, t ], [ -1, -1, t ] are recorded, and therefore, the sample point coordinates of the line a are the sample point coordinates before the division symbols [ -1,0,128] and [ -1, -1,128] in the drawing trace information, and the sample point coordinates of the line B are the sample point coordinates after the division symbols [ -1,0,128] and [ -1, -1,128] and before the division symbols [ -1,0,395] and [ -1, -1,395] in the drawing trace information. The segmentation symbol can be set according to actual requirements, and is not limited to [ -1,0, t ], [ -1, -1, t ]. The first sampling point coordinate is a coordinate point where the touch body is detected to start to contact the screen, and the sampling time is recorded as 0. The coordinates of the second sampling point are coordinate points of the touch body which is detected to start moving on the screen.
For the line a and the line B adjacent to each other in the drawing time, if the last sampling point coordinate [1200,1148,128] of the line a and the first sampling point coordinate [1380,1086,283] of the line B are both located in the easy-to-break area (the abscissa range is 1000-.
In the embodiment of the present application, in a case that coordinates of a last first sampling point of a first line and coordinates of a first second sampling point of a second line are both located in a target area in a drawing area, it is considered that two separated lines may be caused by unevenness of a foldable area of a screen, and then a first graph and a second graph may be obtained, and a reason for separating the two lines is further determined based on the first graph and the second graph, which may be specifically implemented as follows:
the step of determining that the first line and the second line are separated from each other based on the first graph and the second graph may include:
identifying the first graph to obtain a first identification result; identifying the second graph to obtain a second identification result; and under the condition that the recognition probability of the second recognition result is greater than that of the first recognition result, determining that the first line and the second line are separated from the same line.
In this application embodiment, to the lines of two adjacent separation of drawing time, when confirming whether two line separations are for being obtained by same line separation, can distinguish the figure before and after first line and the second line connection respectively earlier, promptly: when the first line and the second line are not connected (namely, separated), identifying the graph of the drawing area to obtain an identification result (namely, a first identification result); and when the first line is connected with the second line, identifying the graph of the drawing area to obtain an identification result (namely a second identification result). When the electronic device identifies the graph, the final identification result may be determined according to the probability value, for example, the identification result corresponding to the maximum identification probability is used as the final identification result. The greater the recognition probability is, the greater the probability that the graph is the recognition result is, and conversely, the smaller the recognition probability is, the smaller the probability that the graph is the recognition result is, so in the embodiment of the present application, it may be determined whether the two lines are separated by the same line according to the recognition probability of the recognition result.
Assuming that the drawing area only includes a first line and a second line, when the first line and the second line are not connected, recognizing the graph of the drawing area, and obtaining a recognition result as follows: the figure is an exclamation mark, and the corresponding recognition probability is 0.6; when the first line is connected with the second line, the graph of the drawing area is identified, and the obtained identification result is as follows: the figure is the number 1, and the corresponding recognition probability is 0.9, and obviously, the probability that the figure is the number 1 is greater than the probability that the figure is the exclamation mark, that is, the probability that the figure of the drawing area is the number 1 is higher, which indicates that the first line and the second line are separated by the same line.
As an alternative embodiment, at step 102: before a third line formed by connecting the first line and the second line is displayed in the drawing area, the drawing processing method may further include:
and fitting the first line and the second line according to the M sampling point coordinates of the first line and the N sampling point coordinates of the second line to generate a third line.
And the coordinates of the M sampling points of the first line and the coordinates of the N sampling points of the second line are acquired in the drawing process of the lines.
In the embodiment of the application, the first line and the second line can be fitted according to the coordinates of the sampling points of the first line and the second line in the drawing process, so that the two lines are connected to generate the third line. Specifically, the first line and the second line may be fitted through a preset algorithm, where the preset algorithm may include: at least one of a curve fitting algorithm and a uniform resampling algorithm.
For example, the coordinates of the sampling points of the first line and the second line may be spliced together to form a curve, and the blank area between the first line and the second line is filled up by a curve fitting algorithm (e.g., bezier curve fitting algorithm) to obtain a third line. For another example, the first line and the second line may be uniformly resampled according to the coordinates of the sampling points of the first line and the second line, so that a blank area between the first line and the second line is filled, and a third line is obtained.
As can be seen from the foregoing description, in the embodiment of the present application, when it is determined that two lines are separated from each other, the electronic device may automatically perform line repairing, connect the two lines, and display a third line formed after the connection in the drawing area, so that firstly, a drawing error may be compensated, and the integrity of the graph may be improved; secondly, the operation of manually repairing the line by a user can be saved; and thirdly, under the condition that the user does not sense the disconnection of the lines, the lines can be repaired, and the problem that the lines are not used to draw in the drawing process is reduced.
In the drawing processing method provided in the embodiment of the present application, the execution main body may be a drawing processing apparatus, or a control module for executing the drawing processing method in the drawing processing apparatus. The embodiment of the present application describes a graphics processing apparatus provided in the embodiment of the present application by taking the graphics processing apparatus as an example to execute a graphics processing method.
Fig. 5 is a schematic block diagram of a graphics processing apparatus according to an embodiment of the present disclosure, where the graphics processing apparatus is applied to an electronic device with a touch screen, such as a mobile phone, a tablet computer, and a notebook computer.
As shown in fig. 5, the drawing processing apparatus may include:
an obtaining module 501 is configured to obtain a first line and a second line drawn in a drawing area.
The first line and the second line are two separated lines adjacent to each other in drawing time.
A display module 502, configured to display a third line formed after the first line and the second line are connected in the drawing area when it is determined that the first line and the second line are separated from each other.
Optionally, the apparatus may further include:
and the first determining module is used for determining a target area according to the screen foldable area and the drawing area.
Wherein the target area is an area determined according to an overlapping area of the screen foldable area and the drawing area, and the target area includes the overlapping area.
And the second acquisition module is used for acquiring the drawing tracks of the first line and the second line.
And the second determining module is used for determining whether the first line and the second line meet preset conditions according to the target area and the drawing track.
And the third acquisition module is used for acquiring the first graph and the second graph under the condition that the first line and the second line meet preset conditions.
Wherein the first graphic is a graphic included in the drawing region when the first line is separated from the second line; the second pattern is a pattern included in the drawing region when the first line and the second line are connected.
And the third determining module is used for determining that the first line and the second line are separated from the same line based on the first graph and the second graph.
Optionally, the second determining module includes:
and the acquisition unit is used for acquiring the coordinates of the last first sampling point in the drawing track of the first line and the coordinates of the first second sampling point in the drawing track of the second line.
The coordinates of the first sampling point are acquired in the drawing process of the first line, and the coordinates of the second sampling point are acquired in the drawing process of the second line.
A first determining unit, configured to determine that the first line and the second line satisfy a preset condition when the first sampling point coordinate and the second sampling point coordinate are both located in the target area.
Optionally, the third determining module includes:
and the first recognition unit is used for recognizing the first graph to obtain a first recognition result.
And the second recognition unit is used for recognizing the second graph to obtain a second recognition result.
A second determining unit, configured to determine that the first line and the second line are separated from each other by the same line when the recognition probability of the second recognition result is greater than the recognition probability of the first recognition result.
Optionally, the apparatus further comprises:
and the generating module is used for fitting the first line and the second line according to the M sampling point coordinates of the first line and the N sampling point coordinates of the second line to generate the third line.
The coordinates of the M sampling points are acquired in the drawing process of the first line, the coordinates of the N sampling points are acquired in the drawing process of the second line, and M and N are positive integers.
In the embodiment of the application, the electronic equipment can automatically perform line repairing under the condition that the two lines are determined to be separated from the same line, connect the two lines, and display a third line formed after connection in the drawing area, so that firstly, drawing errors can be made up, and the integrity of the graph is improved; secondly, the operation of manually repairing the line by a user can be saved; and thirdly, under the condition that the user does not sense the disconnection of the lines, the lines can be repaired, and the problem that the lines are not used to draw in the drawing process is reduced.
The drawing processing device in the embodiment of the present application may be an electronic device, and may also be a component in the electronic device, for example, an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The drawing processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The drawing processing device provided in the embodiment of the present application can implement each process implemented by the drawing processing method embodiment shown in fig. 1, and is not described here again to avoid repetition.
Optionally, as shown in fig. 6, an embodiment of the present application further provides an electronic device 600, including: the processor 601, the memory 602, and the memory 602 are stored with a program or an instruction that can be executed on the processor 601, and when the program or the instruction is executed by the processor 601, the steps of the embodiment of the drawing processing method are implemented, and the same technical effect can be achieved.
It should be noted that the electronic device 600 in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 700 includes, but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, and a processor 710.
Those skilled in the art will appreciate that the electronic device 700 may also include a power supply (e.g., a battery) for powering the various components, and the power supply may be logically coupled to the processor 710 via a power management system, such that the functions of managing charging, discharging, and power consumption may be performed via the power management system. The electronic device structure shown in fig. 7 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein, the processor 710 may be configured to: acquiring a first line and a second line drawn in a drawing area; and in the case that it is determined that the first line and the second line are separated from each other, a third line formed by connecting the first line and the second line is displayed in the drawing area through the display unit 706. The first line and the second line are two separated lines adjacent to each other in drawing time.
Optionally, the processor 710 may be further configured to: determining a target area according to the screen foldable area and the drawing area; obtaining drawing tracks of the first line and the second line; determining whether the first line and the second line meet preset conditions or not according to the target area and the drawing track; under the condition that the first line and the second line meet preset conditions, acquiring a first graph and a second graph; determining that the first line and the second line are separated by the same line based on the first graph and the second graph. Wherein the target area is an area determined according to an overlapping area of the screen foldable area and the drawing area, and the target area comprises the overlapping area; the first graph is a graph included in the drawing region when the first line is separated from the second line; the second pattern is a pattern included in the drawing region when the first line and the second line are connected.
Optionally, the processor 710 may be further configured to: acquiring the coordinates of the last first sampling point in the drawing track of the first line and the coordinates of the first second sampling point in the drawing track of the second line; and under the condition that the coordinates of the first sampling point and the coordinates of the second sampling point are both located in the target area, determining that the first line and the second line meet a preset condition. The coordinates of the first sampling point are acquired in the drawing process of the first line, and the coordinates of the second sampling point are acquired in the drawing process of the second line.
Optionally, the processor 710 may be further configured to: identifying the first graph to obtain a first identification result; identifying the second graph to obtain a second identification result; and under the condition that the recognition probability of the second recognition result is greater than that of the first recognition result, determining that the first line and the second line are separated from the same line.
Optionally, the processor 710 may be further configured to: and fitting the first line and the second line according to the M sampling point coordinates of the first line and the N sampling point coordinates of the second line to generate the third line. The coordinates of the M sampling points are acquired in the drawing process of the first line, the coordinates of the N sampling points are acquired in the drawing process of the second line, and M and N are positive integers.
In the embodiment of the application, the electronic equipment can automatically perform line repairing under the condition that the two lines are determined to be separated from the same line, connect the two lines, and display a third line formed after connection in a drawing area, so that firstly, drawing errors can be made up, and the integrity of a graph is improved; secondly, the operation of manually repairing the line by a user can be saved; and thirdly, under the condition that the user does not sense the disconnection of the lines, the lines can be repaired, and the problem that the lines are not used to draw in the drawing process is reduced.
It should be understood that in the embodiment of the present application, the input Unit 704 may include a Graphics Processing Unit (GPU) 7041 and a microphone 7042, and the Graphics Processing Unit 7041 processes image data of still pictures or videos obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also referred to as a touch screen. The touch panel 7071 may include two parts of a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 709 may be used to store a software program and various data, and the memory 709 may mainly include a first memory area storing a program or an instruction and a second memory area storing data, wherein the first memory area may store an operating system, an application program or an instruction (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like. Further, the memory 709 may include volatile memory or nonvolatile memory, or the memory 709 may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 709 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the drawing processing method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the above-mentioned drawing processing method embodiment, and can achieve the same technical effect, and is not described here again to avoid repetition.
The present application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the processes of the above-mentioned embodiment of the graphics processing method, and achieve the same technical effects, and therefore, in order to avoid repetition, the descriptions of the processes are omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (12)
1. A method for processing a drawing, the method comprising:
acquiring a first line and a second line drawn in a drawing area; the first line and the second line are two separated lines adjacent in drawing time;
and displaying a third line formed by connecting the first line and the second line in the drawing area under the condition that the first line and the second line are separated from each other by the same line.
2. The drawing processing method according to claim 1, wherein before the third line formed by connecting the first line and the second line is displayed in the drawing area in a case where it is determined that the first line and the second line are separated from each other by the same line, the method further comprises:
determining a target area according to the screen foldable area and the drawing area; wherein the target area is an area determined according to an overlapping area of the screen foldable area and the drawing area, and the target area comprises the overlapping area;
obtaining drawing tracks of the first line and the second line;
determining whether the first line and the second line meet preset conditions or not according to the target area and the drawing track;
under the condition that the first line and the second line meet preset conditions, acquiring a first graph and a second graph; wherein the first graphic is a graphic included in the drawing region when the first line is separated from the second line; the second graph is a graph included in the drawing area when the first line is connected with the second line;
determining that the first line and the second line are separated by the same line based on the first graph and the second graph.
3. The drawing processing method according to claim 2, wherein said determining whether the first line and the second line satisfy a preset condition according to the target area and the drawing trajectory includes:
acquiring the coordinates of the last first sampling point in the drawing track of the first line and the coordinates of the first second sampling point in the drawing track of the second line; the coordinates of the first sampling point are acquired in the drawing process of the first line, and the coordinates of the second sampling point are acquired in the drawing process of the second line;
and under the condition that the coordinates of the first sampling point and the coordinates of the second sampling point are both located in the target area, determining that the first line and the second line meet a preset condition.
4. The drawing processing method according to claim 2, wherein said determining that the first line and the second line are separated by the same line based on the first graph and the second graph includes:
identifying the first graph to obtain a first identification result;
identifying the second graph to obtain a second identification result;
and under the condition that the recognition probability of the second recognition result is greater than that of the first recognition result, determining that the first line and the second line are separated from the same line.
5. The drawing processing method according to claim 1, wherein before a third line formed after the first line and the second line are connected is displayed in the drawing area, the method further comprises:
fitting the first line and the second line according to the M sampling point coordinates of the first line and the N sampling point coordinates of the second line to generate a third line;
the coordinates of the M sampling points are acquired in the drawing process of the first line, the coordinates of the N sampling points are acquired in the drawing process of the second line, and M and N are positive integers.
6. A graphics processing apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a first line and a second line which are drawn in the drawing area; the first line and the second line are two separated lines adjacent in drawing time;
and the display module is used for displaying a third line formed after the first line and the second line are connected in the drawing area under the condition that the first line and the second line are separated from each other.
7. The drawing processing device according to claim 6, further comprising:
the first determination module is used for determining a target area according to the screen foldable area and the drawing area; wherein the target area is an area determined according to an overlapping area of the screen foldable area and the drawing area, and the target area comprises the overlapping area;
the second acquisition module is used for acquiring the drawing tracks of the first line and the second line;
the second determining module is used for determining whether the first line and the second line meet preset conditions according to the target area and the drawing track;
the third acquisition module is used for acquiring a first graph and a second graph under the condition that the first line and the second line meet preset conditions; wherein the first graphic is a graphic included in the drawing region when the first line is separated from the second line; the second graph is a graph included in the drawing area when the first line is connected with the second line;
and the third determining module is used for determining that the first line and the second line are separated from the same line based on the first graph and the second graph.
8. The drawing processing device according to claim 7, wherein the second determination module comprises:
the acquisition unit is used for acquiring the coordinates of the last first sampling point in the drawing track of the first line and the coordinates of the first second sampling point in the drawing track of the second line; the coordinates of the first sampling point are acquired in the drawing process of the first line, and the coordinates of the second sampling point are acquired in the drawing process of the second line;
a first determining unit, configured to determine that the first line and the second line satisfy a preset condition when the first sampling point coordinate and the second sampling point coordinate are both located in the target area.
9. The drawing processing device according to claim 7, wherein the third determination module comprises:
the first recognition unit is used for recognizing the first graph to obtain a first recognition result;
the second recognition unit is used for recognizing the second graph to obtain a second recognition result;
a second determining unit, configured to determine that the first line and the second line are separated from each other by the same line when the recognition probability of the second recognition result is greater than the recognition probability of the first recognition result.
10. The drawing processing device according to claim 6, further comprising:
the generating module is used for fitting the first line and the second line according to the M sampling point coordinates of the first line and the N sampling point coordinates of the second line to generate a third line;
the coordinates of the M sampling points are acquired in the drawing process of the first line, the coordinates of the N sampling points are acquired in the drawing process of the second line, and M and N are positive integers.
11. An electronic device comprising a processor and a memory, said memory storing a program or instructions executable on said processor, said program or instructions when executed by said processor implementing the steps of the drawing processing method according to any one of claims 1 to 5.
12. A readable storage medium, on which a program or instructions are stored, which when executed by a processor, implement the steps of the drawing processing method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111615263.XA CN114296584A (en) | 2021-12-24 | 2021-12-24 | Drawing processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111615263.XA CN114296584A (en) | 2021-12-24 | 2021-12-24 | Drawing processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114296584A true CN114296584A (en) | 2022-04-08 |
Family
ID=80969347
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111615263.XA Pending CN114296584A (en) | 2021-12-24 | 2021-12-24 | Drawing processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114296584A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020113779A1 (en) * | 2001-02-21 | 2002-08-22 | International Business Machines Corporation | Pressure sensitive writing tablet, control method and control program therefor |
CN102770875A (en) * | 2010-01-06 | 2012-11-07 | 吉田健治 | Curved surface body for information input, map for information input, and drawing for information input |
CN105677280A (en) * | 2016-01-05 | 2016-06-15 | 广东威创视讯科技股份有限公司 | Spliced display screen spliced joint line drawing processing method and device |
CN109344474A (en) * | 2018-09-18 | 2019-02-15 | 常州畅信网络技术有限公司 | A kind of method for drafting of indoor plane figure |
-
2021
- 2021-12-24 CN CN202111615263.XA patent/CN114296584A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020113779A1 (en) * | 2001-02-21 | 2002-08-22 | International Business Machines Corporation | Pressure sensitive writing tablet, control method and control program therefor |
CN102770875A (en) * | 2010-01-06 | 2012-11-07 | 吉田健治 | Curved surface body for information input, map for information input, and drawing for information input |
CN105677280A (en) * | 2016-01-05 | 2016-06-15 | 广东威创视讯科技股份有限公司 | Spliced display screen spliced joint line drawing processing method and device |
CN109344474A (en) * | 2018-09-18 | 2019-02-15 | 常州畅信网络技术有限公司 | A kind of method for drafting of indoor plane figure |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101825154B1 (en) | Overlapped handwriting input method | |
CN102156578B (en) | Handwriting input method and handwriting input device of touch equipment and electronic equipment | |
WO2004031933B1 (en) | Method of combining data entry of handwritten symbols with displayed character data | |
US20170285932A1 (en) | Ink Input for Browser Navigation | |
US20170277403A1 (en) | Screen Capturing Method and Apparatus | |
CN106605199B (en) | Object management apparatus, object management method, and computer-readable storage medium | |
WO2017148833A1 (en) | Method and system for character insertion in a character string | |
CN102073884A (en) | Handwriting recognition method, system and handwriting recognition terminal | |
CN104090701A (en) | Information processing method and electronic equipment | |
CN114518820A (en) | Icon sorting method and device and electronic equipment | |
CN114327726A (en) | Display control method, display control device, electronic equipment and storage medium | |
US20140152589A1 (en) | Information processing apparatus, information processing method, and non-transitory computer readable medium | |
CN113703631A (en) | Writing control method and device, electronic equipment and storage medium | |
CN111783393B (en) | Handwritten note synchronization method, equipment and storage medium during bilingual comparison reading | |
US20180276505A1 (en) | Information processing device | |
TWI547863B (en) | Handwriting recognition method, system and electronic device | |
CN114296584A (en) | Drawing processing method and device | |
TW201423563A (en) | Apparatus and method for processing handwriting input | |
CN113849106B (en) | Page turning handwriting processing method, device, electronic device and storage medium | |
US9141286B2 (en) | Electronic device and method for displaying software input interface | |
US20190371277A1 (en) | Processing method for character stroke and related device | |
CN115951852A (en) | Information display method and device, electronic equipment and storage medium | |
CN114491309A (en) | Picture processing method and device | |
CN115437736A (en) | Method and device for recording notes | |
CN114518859A (en) | Display control method, display control device, electronic equipment and 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 |