Methods and devices for processing graphic trajectories, storage media, and electronic devices.

By determining whether there are intersections between the hand-drawn graphic trajectory and the original graphic in the graphic enhancement mode and preserving the original, the problem of not being able to generate interactive graphics in the existing technology is solved, thus improving the user experience.

CN116071462BActive Publication Date: 2026-11-10BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111276059.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2026-11-10
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

The existing graphic enhancement methods cannot generate interactive graphics while preserving the original graphic trajectory, resulting in a poor user experience.

Method used

In the graphic enhancement mode, it is determined whether there is an intersection between the hand-drawn graphic trajectory and the original graphic in the touch display interface. If there is an intersection, the hand-drawn graphic trajectory is preserved in its original form to generate an interactive graphic.

Benefits of technology

It achieves the preservation of the original graphic trajectory in the graphic beautification mode, improves the user experience, and enables interaction between the hand-drawn graphic trajectory and the original graphic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116071462B_ABST
    Figure CN116071462B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, storage medium, and electronic device for processing graphic trajectories, and pertains to the field of image processing technology. The method includes: receiving a hand-drawn graphic trajectory input by a current user through a touch display interface; wherein the touch display device is in a graphic enhancement mode; determining whether there is an intersection point between the hand-drawn graphic trajectory and an original graphic included in the touch display interface; if an intersection point exists, preserving the original hand-drawn graphic trajectory to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic. This disclosure solves the problem of not being able to generate interactive graphics in graphic enhancement mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and more specifically, to a method for processing graphic trajectories, an apparatus for processing graphic trajectories, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Intelligent graphic and interaction recognition uses real-time coordinate information from user-written text to determine whether the user's drawing is closed, and whether it intersects with or contains existing graphics. This information can be used to enhance single-stroke drawings, analyze and annotate graphics, and thus facilitate purposes such as conference presentations and smart teaching.

[0003] In the existing graphic enhancement mode, when a user-drawn graphic trajectory is received, the trajectory will be automatically enhanced, and the original graphic trajectory cannot be preserved. If the graphic enhancement mode is turned off, the graphic trajectory cannot be enhanced when enhancement is required.

[0004] Therefore, how to preserve the original graphic trajectory and obtain interactive graphics in graphic beautification mode is an urgent problem to be solved.

[0005] It should be noted that the information in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a method for processing graphic trajectories, a device for processing graphic trajectories, a computer-readable storage medium, and an electronic device, thereby overcoming, to at least a certain extent, the problem of being unable to generate interactive graphics in graphic enhancement mode due to limitations and defects in related technologies.

[0007] According to one aspect of this disclosure, a method for processing graphic trajectories is provided, applied to a touch display device having a touch display interface, the method comprising: Receives a hand-drawn graphic trajectory input by the current user through the touch display interface; wherein the touch display device is in graphic enhancement mode; Determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; If there is an intersection, the original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic.

[0008] In an exemplary embodiment of this disclosure, before determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, the method for processing the graphic trajectory further includes: Based on the endpoint coordinates of the hand-drawn graphic trajectory, determine whether the hand-drawn graphic trajectory is a closed shape; If the hand-drawn graphic trajectory is not a closed shape, then the intersection point determination step is performed.

[0009] In one exemplary embodiment of this disclosure, the method for processing the graphic trajectory further includes: If there are no intersections, the original trajectory of the hand-drawn graphic is preserved.

[0010] In one exemplary embodiment of this disclosure, after determining that an intersection point exists, the method for processing the graphic trajectory further includes: Determine whether the hand-drawn graphic trajectory is a closed shape based on the endpoint coordinates of the hand-drawn graphic trajectory; If the hand-drawn graphic trajectory is not a closed shape, then the interactive graphic generation step is performed.

[0011] In one exemplary embodiment of this disclosure, the method for processing the graphic trajectory further includes: If there are no intersection points, determine whether the hand-drawn graphic trajectory is a closed shape based on the coordinates of the endpoints of the hand-drawn graphic trajectory. If the hand-drawn graphic trajectory is not a closed shape, then the original hand-drawn graphic trajectory is preserved.

[0012] In one exemplary embodiment of this disclosure, the method for processing the graphic trajectory further includes: If the hand-drawn graphic trajectory is a closed shape, the graphic trajectory is recognized based on a preset graphic recognition model to obtain a first graphic recognition result; Based on the standard graphic lines of the first graphic recognition result, the hand-drawn graphic trajectory is beautified.

[0013] In one exemplary embodiment of this disclosure, after obtaining the first image recognition result, the method for processing the image trajectory further includes: Determine whether the confidence level of the first image recognition result is greater than a second preset threshold; If so, then perform the graphic trajectory enhancement step; If not, the original hand-drawn graphic trajectory will be preserved.

[0014] In one exemplary embodiment of this disclosure, the original graphic is obtained by the touch display device in the graphic enhancement mode by recognizing and enhancing the hand-drawn graphic trajectory of the current user.

[0015] In one exemplary embodiment of this disclosure, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface includes: Obtain the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic included in the touch display interface, and segment the hand-drawn graphic trajectory and the original graphic according to the first inflection point and the second inflection point to obtain the first line segment and the second line segment. A first initial coordinate point set and a second initial coordinate point set are constructed based on the first trajectory point included in the first line segment and the second trajectory point included in the second line segment, and the first initial coordinate point set and the second initial coordinate point set are sorted according to a preset sorting rule; Find whether there is an overlapping region between the second region formed by the second minimum coordinate value and the second maximum coordinate value of the second trajectory points included in the second initial coordinate point set and the first region formed by the first minimum coordinate value and the first maximum coordinate value of the first trajectory points included in the first initial coordinate point set; If there is an overlapping area, then the second target coordinate point set and the first target coordinate point set corresponding to the overlapping area are determined, and based on the preset recursion and binary search method, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set.

[0016] In one exemplary embodiment of this disclosure, the preset sorting rule includes any one or more of the following: The first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The first ordinate values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The second abscissa values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially; The second ordinate values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially.

[0017] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also increase sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0018] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second initial coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase sequentially, determine whether the second maximum coordinate value of the second abscissa is less than the first intermediate coordinate value of the first abscissa; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first initial coordinate point set; or Determine whether the second minimum coordinate value of the second horizontal coordinate value is greater than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first initial coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0019] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set decrease sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0020] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also decrease sequentially, determine whether the second maximum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0021] According to one aspect of this disclosure, a graphic trajectory processing apparatus is provided, applied to a touch display device having a touch display interface, the graphic trajectory processing apparatus comprising: A graphic trajectory receiving module is used to receive a hand-drawn graphic trajectory input by the current user through the touch display interface; wherein the touch display device is in graphic enhancement mode; The intersection point determination module is used to determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; An interactive graphics generation module is used to preserve the original trajectory of the hand-drawn graphic if there are intersection points, so as to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic.

[0022] According to one aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method for processing graphic trajectories as described in any of the preceding claims.

[0023] According to one aspect of this disclosure, an electronic device is provided, comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to execute the graphical trajectory processing method described above by executing the executable instructions.

[0024] The graphic trajectory processing method provided in this disclosure has the following advantages: Firstly, in graphic enhancement mode, when it is determined that there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, the original hand-drawn graphic trajectory can be preserved to obtain an interactive graphic between the hand-drawn graphic trajectory and the original graphic. This solves the problem in the prior art that it is impossible to preserve the original graphic trajectory and obtain an interactive graphic in graphic enhancement mode. Secondly, it realizes the interaction between the hand-drawn graphic trajectory and the original graphic, thereby improving the user experience.

[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0027] Figure 1 The flowchart schematically illustrates a method for processing a graphical trajectory according to an exemplary embodiment of the present disclosure.

[0028] Figure 2 An example diagram illustrating a hand-drawn graphic trajectory according to an exemplary embodiment of the present disclosure is shown.

[0029] Figure 3 An example diagram illustrating an original graphic according to an exemplary embodiment of the present disclosure is shown schematically.

[0030] Figure 4 The diagram schematically illustrates the interaction between a non-closed hand-drawn graphic trajectory and an original graphic according to an exemplary embodiment of the present disclosure.

[0031] Figure 5 This schematically illustrates an interaction diagram between another hand-drawn graphic trajectory and the original graphic according to an exemplary embodiment of this disclosure.

[0032] Figure 6 The flowchart illustrates a method for determining whether there is an intersection between a hand-drawn graphic trajectory and an original graphic included in the touch display interface, according to an example embodiment of the present disclosure.

[0033] Figure 7 The illustration schematically shows an example diagram of the intersection point between a hand-drawn graphic trajectory and an original graphic according to an exemplary embodiment of the present disclosure.

[0034] Figure 8 A flowchart illustrating another method for processing graphical trajectories according to an exemplary embodiment of this disclosure is shown.

[0035] Figure 9 An example diagram illustrating a hand-drawn graphic trajectory without intersections according to an exemplary embodiment of the present disclosure is shown.

[0036] Figure 10 A flowchart illustrating another method for processing graphical trajectories according to an exemplary embodiment of this disclosure is shown.

[0037] Figure 11 A block diagram schematically illustrates a processing apparatus for a graphical trajectory according to an exemplary embodiment of the present disclosure.

[0038] Figure 12 An electronic device for implementing the above-described method for processing graphic trajectories, according to an example embodiment of the present disclosure, is illustrated. Detailed Implementation

[0039] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0040] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0041] Currently, there is no interactive solution in the intelligent drawing methods for graphics display based on electronic devices that can analyze and annotate the beautified graphics.

[0042] Furthermore, the current method for determining whether two figures intersect is as follows: assuming two sets of coordinate points are available, to find if they contain a common point, a method of traversing and comparing the coordinate points is required. However, this method is computationally complex. Specifically, for example, if the length of the coordinate set of one figure is M and the length of the coordinate set of the other figure is N, the computational complexity of the commonly used traversal and comparison method is 2M. 2N (multiplied by 2 because the coordinate set includes x and y, and a length requires comparing x and y separately, i.e., comparing twice as many times). As a result, the time required to determine the relationship between each graphic will be increased, affecting the user experience.

[0043] Based on this, this exemplary embodiment first provides a method for processing graphic trajectories. This method can run on a computing device, which may include any electronic device with computing capabilities, such as a mobile phone, laptop, tablet, desktop computer, server, server cluster, or cloud server. Of course, those skilled in the art can also run the method disclosed herein on other platforms as needed, and this exemplary embodiment does not impose any special limitations on this. Reference Figure 1 As shown, the method for processing the graphic trajectory may include the following steps: Step S110. Receive the hand-drawn graphic trajectory input by the current user through the touch display interface; wherein the touch display device is in graphic enhancement mode; Step S120. Determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; Step S130. If there is an intersection, the original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic.

[0044] In the above-mentioned method for processing graphic trajectories, on the one hand, since the hand-drawn graphic trajectory can be preserved in the graphic beautification mode when it is determined that there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, the interactive graphic of the hand-drawn graphic trajectory and the original graphic is obtained, which solves the problem in the prior art that it is impossible to preserve the original graphic trajectory and thus obtain the interactive graphic in the graphic beautification mode; on the other hand, the interaction between the hand-drawn graphic trajectory and the original graphic is realized, thereby improving the user experience.

[0045] The following will provide a detailed explanation and description of the graphical trajectory processing method of the exemplary embodiments of this disclosure, in conjunction with the accompanying drawings.

[0046] First, the application scenarios and inventive objectives of the exemplary embodiments of this disclosure will be explained and described. Specifically, the exemplary embodiments of this disclosure achieve interaction between hand-drawn graphic trajectories and original graphics by using graphic recognition algorithms and / or schemes for judging the relative positional relationships of graphics. The graphic trajectory processing method provided by the exemplary embodiments of this disclosure can be widely applied to scenarios with graphic interaction schemes, such as smart mathematics teaching and conference data analysis. In specific applications, when the current user enables the graphic recognition function of the touch display interface, after each stroke of the trajectory is written, the algorithm will perform corresponding calculations, either recognizing and beautifying the graphic, deeming it not a graphic at all, or considering it as interacting with the beautified graphic.

[0047] Secondly, in a method for processing a graphic trajectory provided in the exemplary embodiments of this disclosure: In step S110, a hand-drawn graphic trajectory input by the current user through the touch display interface is received; wherein, the touch display device is in graphic enhancement mode.

[0048] Specifically, the hand-drawn graphic trajectory mentioned above can be any shape or line, and of course, it can also be text; this example does not impose any special restrictions on this. (See reference) Figure 2 As shown, this example uses a hand-drawn graphic trajectory as an illustration. It should be noted that this example emphasizes that the touch display device is in graphic enhancement mode. This is to illustrate that when the touch display device is in graphic recognition mode, it is also in graphic enhancement mode. Based on this graphic enhancement mode, certain hand-drawn graphic trajectories that require enhancement can be beautified. Simultaneously, under certain specific conditions, hand-drawn graphic trajectories that do not require enhancement can be preserved in their original form, thus adapting to different user needs and improving the user experience.

[0049] In step S120, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0050] In this example embodiment, reference Figure 3 As shown, taking a circle as an example, the explanation and illustration are as follows. The original graphic is obtained by the touch display device in the graphic enhancement mode by recognizing and enhancing the current user's hand-drawn graphic trajectory. Of course, the original graphic can also include rectangles, squares, rhombuses, or straight lines, etc., and this example does not impose any special restrictions. That is to say, the original graphic can be enhanced after the first stroke is completed; that is, a closed graphic can be drawn in one stroke, successfully recognized, and corrected (enhanced). The coordinate set corresponding to the original graphic will also be updated to include all the coordinate points of the trajectory of the enhanced graphic on the canvas. The process of obtaining the coordinate points involves using fixed key coordinates, utilizing the graphic category, fitting a function, and rounding x and y to obtain the second trajectory points of the original graphic and the second coordinate parameters of each second trajectory point. Then, it is determined whether there are any intersection points between the hand-drawn graphic trajectory and the original graphic included in the touch display interface. For details on the interaction relationship between the hand-drawn graphic trajectory and the original graphic, please refer to... Figure 4 as well as Figure 5 As shown.

[0051] For details, please refer to Figure 6 As shown, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface may include the following steps: Step S610: Obtain the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic included in the touch display interface, and segment the hand-drawn graphic trajectory and the original graphic according to the first inflection point and the second inflection point to obtain the first line segment and the second line segment.

[0052] Specifically, the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic can be found using the aforementioned preset graphic recognition model. Then, based on the first and second inflection points, the hand-drawn graphic trajectory and the original graphic are segmented. For example, if the inflection point format of a graphic is 2, the coordinates will be divided into 3 segments in sequence. The characteristic of each segment is that the increasing and decreasing characteristics of x and y are basically consistent.

[0053] Step S620: Construct a first initial coordinate point set and a second initial coordinate point set based on the first trajectory point included in the first line segment and the second trajectory point included in the second line segment, and sort the first initial coordinate point set and the second initial coordinate point set according to a preset sorting rule.

[0054] Specifically, the preset sorting rules include: the first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; the first ordinate values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; the second abscissa values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially; and the second ordinate values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially. It should be noted that the sorting rules for the coordinate point set can be selected according to actual needs. One or more of the above preset rules can be selected, or other sorting rules can be configured according to actual needs. This example does not impose any special restrictions on this. Furthermore, this example uses the above sorting rules to ensure the accuracy of the remaining target point set when using recursion and binary search, thereby improving the accuracy of the intersection points.

[0055] For example, to facilitate searching, after segmenting by inflection point, the maximum and minimum ranges of x and y for each initial coordinate point set, as well as the increasing and decreasing characteristics of x and y, can be expressed according to convention. For example, sequence_x = 0 indicates that the coordinate points are decreasing in the x-axis direction, while sequence_x = 1 indicates the non-decreasing case.

[0056] Step S630: Determine whether there is an overlapping region between the second region formed by the second minimum coordinate value and the second maximum coordinate value of the second trajectory points included in the second initial coordinate point set and the first region formed by the first minimum coordinate value and the first maximum coordinate value of the first trajectory points included in the first initial coordinate point set.

[0057] Specifically, in the process of searching for overlapping regions, it can be determined directly by whether there is an overlap between the second coordinate region formed by the second minimum coordinate value and the second maximum coordinate value, and the first coordinate region formed by the first minimum coordinate value and the first maximum coordinate value. This method does not require traversal or calculation of each coordinate point individually.

[0058] Furthermore, when the x and y ranges of the overall coordinates of the first coordinate region do not exceed the maximum and minimum ranges of the x and y values ​​of the overall coordinates of the second coordinate region, it can be confirmed that the second coordinate region contains the first coordinate region.

[0059] Step S640: If there is an overlapping area, determine the second target coordinate point set and the first target coordinate point set corresponding to the overlapping area, and determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface based on the second target coordinate point set and the first target coordinate point set using a preset recursive and binary method.

[0060] The method of determining whether there is an intersection between the hand-drawn graphic trajectory and the original graphic included in the touch display interface based on the second target coordinate point set and the first target coordinate point set using a preset recursive and binary search approach can include the following methods: Method 1: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also increase sequentially, determine whether the second minimum coordinate value of the second abscissa is greater than the first intermediate coordinate value of the first abscissa; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0061] Method 2: When the second abscissa values ​​of the second trajectory points included in the second initial coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase sequentially, determine whether the second maximum coordinate value of the second abscissa is less than the first intermediate coordinate value of the first abscissa; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first initial coordinate point set; or

[0062] Determine whether the second minimum coordinate value of the second horizontal coordinate value is greater than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first initial coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0063] Method 3: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set decrease sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; or

[0064] Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0065] Method 4: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also decrease sequentially, determine whether the second maximum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or

[0066] Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0067] Furthermore, if the difference between the second coordinate value of any second trajectory point in the second target coordinate point set and the first coordinate value of any first trajectory point in the first target coordinate point set is less than a first preset threshold, then there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0068] The following example illustrates the method for calculating intersection points. For instance, suppose Figure A (the hand-drawn graphic trajectory) has three coordinate sets, and Figure B (the original graphic) has two coordinate sets. Each coordinate set has... , , , , , And other parameters. Furthermore, if the parameters of a certain segment in Figure A are labeled as... , , , , , The parameters of a certain segment in Figure B are labeled as follows: , , , , , The condition for determining whether these two segments intersect is: (1) ,or ; (2) ,or .

[0069] When both conditions are met, it can be determined that the two line segments intersect.

[0070] After confirming the existence of intersections, we can traverse the segments of graph B, using a given segment to traverse the segments of graph A to find the specific intersection; where, or This represents the x or y coordinate of the starting point of a certain segment in Figure B (the second maximum or second minimum coordinate value, which can be determined according to the specific decreasing or increasing rules). or (First intermediate coordinate value) represents the x or y coordinate of the midpoint of a segment in Figure A. The specific bisection rule can be shown in Table 1 below: Table 1

[0071] According to the rules in Table 1, after using the binary search method, we obtain the first target coordinate point set with only half of the first coordinate points remaining. Then, a recursive method is used to search for and determine if a corresponding intersection point exists. It should be noted that the recursive method can determine and make a judgment about the existence of intersection points; furthermore, once a judgment is made, the traversal of other points stops; the rule for finding an intersection point is that finding the same point or the distance between two points is less than a small fixed value (such as 5 pixels) indicates an intersection. This method ensures that the coordinate point sets are ordered in segments, allowing the recursion and binary search methods to find intersection points while saving time, thus maximizing the efficiency of intersection point finding and improving the efficiency of human-computer interaction.

[0072] In step S130, if there is an intersection point, the original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic.

[0073] For details, please refer to Figure 7 As shown, if corresponding intersection points exist (e.g., points A and B), the original trajectory of the hand-drawn graphic is preserved to generate a result like... Figure 7 The hand-drawn graphic trajectory shown is an interactive graphic with the original graphic, which is then used to achieve the interactive graphic by preserving the original graphic trajectory in the graphic beautification mode.

[0074] The following, combined with Figure 8 Another method for processing graphical trajectories according to an example embodiment of this disclosure will be explained and described. (Reference) Figure 8As shown, the method for processing the graphic trajectory may include the following steps: Step S810: Receive the hand-drawn graphic trajectory input by the current user through the touch display interface; Step S820: Determine whether the hand-drawn graphic trajectory is a closed shape based on the endpoint coordinates of the hand-drawn graphic trajectory; if not, proceed to step S830; if yes, proceed to step S860. Step S830: Perform the intersection point determination step (determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface); if there is an intersection point, proceed to step S840; if there is no intersection point, proceed to step S850. Step S840: The original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic. Step S850: Preserve the original trajectory of the hand-drawn graphic; a specific example image can be found here. Figure 9 As shown; Step S860: Perform the hand-drawn graphic trajectory recognition step.

[0075] The hand-drawn graphic trajectory recognition step may include: recognizing the graphic trajectory based on a preset graphic recognition model to obtain a first graphic recognition result; and beautifying the hand-drawn graphic trajectory according to the standard graphic lines of the first graphic recognition result. After obtaining the first graphic recognition result, the hand-drawn graphic trajectory recognition step may further include: determining whether the confidence level of the first graphic recognition result is greater than a second preset threshold; if yes, then performing the graphic trajectory beautification step; if no, then preserving the original hand-drawn graphic trajectory.

[0076] The following, combined with Figure 10 Another method for processing graphical trajectories according to an example embodiment of this disclosure will be explained and described. (Reference) Figure 10 As shown, the method for processing the graphic trajectory may include the following steps: Step S1010: Receive the hand-drawn graphic trajectory input by the current user through the touch display interface; Step S1020: Determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; if yes, proceed to step S1030; otherwise, proceed to step S1060. Step S1030: Determine whether the hand-drawn graphic trajectory is a closed shape based on the endpoint coordinates of the hand-drawn graphic trajectory; if not, proceed to step S1040; if yes, proceed to step S1050. Step S1040: The original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic. Step S1050: Perform the hand-drawn graphic trajectory recognition step; Step S1060: Determine whether the hand-drawn graphic trajectory is a closed shape based on the endpoint coordinates of the hand-drawn graphic trajectory; if not, proceed to step S1070; if yes, proceed to step S1050. Step S1070: The original hand-drawn graphic trajectory is preserved.

[0077] The hand-drawn graphic trajectory recognition step may include: recognizing the graphic trajectory based on a preset graphic recognition model to obtain a first graphic recognition result; and beautifying the hand-drawn graphic trajectory according to the standard graphic lines of the first graphic recognition result. After obtaining the first graphic recognition result, the hand-drawn graphic trajectory recognition step may further include: determining whether the confidence level of the first graphic recognition result is greater than a second preset threshold; if yes, then performing the graphic trajectory beautification step; if no, then preserving the original hand-drawn graphic trajectory.

[0078] The following will be about Figure 8 as well as Figure 10 The steps for determining a closed shape are explained below. Specifically, the process of determining a closed shape can be implemented as follows: First, based on the first time series parameters of the first trajectory points of the hand-drawn shape trajectory, determine the first starting trajectory point and the first ending trajectory point of the hand-drawn shape trajectory; second, based on the first coordinate parameters of the first ending trajectory point and the first coordinate parameters of the first starting trajectory point, calculate the distance difference between the first ending coordinate point and the first starting trajectory point; finally, determine whether the hand-drawn shape trajectory is a closed shape based on whether the distance difference is greater than a first preset threshold. Wherein, if the distance difference is less than or equal to the first preset threshold, the hand-drawn shape trajectory is determined to be a closed shape; if the distance difference is greater than the first preset threshold, the hand-drawn shape trajectory is determined to be a non-closed shape.

[0079] It should be further clarified here that, in the process of recognizing the graphic trajectory, the preset graphic recognition model used can be, for example, a recurrent neural network (RNN) or a convolutional neural network (CNN). This example does not impose any special restrictions on this. Furthermore, if the confidence level (i.e., the probability that the predicted result belongs to a certain graphic, such as a square, circle, rhombus, etc.) of the prediction result output by the convolutional neural network or the recurrent neural network is greater than the second preset threshold (e.g., 0.7 or 0.8, etc.), then it is corrected; otherwise, the original shape of the hand-drawn graphic trajectory is preserved.

[0080] The graphic trajectory processing method provided in this exemplary embodiment can not only perform graphic recognition and beautification, but also perform graphic analysis, annotation and other interactive operations on it.

[0081] This disclosure also provides an example embodiment of a graphic trajectory processing apparatus, applied to a touch display device having a touch display interface. (See reference...) Figure 11 As shown, the graphic trajectory processing device may include a graphic trajectory receiving module 1110, an intersection point judgment module 1120, and an interactive graphic generation module 1130. Wherein: The graphic trajectory receiving module 1110 can be used to receive hand-drawn graphic trajectories input by the current user through the touch display interface; wherein, the touch display device is in graphic enhancement mode; The intersection point determination module 1120 can be used to determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; The interactive graphics generation module 1130 can be used to preserve the original trajectory of the hand-drawn graphic if there are intersection points, so as to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic.

[0082] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The first closed figure determination module is used to determine whether the hand-drawn figure trajectory is a closed figure based on the endpoint coordinates of the hand-drawn figure trajectory. The first execution module is used to execute the intersection point judgment step if the hand-drawn graphic trajectory is not a closed graphic.

[0083] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The first trajectory preservation module is used to preserve the original trajectory of the hand-drawn graphic if there are no intersection points.

[0084] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The second closed figure determination module is used to determine whether the hand-drawn figure trajectory is a closed figure based on the endpoint coordinates of the hand-drawn figure trajectory. The second execution module is used to execute the interactive graphics generation step if the hand-drawn graphic trajectory is not a closed graphic.

[0085] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The third closed figure judgment module is used to determine whether the hand-drawn figure trajectory is a closed figure based on the endpoint coordinates of the hand-drawn figure trajectory if there is no intersection point. The second trajectory preservation module is used to preserve the original trajectory of the hand-drawn graphic if the trajectory is not a closed graphic.

[0086] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The trajectory recognition module is used to recognize the trajectory of the hand-drawn graphic based on a preset graphic recognition model if the trajectory is a closed graphic, and obtain a first graphic recognition result. The trajectory beautification module is used to beautify the hand-drawn graphic trajectory based on the standard graphic lines of the first graphic recognition result if the condition is met.

[0087] In one exemplary embodiment of this disclosure, the processing apparatus for the graphic trajectory further includes: The confidence level determination module is used to determine whether the confidence level of the first image recognition result is greater than a second preset threshold. The third execution module is used to execute the graphic trajectory beautification step if the condition is met. The third trajectory preservation module is used to preserve the original trajectory of the hand-drawn graphic if no other conditions are met.

[0088] In one exemplary embodiment of this disclosure, the original graphic is obtained by the touch display device in the graphic enhancement mode by recognizing and enhancing the hand-drawn graphic trajectory of the current user.

[0089] In one exemplary embodiment of this disclosure, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface includes: Obtain the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic included in the touch display interface, and segment the hand-drawn graphic trajectory and the original graphic according to the first inflection point and the second inflection point to obtain the first line segment and the second line segment. A first initial coordinate point set and a second initial coordinate point set are constructed based on the first trajectory point included in the first line segment and the second trajectory point included in the second line segment, and the first initial coordinate point set and the second initial coordinate point set are sorted according to a preset sorting rule; Find whether there is an overlapping region between the second region formed by the second minimum coordinate value and the second maximum coordinate value of the second trajectory points included in the second initial coordinate point set and the first region formed by the first minimum coordinate value and the first maximum coordinate value of the first trajectory points included in the first initial coordinate point set; If there is an overlapping area, then the second target coordinate point set and the first target coordinate point set corresponding to the overlapping area are determined, and based on the preset recursion and binary search method, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set.

[0090] In one exemplary embodiment of this disclosure, the preset sorting rule includes any one or more of the following: The first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The first ordinate values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The second abscissa values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially; The second ordinate values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially.

[0091] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also increase sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0092] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second initial coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase sequentially, determine whether the second maximum coordinate value of the second abscissa is less than the first intermediate coordinate value of the first abscissa; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first initial coordinate point set; or Determine whether the second minimum coordinate value of the second horizontal coordinate value is greater than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first initial coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0093] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set decrease sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0094] In one exemplary embodiment of this disclosure, based on a preset recursive and binary search method, determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set, further includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also decrease sequentially, determine whether the second maximum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

[0095] The specific details of each module in the above-mentioned graphic trajectory processing device have been described in detail in the corresponding graphic trajectory processing method, so they will not be repeated here.

[0096] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0097] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0098] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0099] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0100] The following reference Figure 12 To describe an electronic device 1200 according to such an embodiment of the present disclosure. Figure 12 The electronic device 1200 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0101] like Figure 12 As shown, the electronic device 1200 is manifested in the form of a general-purpose computing device. The components of the electronic device 1200 may include, but are not limited to: at least one processing unit 1210, at least one storage unit 1220, a bus 1230 connecting different system components (including storage unit 1220 and processing unit 1210), and a display unit 1240.

[0102] The storage unit stores program code that can be executed by the processing unit 1210, causing the processing unit 1210 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure. For example, the processing unit 1210 can perform actions such as... Figure 1 Step S110: Receive the hand-drawn graphic trajectory input by the current user through the touch display interface, and determine whether the hand-drawn graphic trajectory is a closed graphic based on the first parameter of the first trajectory point of the hand-drawn graphic trajectory; Step S120: If the hand-drawn graphic trajectory is not a closed graphic, calculate whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the display interface based on a preset recursive and binary search method; Step S130: If the intersection point exists, determine the starting coordinate point of the line to be corrected where the intersection point is located in the hand-drawn graphic trajectory; Step S140: Obtain the target trajectory between the intersection point and the starting coordinate point, and correct the line to be corrected based on the target trajectory.

[0103] Storage unit 1220 may include readable media in the form of volatile storage units, such as random access memory (RAM) 12201 and / or cache memory 12202, and may further include read-only memory (ROM) 12203.

[0104] Storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0105] Bus 1230 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0106] Electronic device 1200 can also communicate with one or more external devices 1300 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1200, and / or any device that enables electronic device 1200 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1250. Furthermore, electronic device 1200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1260. As shown, network adapter 1260 communicates with other modules of electronic device 1200 via bus 1230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0107] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0108] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible implementations, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of this disclosure described in the "Exemplary Methods" section above.

[0109] The program product for implementing the above-described method according to embodiments of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0110] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0111] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0112] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0113] Program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0114] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0115] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention described herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not invented by this disclosure. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

Claims

1. A method for processing graphic trajectories, characterized in that, The method for processing the graphic trajectory, applied to a touch display device with a touch display interface, includes: Receives a hand-drawn graphic trajectory input by the current user through the touch display interface; wherein the touch display device is in graphic enhancement mode; Determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; the intersection point is determined as follows: obtain the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic included in the touch display interface, and segment the hand-drawn graphic trajectory and the original graphic according to the first inflection point and the second inflection point to obtain a first line segment and a second line segment; construct a first initial coordinate point set and a second initial coordinate point set according to the first trajectory point included in the first line segment and the second trajectory point included in the second line segment, and sort the first initial coordinate point set and the second initial coordinate point set according to a preset sorting rule. The initial coordinate point set is sorted; the second region formed by the second minimum coordinate value and the second maximum coordinate value of the second trajectory points included in the second initial coordinate point set is searched to see if there is an overlapping region between it and the first region formed by the first minimum coordinate value and the first maximum coordinate value of the first trajectory points included in the first initial coordinate point set; if there is an overlapping region, the second target coordinate point set and the first target coordinate point set corresponding to the overlapping region are determined, and based on the preset recursion and binary search method, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set; If there is an intersection, the original hand-drawn graphic trajectory is preserved to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic; if there is no intersection, the hand-drawn graphic trajectory is determined to be a closed graphic based on the endpoint coordinates; if the hand-drawn graphic trajectory is not a closed graphic, the original hand-drawn graphic trajectory is preserved.

2. The method for processing graphic trajectories according to claim 1, characterized in that, Before determining whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, the method for processing the graphic trajectory further includes: Based on the endpoint coordinates of the hand-drawn graphic trajectory, determine whether the hand-drawn graphic trajectory is a closed shape; If the hand-drawn graphic trajectory is not a closed shape, then the intersection point determination step is performed.

3. The method for processing graphic trajectories according to claim 1, characterized in that, After determining that an intersection point exists, the method for processing the graphic trajectory further includes: Determine whether the hand-drawn graphic trajectory is a closed shape based on the endpoint coordinates of the hand-drawn graphic trajectory; If the hand-drawn graphic trajectory is not a closed shape, then the interactive graphic generation step is performed.

4. The method for processing graphic trajectories according to claim 2 or 3, characterized in that, The method for processing the graphic trajectory also includes: If the hand-drawn graphic trajectory is a closed shape, the graphic trajectory is recognized based on a preset graphic recognition model to obtain a first graphic recognition result; Based on the standard graphic lines of the first graphic recognition result, the hand-drawn graphic trajectory is beautified.

5. The method for processing graphic trajectories according to claim 4, characterized in that, After obtaining the first image recognition result, the method for processing the image trajectory further includes: Determine whether the confidence level of the first image recognition result is greater than a second preset threshold; If so, then perform the graphic trajectory enhancement step; If not, the original hand-drawn graphic trajectory will be preserved.

6. The method for processing graphic trajectories according to claim 1, characterized in that, The original graphic is obtained by the touch display device in the graphic enhancement mode by recognizing and enhancing the hand-drawn graphic trajectory of the current user.

7. The method for processing graphic trajectories according to claim 1, characterized in that, The preset sorting rules include any one or more of the following: The first x-coordinate values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The first ordinate values ​​of the first trajectory points included in the first initial coordinate point set increase / decrease sequentially; The second abscissa values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially; The second ordinate values ​​of the second trajectory points included in the second initial coordinate point set increase / decrease sequentially.

8. The method for processing graphic trajectories according to claim 7, characterized in that, Based on a preset recursive and binary search method, and according to the second target coordinate point set and the first target coordinate point set, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, including: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also increase sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

9. The method for processing graphic trajectories according to claim 7, characterized in that, Based on a preset recursive and binary search method, and according to the second target coordinate point set and the first target coordinate point set, it determines whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, and also includes: When the second abscissa values ​​of the second trajectory points included in the second initial coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first initial coordinate point set increase sequentially, determine whether the second maximum coordinate value of the second abscissa is less than the first intermediate coordinate value of the first abscissa; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first initial coordinate point set; or Determine whether the second minimum coordinate value of the second horizontal coordinate value is greater than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first initial coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first minimum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first maximum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

10. The method for processing graphic trajectories according to claim 7, characterized in that, Based on a preset recursive and binary search method, and according to the second target coordinate point set and the first target coordinate point set, it determines whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, and also includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set increase sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set decrease sequentially, determine whether the second minimum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

11. The method for processing graphic trajectories according to claim 7, characterized in that, Based on a preset recursive and binary search method, and according to the second target coordinate point set and the first target coordinate point set, it determines whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface, and also includes: When the second abscissa values ​​of the second trajectory points included in the second target coordinate point set decrease sequentially, and the first abscissa values ​​of the first trajectory points included in the first target coordinate point set also decrease sequentially, determine whether the second maximum coordinate value of the second abscissa value is greater than the first intermediate coordinate value of the first abscissa value; if so, delete the trajectory points from the first minimum coordinate value segment to the first intermediate coordinate value segment in the first target coordinate point set; or Determine whether the second maximum coordinate value of the second horizontal coordinate value is less than the first intermediate coordinate value of the first horizontal coordinate value; if so, delete the trajectory points from the first intermediate coordinate value segment to the first maximum coordinate value segment in the first target coordinate point set; Based on the second target coordinate point set and the first target coordinate point set consisting of the first intermediate coordinate value segment to the first minimum coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface; or Based on the second target coordinate point set and the first target coordinate point set consisting of the first maximum coordinate value segment to the first intermediate coordinate value segment, determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface.

12. A device for processing graphic trajectories, characterized in that, The graphic trajectory processing device, applied to a touch display device with a touch display interface, includes: A graphic trajectory receiving module is used to receive a hand-drawn graphic trajectory input by the current user through the touch display interface; wherein the touch display device is in graphic enhancement mode; The intersection point determination module is used to determine whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface. The intersection point is determined as follows: the first inflection point of the hand-drawn graphic trajectory and the second inflection point of the original graphic included in the touch display interface are obtained, and the hand-drawn graphic trajectory and the original graphic are segmented according to the first inflection point and the second inflection point to obtain a first line segment and a second line segment; a first initial coordinate point set and a second initial coordinate point set are constructed according to the first trajectory point included in the first line segment and the second trajectory point included in the second line segment, and the first initial coordinate point is sorted according to a preset sorting rule. The set of first initial coordinate points and the second initial coordinate point set are sorted; the second region formed by the second minimum coordinate value and the second maximum coordinate value of the second trajectory points included in the second initial coordinate point set is searched to see if there is an overlapping region between it and the first region formed by the first minimum coordinate value and the first maximum coordinate value of the first trajectory points included in the first initial coordinate point set; if there is an overlapping region, the second target coordinate point set and the first target coordinate point set corresponding to the overlapping region are determined, and based on the preset recursion and binary search method, it is determined whether there is an intersection point between the hand-drawn graphic trajectory and the original graphic included in the touch display interface according to the second target coordinate point set and the first target coordinate point set; The interactive graphic generation module is used to, if there is an intersection point, preserve the original hand-drawn graphic trajectory to generate an interactive graphic between the hand-drawn graphic trajectory and the original graphic; if there is no intersection point, determine whether the hand-drawn graphic trajectory is a closed graphic based on the endpoint coordinates of the hand-drawn graphic trajectory; if the hand-drawn graphic trajectory is not a closed graphic, preserve the original hand-drawn graphic trajectory.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for processing graphic trajectories as described in any one of claims 1-11.

14. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the graphical trajectory processing method according to any one of claims 1-11 by executing the executable instructions.

Citation Information

Patent Citations

  • Information identification method and device

    CN112083870A

  • Electronic device and method for providing drawing function thereof

    US20160062638A1