Circle selection operation method, electronic writing device, storage medium and electronic equipment
Patent Information
- Application Number
- CN202380009208.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2025-02-18
AI Technical Summary
Existing electronic writing devices are prone to misjudgment in circle selection operations, resulting in poor user experience and ineffective circle selection operations cannot be effectively ruled out.
By detecting the touch point of touch operation, calculate and record the connection slope and track length of the touch point and the previous point, determine whether the slope difference and track length exceed the preset threshold. If it exceeds, it is determined to be valid Circle selection operation and generate a closed area to remove unnecessary or invalid handwriting points and supplement touch points to simulate user trajectory.
Effectively and efficiently eliminate the situation where users draw straight lines and corners, avoid misjudgment, improve user experience, and enhance the accuracy and efficiency of circle selection operations.
Smart Images

Figure CN119487483A_ABST
Abstract
Description
Circle selection operation method, electronic writing device, storage medium and electronic device Technical Field
[0001] Embodiments of the present disclosure relate to a circle selection operation method, an electronic writing device, a storage medium, and an electronic device. Background Art
[0002] An electronic ink screen, also known as electronic paper, uses electronic ink for its display. Compared to conventional displays (such as LCDs or OLEDs), electronic ink screens are increasingly being used in electronic products for reading and writing due to their advantages, including thinness, wide viewing angles, fatigue resistance, eye protection, long battery life, and flicker-free operation.
[0003] A handwriting touch E-Ink screen is an E-Ink screen with integrated touch functionality. Using touch technology, you can write and draw on the screen with your finger or a stylus. Because the display of an E-Ink screen is closer to that of ordinary paper, it reduces eye strain and is therefore more suitable for reading, writing, drawing, and other scenarios.
[0004] Summary of the Invention
[0005] The disclosed embodiments provide a circle selection method, an electronic writing device, a storage medium, and an electronic device. The circle selection method can effectively and efficiently eliminate situations where users draw straight lines or angles, thereby effectively eliminating invalid circle selection operations, avoiding misjudgments, and improving the user experience.
[0006] At least one embodiment of the present disclosure provides a circling operation method, which includes: detecting and receiving touch reporting points of a touch operation; judging whether the touch operation is a valid circling operation; and when the touch operation is a valid circling operation, generating a trajectory of the touch operation using the multiple touch reporting points received, and closing the starting touch reporting point and the ending touch reporting point of the touch operation to form a closed area, and judging whether the touch operation is a valid circling operation includes: calculating and recording the slope of a line connecting a current touch reporting point and a previous touch reporting point; calculating and recording the difference between the current slope and the previous slope, and judging whether the absolute value of the difference is greater than a first preset threshold, and if so, counting; if the absolute value of the difference is greater than the first preset threshold a number of times greater than 2, judging that the touch operation is a valid circling operation.
[0007] For example, in the circling operation method provided in one embodiment of the present disclosure, before calculating and recording the slope of the line connecting the current touch point and the previous touch point, determining whether the touch operation is a valid circling operation also includes: calculating and recording the circling track lengths of the starting touch point and the current touch point; comparing whether the difference between the current circling track length and the previous circling track length is greater than a second preset threshold value, and if so, performing a subsequent slope judgment, and recording the current circling track length as the valid circling operation track length for use in determining the next touch point.
[0008] For example, in the circle selection operation method provided in an embodiment of the present disclosure, the value of the second preset threshold is greater than or equal to 30 pixels.
[0009] For example, in the circling operation method provided in one embodiment of the present disclosure, determining whether the touch operation is a valid circling operation also includes: calculating the straight line length between the starting touch reporting point and the ending touch reporting point; calculating the length of the trajectory of the touch operation; and determining whether the length of the trajectory of the touch operation is greater than the product of the straight line length and a preset value to determine whether the touch is a valid circling operation.
[0010] For example, in the circling operation method provided in an embodiment of the present disclosure, determining whether the length of the trajectory of the touch operation is greater than the product of the straight line length and a preset value to determine whether the touch is a valid circling operation includes: calculating the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and recording it as x; calculating the square of the difference between the vertical coordinate of the starting touch reporting point and the vertical coordinate of the ending touch reporting point, and recording it as y; calculating the square of the length of the trajectory of the touch operation, and recording it as z; and if z>(x+y)*C, determining that the touch operation is a valid circling operation, wherein the value of C is greater than or equal to 1.5.
[0011] For example, in the circle selection operation method provided in an embodiment of the present disclosure, the value of the first preset threshold is greater than or equal to 1.
[0012] For example, the circling operation method provided by an embodiment of the present disclosure also includes: generating a virtual rectangle based on the positions of all valid points of each note on the canvas, and all valid points of the note fall within the range of the virtual rectangle; judging whether the virtual rectangle corresponding to each note on the canvas intersects with the closed area, and if so, recording it as a note to be judged; judging whether the valid points in the note to be judged intersect with the closed area; and erasing the valid points in the note to be judged that intersect with the closed area.
[0013] For example, the circling operation method provided in one embodiment of the present disclosure also includes: traversing each handwriting, removing valid points intersecting with the closed area, and generating new handwriting information; and redrawing the new handwriting information to the canvas based on the new handwriting information.
[0014] For example, the circling operation method provided by an embodiment of the present disclosure also includes: determining whether the distance between the current touch point and the previous touch point is less than a third preset threshold; if it is less, determining that the current touch point is a redundant point, and removing the redundant point; if it is greater, recording the current touch point as a valid touch point.
[0015] For example, in the circle selection operation method provided in an embodiment of the present disclosure, the third preset threshold is less than or equal to 5 pixels.
[0016] For example, the circle selection operation method provided in one embodiment of the present disclosure further includes: determining whether the distance between the current touch point and the previous touch point is greater than a fourth preset threshold; if so, supplementing the touch point using the following formula: B(t) = (1-t) 2 P0+2t(1-t)P1+t 2 P2,t∈[0,1],
[0017] Among them, B is the touch reporting point corresponding to different values of t, the coordinate value of P0 is the midpoint of the line between the two touch reporting points before the current touch reporting point and the previous touch reporting point, the coordinate value of P1 is the touch reporting point before the current touch reporting point, and the coordinate value of P2 is the midpoint between the previous touch reporting point and the current touch reporting point.
[0018] For example, in the circle selection operation method provided in an embodiment of the present disclosure, the value of the fourth preset threshold is greater than or equal to 10 pixels.
[0019] For example, the circle selection operation method provided by an embodiment of the present disclosure further includes: calculating the B value when t is different values, and supplementing the multiple B values as touch reporting points.
[0020] At least one embodiment of the present disclosure also provides an electronic writing device, which includes: a display touch module, configured to display a canvas and detect touch points of touch operations; a circling operation judgment module, configured to receive the touch points and determine whether the touch operation is a valid circling operation; a circling closed area generation module, configured to generate a trajectory of the touch operation using the received multiple touch points when the touch operation is a valid circling operation, and close the starting touch point and the ending touch point of the touch operation to form a closed area, wherein the circling operation judgment module is configured to: calculate and record the slope of the line connecting the current touch point and the previous touch point; calculate and record the difference between the current slope and the previous slope, and determine whether the absolute value of the difference is greater than a first preset threshold, and count if it is; if the absolute value of the difference is greater than the first preset threshold the number of times is greater than 2, then the touch operation is determined to be a valid circling operation.
[0021] For example, in the electronic writing device provided in one embodiment of the present disclosure, the circling operation judgment module is further configured to: calculate and record the circling track lengths of the starting touch point and the current touch point before calculating and recording the slope of the line connecting the current touch point and the previous touch point; compare whether the difference between the current circling track length and the previous circling track length is greater than a second preset threshold, and if so, perform subsequent slope judgment, and record the current circling track length as the effective circling operation track length for use in judging the next touch point.
[0022] For example, in the electronic writing device provided in an embodiment of the present disclosure, the value of the second preset threshold is greater than or equal to 30 pixels.
[0023] For example, in the electronic writing device provided in one embodiment of the present disclosure, the circling operation judgment module is further configured to: calculate the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and record it as x; calculate the square of the difference between the vertical coordinate of the starting touch reporting point and the vertical coordinate of the ending touch reporting point, and record it as y; calculate the square of the length of the trajectory of the touch operation, and record it as z; and if z>(x+y)*C, then determine that the touch operation is a valid circling operation, and the value of C is greater than or equal to 1.5.
[0024] For example, in the electronic writing device provided in an embodiment of the present disclosure, the display touch module includes an electronic ink screen.
[0025] At least one embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, and when the computer program is run, the circle selection operation method according to any one of the above items is executed.
[0026] At least one embodiment of the present disclosure further provides an electronic device, comprising a processor and a memory that are communicatively connected, wherein the memory stores a calculation program, and the processor is configured to execute the calculation program to perform any of the above-mentioned circling operation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, rather than limiting the present disclosure.
[0028] FIG1 is a schematic diagram of a flow chart of a circle selection operation method provided by an embodiment of the present disclosure;
[0029] FIG2 is a schematic diagram of a circle selection operation provided by an embodiment of the present disclosure;
[0030] FIG3 is a schematic diagram of a process of a circle selection and deletion operation provided by an embodiment of the present disclosure;
[0031] FIG4 is a flow chart of another circle selection operation method provided by an embodiment of the present disclosure;
[0032] FIG5 is a schematic diagram of a supplementary touch-control point reporting method provided by an embodiment of the present disclosure; and
[0033] FIG6 is a schematic diagram of an electronic writing device provided in accordance with an embodiment of the present disclosure. DETAILED DESCRIPTION
[0034] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0035] Unless otherwise defined, the technical or scientific terms used in the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprise" mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. In addition, when the number of a component or element is not specifically stated below in the embodiments of the present disclosure, it means that the component or element may be one or more, or may be understood as at least one. "At least one" refers to one or more, and "a plurality" refers to at least two.
[0036] With the continuous advancement of technology, people's demand for writing and drawing on electronic products is increasing. Therefore, how to reduce misjudgments in electronic writing devices will greatly improve the user experience and make the product more competitive. During research, the inventors of this application noticed that during the circle-to-erase process, conventional electronic writing products can misjudge circle-to-erase operations, resulting in a poor user experience.
[0037] In this regard, embodiments of the present disclosure provide a circle selection operation method, an electronic writing device, a storage medium, and an electronic device. The circle selection operation method includes: detecting and receiving a touch point report of a touch operation; determining whether the touch operation is a valid circle selection operation; when the touch operation is a valid circle selection operation, generating a touch operation trajectory using the received multiple touch points, and closing the starting touch point report and the ending touch point report of the touch operation to form a closed area; determining whether the touch operation is a valid circle selection operation includes: calculating and recording the slope of a line connecting the current touch point report and the previous touch point report; calculating and recording the difference between the current slope and the previous slope, and determining whether the absolute value of the difference is greater than a first preset threshold, and if so, counting; if the absolute value of the difference is greater than the first preset threshold a number of times greater than 2, determining that the touch operation is a valid circle selection operation. By determining whether the absolute value of the difference between the current slope and the previous slope is greater than a first preset threshold, this circling method can exclude users from drawing straight lines or lines close to straight lines. Furthermore, by determining whether the absolute value of this difference exceeds the first preset threshold more than two times, it can exclude users from drawing corners. Thus, this circling method can effectively and efficiently exclude users from drawing straight lines and corners, effectively eliminating invalid circling operations, avoiding misjudgments, and improving the user experience.
[0038] Below, the circle selection operation method, electronic writing device, storage medium and electronic device provided by the embodiments of the present disclosure are described in detail with reference to the accompanying drawings.
[0039] An embodiment of the present disclosure provides a method for performing a circle selection operation. FIG1 is a flow chart of a method for performing a circle selection operation provided by an embodiment of the present disclosure. As shown in FIG1 , the method for performing a circle selection operation includes the following steps S101-S103.
[0040] Step S101: Detect and receive a touch point report of a touch operation.
[0041] For example, the touch structure can detect the touch point of a touch operation and collect and receive the touch point report detected by the touch structure. In addition, the touch operation can include a touch operation by a finger or a touch operation by a stylus. It should be noted that the touch point report can be the touch position or coordinates of the touch operation sent by the touch structure to the system or processor.
[0042] Step S102: Determine whether the touch operation is a valid circle selection operation.
[0043] Step S103: When the touch operation is a valid circle selection operation, a track of the touch operation is generated using the received multiple touch reporting points, and the starting touch reporting point and the ending touch reporting point of the touch operation are closed to form a closed area.
[0044] In the above-mentioned step S102, determining whether the touch operation is a valid circle selection operation includes: calculating and recording the slope of the line connecting the current touch point and the previous touch point; calculating and recording the difference between the current slope and the previous slope, and determining whether the absolute value of the difference is greater than a first preset threshold, and if so, counting; if the number of times the absolute value of the difference is greater than the first preset threshold is greater than 2, then determining that the touch operation is a valid circle selection operation.
[0045] In the circle selection method provided in the embodiments of the present disclosure, by determining whether the absolute value of the difference between the current slope and the previous slope is greater than a first preset threshold, the method can exclude users from drawing straight lines or near-straight lines. Furthermore, by determining whether the absolute value of the difference is greater than the first preset threshold more than two times, the method can exclude users from drawing corners. Thus, the method can effectively and efficiently exclude users from drawing straight lines and corners, thereby effectively eliminating invalid circle selection operations, avoiding misjudgments, and improving the user experience.
[0046] In some examples, the value of the first preset threshold is greater than or equal to 1, for example, 1, 1.5, 2, etc., thereby effectively preventing the user from drawing a straight line or a line close to a straight line.
[0047] In some examples, calculating and recording the slope of the line connecting the current touch point and the previous touch point includes: calculating the difference between the horizontal coordinate of the current touch point and the horizontal coordinate of the previous touch point, and recording it as a; calculating the difference between the vertical coordinate of the current touch point and the vertical coordinate of the previous touch point, and recording it as b; and the slope of the line connecting the current touch point and the previous touch point is b / a. Thus, the circle selection method can obtain the slope of the line connecting the current touch point and the previous touch point.
[0048] In some examples, before calculating and recording the slope of the line connecting the current touch point and the previous touch point, determining whether the touch operation is a valid circle selection operation further includes: calculating and recording the length of the circle selection trajectory between the start touch point and the current touch point; comparing whether the difference between the current circle selection trajectory length and the previous circle selection trajectory length is greater than a second preset threshold; if so, performing a subsequent slope determination and recording the current circle selection trajectory length as the valid circle selection operation trajectory length for use in determining the next touch point. It should be noted that the above-mentioned slope determination refers to the operation or process of calculating and recording the slope of the line connecting the current touch point and the previous touch point; calculating and recording the difference between the current slope and the previous slope; and determining whether the absolute value of the difference is greater than the first preset threshold.
[0049] In the circle selection operation method provided in this example, before performing slope judgment, by comparing whether the difference between the current circle selection track length and the previous circle selection track length is greater than a second preset threshold, this circle selection operation method can prevent the problem of point reporting jitter caused by the touch point reporting distance being too short, thereby further improving the user experience.
[0050] In some examples, the second preset threshold is greater than or equal to 30 pixels, thereby effectively avoiding the problem of jitter in the touch reporting point caused by a short distance of the touch reporting point. It should be noted that the above-mentioned pixels refer to pixels on the display screen.
[0051] In some examples, determining whether a touch operation is a valid circle selection operation further includes: calculating the straight line length between the starting touch point and the ending touch point; calculating the length of the touch operation trajectory; and determining whether the length of the touch operation trajectory is greater than the product of the straight line length and a preset value to determine whether the touch is a valid circle selection operation. In the circle selection operation method provided in this example, the circle selection operation method can further determine whether the user has a circle selection behavior by determining whether the length of the touch operation trajectory is greater than the product of the straight line length and a preset value, thereby determining a valid circle selection behavior and excluding invalid circle selection behaviors, thereby avoiding misjudgment and improving the user experience. For example, if the length of the touch operation trajectory is less than the product of the straight line length and a preset value, it means that the closing trend of the touch operation is not obvious, resulting in a straight line trajectory. If subsequent operations (such as circle selection and deletion) are performed, the user's notes or drawings may be deleted, resulting in a poor user experience.
[0052] In some examples, determining whether the length of the trajectory of the touch operation is greater than the product of the length of the straight line and a preset value to determine whether the touch is a valid circle selection operation includes: calculating the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and recording it as x; calculating the square of the difference between the vertical coordinate of the starting touch reporting point and the vertical coordinate of the ending touch reporting point, and recording it as y; calculating the square of the length of the trajectory of the touch operation, and recording it as z; and if z>(x+y)*C, then determining that the touch operation is a valid circle selection operation, and the value of C is greater than or equal to 1.5.
[0053] In the circling operation method provided in this example, by comparing the square of the length of the touch operation trajectory and the square of the distance between the starting touch reporting point and the ending touch reporting point, the circling operation method can further determine whether the user has a circling behavior, thereby determining valid circling behavior and excluding invalid circling behavior, thereby avoiding misjudgment and improving the user experience. It should be noted that if z is less than (x+y)*C, that is, the length of the touch operation trajectory is slightly different from the distance between the starting touch reporting point and the ending touch reporting point, indicating that the closing trend of the touch operation is not obvious, resulting in a straight line trajectory. If subsequent operations (such as circling and deleting) are performed, the user's notes or drawings may be deleted, resulting in a poor user experience.
[0054] It is worth noting that in the circle selection method provided in the embodiments of the present disclosure, the aforementioned slope determination can be performed during the user's touch operation, thereby eliminating situations where the user draws straight lines and angles during the touch operation. Then, after the touch operation ends, the aforementioned circle selection closure determination operation is performed to eliminate situations where the circle is not drawn, thereby effectively eliminating various invalid circle selection operations, avoiding misjudgments, and thus improving the user experience. Of course, the embodiments of the present disclosure include but are not limited to this, and the circle selection method can also only perform the aforementioned slope determination or the aforementioned circle selection closure determination operation.
[0055] In some examples, the length of the touch operation track can be compared with a preset threshold to exclude short tracks, thereby avoiding misjudgment. For example, the preset threshold is 50 pixels.
[0056] Figure 2 is a schematic diagram of a circle selection operation provided by an embodiment of the present disclosure. As shown in Figure 2, after a user performs a valid circle selection operation, it is not necessary to completely form a closed curve. The circle selection operation method provided by the embodiment of the present disclosure can automatically generate a closed area and perform a deletion operation.
[0057] In some examples, the circling operation method further includes: generating a virtual rectangle based on the positions of all valid points of each note on the canvas, where all valid points of the note fall within the range of the virtual rectangle; determining whether the virtual rectangle corresponding to each note on the canvas intersects with the closed area, and if so, recording it as a note to be judged; determining whether the valid points in the note to be judged intersect with the closed area; and erasing the valid points in the note to be judged that intersect with the closed area. Thus, after determining that the touch operation is a valid circling operation and generating a closed area, the circling operation method first filters out the notes to be judged, and then erases the valid points in the note to be judged that intersect with the closed area, so as to efficiently perform circling and deletion. In addition, the circling operation method can also save computing resources, reduce latency, and improve efficiency.
[0058] For example, the aforementioned virtual rectangle may be a virtual rectangle formed by four straight lines passing through the topmost point, the bottommost point, the leftmost point, and the rightmost point of the note.
[0059] In some examples, the circle selection method further includes: traversing each handwriting, removing valid points that intersect the closed area, and generating new handwriting information; and redrawing the new handwriting information onto the canvas based on the new handwriting information. Thus, the circle selection method can implement a circle selection deletion function.
[0060] FIG3 is a flowchart of a circle deletion operation provided by an embodiment of the present disclosure. As shown in FIG3 , first determine whether the closed area intersects with the rectangle corresponding to each note (such as the virtual rectangle mentioned above), so as to determine whether each note on the canvas intersects with the closed area; if not, proceed to the next note for judgment; if intersecting, determine that the note is a note to be judged. Then, determine whether multiple rectangular areas in the note to be judged intersect with the closed area; if not, proceed to the next rectangular area for judgment; if intersecting, record the point corresponding to the rectangular area as the erasure point; then, traverse each note according to the recorded erasure point and generate a new note; finally, redraw or display the new note on the canvas.
[0061] In some examples, the circling operation method further includes determining whether the distance between the current touch point and the previous touch point is less than a third preset threshold; if so, determining that the current touch point is a redundant touch point and removing the redundant touch point; and if so, recording the current touch point as a valid touch point. Thus, the circling operation method can remove redundant touch points by performing the above determination upon receiving each touch point, thereby improving efficiency and enhancing the user experience.
[0062] For example, the third preset threshold is less than or equal to 5 pixels, so that it can effectively determine whether the current touch point reporting is a redundant point reporting.
[0063] In some examples, determining whether the distance between the current touch point and the previous touch point is less than a third preset threshold can also be done by determining whether the absolute value of the difference between the horizontal and vertical coordinates of the current touch point and the horizontal and vertical coordinates of the previous touch point is less than the third preset threshold.
[0064] For example, the third preset threshold may include two thresholds corresponding to the horizontal and vertical coordinates, for example: 3, 3; when the absolute value of the difference between the horizontal coordinate of the current touch point and the horizontal coordinate of the previous touch point is less than 3 pixels, and the absolute value of the difference between the vertical coordinate of the current touch point and the vertical coordinate of the previous touch point is less than 3 pixels, the current touch point is judged to be a redundant point.
[0065] FIG4 is a flow chart of another circling operation method provided by an embodiment of the present disclosure. As shown in FIG4, after detecting and receiving the touch reporting point of the touch operation, the distance between the current touch reporting point and the previous touch reporting point can be determined first. If it is less than a preset threshold, it is removed. If it is greater, it is recorded as a valid touch reporting point. Then, during the touch operation, the difference between the current slope and the previous slope is calculated and recorded, and it is determined whether the absolute value of the difference is greater than a preset threshold. If it is greater, the number of times is recorded. If the number is less than 2, it is determined to be an invalid circling operation. After the touch operation is completed, a touch operation is generated based on the multiple touch reporting points. The touch operation trajectory is calculated. If the length of the touch operation trajectory is less than a preset threshold, it is determined to be a valid circle selection operation. The straight-line distance between the starting touch reporting point and the ending touch reporting point is calculated, and the square of the trajectory length and the square of the straight-line distance are compared to determine whether it is a linear operation, that is, whether it is a circle selection operation. If it is a linear operation, it is determined to be an invalid circle selection operation. If the touch operation is neither an angle nor a linear operation, it is determined to be a valid circle selection operation. Finally, the starting touch reporting point and the ending touch reporting point of the touch operation are closed to form a closed area. As a result, this circle selection operation method can effectively eliminate many invalid circle selection operations, avoid misjudgments, and thus improve the user experience.
[0066] In some examples, the circle selection operation method further includes: determining whether a distance between a current touch reporting point and a previous touch reporting point is greater than a fourth preset threshold;
[0067] If it is greater than, use the following formula to supplement the touch reporting point: B(t)=(1-t) 2 P0+2t(1-t)P1+t 2 P2,t∈[0,1],
[0068] Where B is the touch point corresponding to different values of t. The coordinate value of P0 is the midpoint of the line connecting the two touch points before the current touch point and the previous touch point. The coordinate value of P1 is the touch point before the current touch point. The coordinate value of P2 is the midpoint between the previous touch point and the current touch point. It should be noted that the above-mentioned first two touch points refer to the touch point before the current touch point, not the two touch points.
[0069] In the circle selection operation method provided in this example, the circle selection operation method can supplement the touch point reporting by the above formula when the touch point reporting distance is far, so as to better simulate the trajectory actually desired by the user, thereby improving the user experience.
[0070] Figure 5 is a schematic diagram of a supplementary touch point reporting method provided by an embodiment of the present disclosure. As shown in Figure 5, the coordinate value of P0 is the midpoint of the line connecting the two touch points preceding the current touch point and the previous touch point, the coordinate value of P1 is the touch point preceding the current touch point, and the coordinate value of P2 is the midpoint between the previous touch point and the current touch point. Substituting the coordinates of these three points into the above formula yields point B.
[0071] In some examples, the value of the fourth preset threshold is greater than or equal to 10 pixels, so as to effectively determine whether additional touch point reporting is needed.
[0072] In some examples, the circle selection method further includes calculating B values for different values of t, and adding the multiple B values as touch point notifications. For example, when the distance between the current touch point notification and the previous touch point notification is greater than a fourth preset threshold, nine B values may be calculated for values of t of 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, and 0.9, and these nine B values may be added as touch points between the current touch point notification and the previous touch point notification. It should be noted that the number and value of t can be set according to actual needs.
[0073] In some examples, the fourth preset threshold can be divided into a plurality of thresholds of different levels, and then the number of touch reporting points that need to be supplemented is set according to the thresholds of different levels.
[0074] In some examples, the circling operation method further includes: determining whether the touch operation is in a circling operation mode, and if not, not performing the circling operation, thereby effectively avoiding misjudgment.
[0075] It is worth noting that in the circle selection operation method provided in the embodiment of the present disclosure, it is possible to determine whether the user is in the circle selection operation mode when the user's touch operation begins, and perform the above-mentioned slope determination during the user's touch operation, thereby eliminating the situation where the user draws straight lines and angles during the touch operation. Then, after the touch operation ends, the above-mentioned operation of determining whether the circle selection is closed is performed, thereby effectively eliminating various invalid circle selection operations, avoiding misjudgments, and improving the user experience.
[0076] It should be understood that the circle selection operation method provided by the embodiment of the present disclosure can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means.
[0077] An embodiment of the present disclosure also provides an electronic writing device. FIG6 is a schematic diagram of an electronic writing device provided by an embodiment of the present disclosure. As shown in FIG6 , the electronic writing device 200 includes a display touch module 210, a circle selection operation judgment module 220, and a circle selection closed area generation module 230; the display touch module 210 is configured to display a canvas and detect touch points of a touch operation; the circle selection operation judgment module 220 is configured to receive the touch points and determine whether the touch operation is a valid circle selection operation; the circle selection closed area generation module 230 is configured to generate a trajectory of the touch operation using the received multiple touch points when the touch operation is a valid circle selection operation, and close the starting touch point and the ending touch point of the touch operation to form a closed area.
[0078] The circle selection operation determination module 220 calculates and records the slope of the line connecting the current touch point and the previous touch point; calculates and records the difference between the current slope and the previous slope, and determines whether the absolute value of the difference is greater than a first preset threshold. If so, a count is performed; if the number of times the absolute value of the difference is greater than the first preset threshold is greater than 2, the touch operation is determined to be a valid circle selection operation, thereby determining whether the touch operation is a valid circle selection operation.
[0079] In the electronic writing device provided in the embodiments of the present disclosure, by determining whether the absolute value of the difference between the current slope and the previous slope is greater than a first preset threshold, the electronic writing device can prevent the user from drawing a straight line or a line close to a straight line. Furthermore, by determining whether the absolute value of the difference is greater than the first preset threshold a number of times greater than two, the electronic writing device can prevent the user from drawing corners. Thus, the electronic writing device can effectively and efficiently prevent the user from drawing straight lines and corners, thereby effectively eliminating invalid circling operations, avoiding misjudgments, and improving the user experience.
[0080] In some examples, the value of the first preset threshold is greater than or equal to 1, for example, 1, 1.5, 2, etc., thereby effectively preventing the user from drawing a straight line or a line close to a straight line.
[0081] In some examples, calculating and recording the slope of the line connecting the current touch point and the previous touch point includes: calculating the difference between the horizontal coordinate of the current touch point and the horizontal coordinate of the previous touch point, and recording it as a; calculating the difference between the vertical coordinate of the current touch point and the vertical coordinate of the previous touch point, and recording it as b; and the slope of the line connecting the current touch point and the previous touch point is b / a. Thus, the electronic writing device can obtain the slope of the line connecting the current touch point and the previous touch point.
[0082] In some examples, the circle selection operation determination module 220 is further configured to: before calculating and recording the slope of the line connecting the current touch point and the previous touch point, calculate and record the length of the circle selection trajectory between the starting touch point and the current touch point; compare the difference between the current circle selection trajectory length and the previous circle selection trajectory length to see if it is greater than a second preset threshold; if so, perform a subsequent slope determination and record the current circle selection trajectory length as the effective circle selection operation trajectory length for use in determining the next touch point. It should be noted that the above-mentioned slope determination refers to the operation or process of calculating and recording the slope of the line connecting the current touch point and the previous touch point; calculating and recording the difference between the current slope and the previous slope; and determining whether the absolute value of the difference is greater than the first preset threshold.
[0083] In the electronic writing device provided in this example, before performing slope judgment, by comparing whether the difference between the current circled track length and the previous circled track length is greater than a second preset threshold, the electronic writing device can prevent the problem of point reporting jitter caused by the touch point reporting distance being too short, thereby further improving the user experience.
[0084] In some examples, the second preset threshold is greater than or equal to 30 pixels, thereby effectively avoiding the problem of jitter in the touch reporting point caused by a short distance of the touch reporting point. It should be noted that the above-mentioned pixels refer to pixels on the display screen.
[0085] In some examples, the circling operation judgment module 220 is further configured to: calculate the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and record it as x; calculate the square of the difference between the vertical coordinate of the starting touch reporting point and the vertical coordinate of the ending touch reporting point, and record it as y; calculate the square of the length of the touch operation trajectory, and record it as z; and if z>(x+y)*C, then determine that the touch operation is a valid circling operation, and the value of C is greater than or equal to 1.5.
[0086] In the electronic writing device provided in this example, by comparing the square of the length of the touch operation trajectory and the square of the distance between the starting touch reporting point and the ending touch reporting point, the electronic writing device can further determine whether the user has circled and closed the behavior, thereby determining the effective circle selection behavior and excluding the invalid circle selection behavior, thereby avoiding misjudgment and improving the user experience. It should be noted that if z is less than (x+y)*C, the distance between the starting touch reporting point and the ending touch reporting point of the operation is relatively large, and the closing trend of the touch operation is not obvious. If subsequent operations (such as circle selection and deletion) are performed, the user's notes or drawings may be deleted, resulting in a poor user experience.
[0087] It is worth noting that the electronic writing device provided by the embodiments of the present disclosure can perform the aforementioned slope determination during the user's touch operation, thereby preventing the user from drawing straight lines and angles during the touch operation. Then, after the touch operation ends, the aforementioned operation of determining whether a circle is closed is performed, thereby effectively eliminating various invalid circle operations, avoiding misjudgments, and thus improving the user experience. Of course, the embodiments of the present disclosure include but are not limited to these, and the electronic writing device may also only perform the aforementioned slope determination or the aforementioned operation of determining whether a circle is closed.
[0088] In some examples, the above-mentioned display touch module includes an electronic ink screen, which has the advantages of being light and thin, wide viewing angle, anti-visual fatigue, eyesight protection, long battery life, and no flicker, making it convenient for users to read and write.
[0089] It should be understood that the division of the display and touch control module, the circle selection operation determination module, and the circled closed area generation module in the electronic writing device provided in the embodiments of the present disclosure is merely a logical functional division, and alternative divisions may be employed in actual implementation; for example, multiple modules may be combined or integrated into a single system, or some features of these modules may be ignored or not implemented. The display and touch control module, the circle selection operation determination module, and the circled closed area generation module may be physically separate or integrated as separate modules.
[0090] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, and when the computer program is run, the circle selection operation method provided in any of the above examples is executed.
[0091] For example, the computer-readable storage medium may include ROM, RAM, a magnetic disk, or an optical disk, etc. The storage medium may also include a non-volatile memory or a non-transitory memory, etc.
[0092] An embodiment of the present disclosure further provides an electronic device, comprising a processor and a memory that are communicatively connected, wherein the memory stores a calculation program, and the processor is configured to execute the calculator program to perform the circle selection operation method provided in any of the above examples.
[0093] It should be understood that in the embodiments of the present disclosure, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0094] It should also be understood that the memory in the embodiments of the present disclosure may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0095] There are a few points to note:
[0096] (1) The drawings of the embodiments of the present disclosure only relate to the structures related to the embodiments of the present disclosure, and other structures may refer to conventional designs.
[0097] (2) Unless there is any conflict, the features of the same embodiment and different embodiments of the present disclosure may be combined with each other.
[0098] The above are only specific embodiments of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A circle selection operation method, comprising: Detect and receive touch reporting points of touch operations; Determining whether the touch operation is a valid circle selection operation; as well as When the touch operation is a valid circle selection operation, a trajectory of the touch operation is generated using the received multiple touch reporting points, and the start touch reporting point and the end touch reporting point of the touch operation are closed to form a closed area, Wherein, determining whether the touch operation is a valid circle selection operation includes: Calculate and record the slope of the line connecting the current touch reporting point and the previous touch reporting point; Calculate and record the difference between the current slope and the previous slope, and determine whether the absolute value of the difference is greater than a first preset threshold, and if so, count; If the absolute value of the difference is greater than the first preset threshold for a number of times greater than 2, the touch operation is determined to be a valid circle selection operation.
2. The circle selection operation method according to claim 1, wherein: Before calculating and recording the slope of the line connecting the current touch reporting point and the previous touch reporting point, determining whether the touch operation is a valid circle selection operation further includes: Calculate and record the length of the circled track between the start touch point reporting and the current touch point reporting; Compare whether the difference between the current circle selection track length and the previous circle selection track length is greater than a second preset threshold. If so, perform subsequent slope determination and record the current circle selection track length as the effective circle selection operation track length for use in determining the next touch reporting point.
3. The circle selection operation method according to claim 2, wherein: The value of the second preset threshold is greater than or equal to 30 pixels.
4. The circle selection operation method according to claim 1, wherein: Determining whether the touch operation is a valid circle selection operation further includes: Calculating the length of a straight line between the start touch reporting point and the end touch reporting point; Calculating the length of the track of the touch operation; It is determined whether the length of the track of the touch operation is greater than the product of the straight line length and a preset value to determine whether the touch operation is a valid circle selection operation.
5. The circle selection operation method according to claim 4, wherein: Determining whether the length of the track of the touch operation is greater than the product of the straight line length and a preset value to determine whether the touch operation is a valid circle selection operation includes: Calculate the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and record it as x; Calculate the square of the difference between the ordinate of the starting touch reporting point and the ordinate of the ending touch reporting point, and record it as y; Calculate the square of the length of the track of the touch operation and record it as z; and If z>(x+y)*C, the touch operation is determined to be a valid circle selection operation. Among them, the value of C is greater than or equal to 1.
5.
6. The circle selection operation method according to any one of claims 1 to 5, wherein: The value of the first preset threshold is greater than or equal to 1.
7. The method for selecting a circle according to any one of claims 1 to 6, further comprising: Generate a virtual rectangle according to the positions of all valid points of each note on the canvas, wherein all valid points of the note fall within the range of the virtual rectangle; Determine whether the virtual rectangle corresponding to each note on the canvas intersects with the closed area, and if so, record it as a note to be determined; determine whether a valid point in the note to be determined intersects with the closed area; as well as Erasing the valid points in the note to be judged that intersect with the closed area.
8. The method for selecting a circle according to claim 7, further comprising: Traversing each handwriting, removing valid points intersecting with the closed area, and generating new handwriting information; as well as According to the new handwriting information, the new handwriting information is redrawn on the canvas.
9. The method for selecting a circle according to any one of claims 1 to 8, further comprising: Determine whether the distance between the current touch reporting point and the previous touch reporting point is less than a third preset threshold; If it is less than, the current touch reporting point is determined to be a redundant reporting point and the redundant reporting point is removed; if it is greater than, the current touch reporting point is recorded as a valid touch reporting point.
10. The circle selection operation method according to claim 9, wherein: The third preset threshold is less than or equal to 5 pixels.
11. The method for selecting a circle according to any one of claims 1 to 10, further comprising: Determine whether the distance between the current touch reporting point and the previous touch reporting point is greater than a fourth preset threshold; If it is greater, use the following formula to supplement the touch reporting point: B(t)=(1-t) 2 P0+2t(1-t)P1+t 2 P2,t∈[0,1], Among them, B is the touch reporting point corresponding to different values of t, the coordinate value of P0 is the midpoint of the line between the two touch reporting points before the current touch reporting point and the previous touch reporting point, the coordinate value of P1 is the touch reporting point before the current touch reporting point, and the coordinate value of P2 is the midpoint of the previous touch reporting point and the current touch reporting point.
12. The circle selection operation method according to claim 11, wherein: The value of the fourth preset threshold is greater than or equal to 10 pixels.
13. The method for selecting a circle according to claim 11, further comprising: Calculate the B value when t is different, and add multiple B values as touch reporting points.
14. An electronic writing device, comprising: A display touch module, configured to display the canvas and detect touch reporting points of touch operations; A circle selection operation judgment module is configured to receive the touch point report and judge whether the touch operation is a valid circle selection operation; The enclosed area generating module is configured to generate a track of the touch operation using the received multiple touch reporting points when the touch operation is a valid enclosed operation, and close the starting touch reporting point and the ending touch reporting point of the touch operation to form a closed area, Wherein, the circle selection operation judgment module is configured as follows: Calculate and record the slope of the line connecting the current touch reporting point and the previous touch reporting point; Calculate and record the difference between the current slope and the previous slope, and determine whether the absolute value of the difference is greater than a first preset threshold, and if so, count; If the absolute value of the difference is greater than the first preset threshold for a number of times greater than 2, the touch operation is determined to be a valid circle selection operation.
15. The electronic writing device according to claim 14, wherein: The circle selection operation determination module is further configured to: Before calculating and recording the slope of the line connecting the current touch point and the previous touch point, calculating and recording the length of the circled track between the starting touch point and the current touch point; Compare whether the difference between the current circle selection track length and the previous circle selection track length is greater than a second preset threshold. If so, perform subsequent slope determination and record the current circle selection track length as the effective circle selection operation track length for use in determining the next touch reporting point.
16. The electronic writing device according to claim 15, wherein: The value of the second preset threshold is greater than or equal to 30 pixels.
17. The electronic writing device according to claim 15, wherein: The circle selection operation determination module is further configured to: Calculate the square of the difference between the horizontal coordinate of the starting touch reporting point and the horizontal coordinate of the ending touch reporting point, and record it as x; Calculate the square of the difference between the ordinate of the starting touch reporting point and the ordinate of the ending touch reporting point, and record it as y; Calculate the square of the length of the track of the touch operation and record it as z; and If z>(x+y)*C, the touch operation is determined to be a valid circle selection operation. Among them, the value of C is greater than or equal to 1.
5.
18. The electronic writing device according to any one of claims 15 to 17, wherein: The display touch module includes an electronic ink screen.
19. A computer-readable storage medium, wherein:The computer-readable storage medium comprises a stored computer program, and when the computer program is executed, the circle selection operation method according to any one of claims 1 to 13 is executed.
20. An electronic device comprising a processor and a memory connected in communication, wherein: The memory stores a computer program, and the processor is configured to execute the computer program to perform the circle selection operation method according to any one of claims 1-13.