A trackball operation method and device, electronic equipment and storage medium

CN116266076BActive Publication Date: 2026-08-21SONOSCAPE MEDICAL CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111556188.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2026-08-21
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

在上述方案中,需要用户的手离开轨迹球点击其他按键,容易打断用户思路

Benefits of technology

[0041] As can be seen from the above scheme, the trackball operation method provided in this application includes: obtaining the current coordinate point confirmed by the trackball, and obtaining the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from front to back according to the confirmation time; determining the target distance between the current coordinate point and a first target key point; wherein, the first target key point is a key point in the key point set; determining the target angle between a first connecting line and a second connecting line; wherein, the first connecting line is the line connecting the current coordinate point and the first target key point, the second connecting line is the line connecting the first target key point and a second target key point, and the second target key point is an adjacent key point in the key point set before the first target key point; when the target distance and the target angle meet the backtracking condition, a backtracking operation is initiated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116266076B_ABST
    Figure CN116266076B_ABST
Patent Text Reader

Abstract

The application discloses a trackball operation method and device, an electronic device and a computer readable storage medium. The method comprises the following steps: acquiring a current coordinate point currently confirmed by a trackball, and acquiring a key point set of the trackball; the key point set comprises coordinate points historically confirmed by the trackball, and the key points in the key point set are sorted from front to back according to confirmation time; determining a target distance between the current coordinate point and a first target key point; the first target key point is a key point in the key point set; determining a target included angle between a first connecting line and a second connecting line; the first connecting line is a connecting line between the current coordinate point and the first target key point, the second connecting line is a connecting line between the first target key point and a second target key point, and the second target key point is an adjacent key point before the first target key point in the key point set; and when the target distance and the target included angle satisfy a back-off condition, responding to a back-off operation. The application improves the accuracy and efficiency of the back-off operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a trackball operation method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] During an ultrasound examination, the user manually traces the irregular image or spectrum using a trackball to draw an envelope that more closely matches the image edges. However, due to image irregularities and the operator's technique, the drawn line often deviates from the actual image. In such cases, a rollback operation is needed to allow the user to redraw the deviated portion.

[0003] In related technologies, the undo operation involves clicking a button (the Update button) on the device to rewind a fixed length of drawn line, allowing users to repeatedly click this button for continuous undo. However, this method requires the user to remove their hand from the trackball to click other buttons, easily interrupting the user's train of thought. More importantly, since the undo distance is fixed each time, it may not be the exact distance the user needs. If the fixed distance is too large, the user needs to redraw an excessively large area; if the fixed distance is too small, the user needs to click the button multiple times to achieve the desired undo distance. Therefore, the accuracy and efficiency of the undo operation in these technologies are relatively low.

[0004] Therefore, how to improve the accuracy and efficiency of rollback operations is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a trackball operation method, device, electronic device, and computer-readable storage medium, which improves the accuracy and efficiency of rollback operation.

[0006] To achieve the above objectives, this application provides a trackball operation method, including:

[0007] Obtain the current coordinates of the trackball that are currently confirmed, and obtain the key point set of the trackball; wherein, the key point set includes the coordinates of the trackball that have been confirmed in the past, and the key points in the key point set are sorted from the beginning to the end according to the confirmation time;

[0008] Determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points;

[0009] Determine the target angle between the first line and the second line; wherein, the first line is the line connecting the current coordinate point and the first target key point, the second line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set;

[0010] When the target distance and the included angle of the target meet the back-off conditions, a back-off operation is initiated.

[0011] Wherein, when the target distance and the included angle of the target satisfy the back-down condition, the back-down operation is initiated, including:

[0012] When the current coordinate point is determined to be within the fan-shaped area corresponding to the first target key point based on the target distance and the target angle, a rollback operation is initiated; wherein, the center of the circle containing the fan-shaped area is the first target key point, the radius is a preset distance threshold, the angular radius of the fan-shaped area is positively correlated with the preset angle threshold, and the second connecting line passes through the fan-shaped area.

[0013] Wherein, when the target distance and the included angle of the target satisfy the back-down condition, the back-down operation is initiated, including:

[0014] When the target distance is less than a distance threshold and the target angle is less than an angle threshold, a rollback operation is initiated.

[0015] Wherein, when the target distance is less than a distance threshold and the target angle is less than an angle threshold, a rollback operation is initiated, including:

[0016] Determine the maximum number of loops;

[0017] Determine if the current loop count is equal to the maximum loop count;

[0018] If so, then respond to the drawing operation;

[0019] If not, then determine whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold;

[0020] If the target distance is less than a distance threshold and the target angle is less than an angle threshold, then a rollback operation is initiated.

[0021] Before determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold, the method further includes:

[0022] Determine whether the number of key points in the key point set is less than a number threshold;

[0023] If so, then respond to the drawing operation;

[0024] If not, proceed to the steps of determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold.

[0025] Before determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold, the method further includes:

[0026] A distance threshold is calculated based on the current number of iterations; wherein the distance threshold is positively correlated with the current number of iterations.

[0027] The determination of the maximum number of loops includes:

[0028] The sparsity of the keypoint set is determined, and the maximum number of iterations is determined based on the sparsity of the keypoint set; wherein the maximum number of iterations is negatively correlated with the sparsity of the keypoint set.

[0029] Wherein, the first target key point is the last key point in the set of key points, and the second target key point is the second to last key point in the set of key points;

[0030] The method further includes:

[0031] When the target distance and the target angle do not meet the backtracking conditions, delete the first target key point in the key point set, determine the second target key point as the new first target key point, and re-determine whether the target distance and the target angle meet the backtracking conditions.

[0032] To achieve the above objectives, this application provides a trackball control device, comprising:

[0033] The acquisition module is used to acquire the current coordinate point confirmed by the trackball and to acquire the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from the beginning to the end according to the confirmation time;

[0034] The first determining module is used to determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points;

[0035] The second determining module is used to determine the target angle between the first connecting line and the second connecting line; wherein, the first connecting line is the line connecting the current coordinate point and the first target key point, the second connecting line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set;

[0036] The response module is used to respond to the back-down operation when the target distance and the included angle of the target meet the back-down conditions.

[0037] To achieve the above objectives, this application provides an electronic device, comprising:

[0038] Memory, used to store computer programs;

[0039] A processor is used to implement the steps of the trackball operation method described above when executing the computer program.

[0040] To achieve the above objectives, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the trackball operation method described above.

[0041] As can be seen from the above scheme, the trackball operation method provided in this application includes: obtaining the current coordinate point confirmed by the trackball, and obtaining the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from front to back according to the confirmation time; determining the target distance between the current coordinate point and a first target key point; wherein, the first target key point is a key point in the key point set; determining the target angle between a first connecting line and a second connecting line; wherein, the first connecting line is the line connecting the current coordinate point and the first target key point, the second connecting line is the line connecting the first target key point and a second target key point, and the second target key point is an adjacent key point in the key point set before the first target key point; when the target distance and the target angle meet the backtracking condition, a backtracking operation is initiated.

[0042] The trackball operation method provided in this application analyzes the current coordinates of the trackball to identify the user's true operational intent, distinguishing between normal drawing operations and undo operations. Therefore, in this application, the user only needs to operate the trackball throughout the entire process, without needing to switch buttons to complete the undo operation. The user can directly undo to the desired distance using the trackball, improving the accuracy and efficiency of the undo operation. This application also discloses a trackball operation device, an electronic device, and a computer-readable storage medium, which can achieve the same technical effects.

[0043] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings are used to provide a further understanding of this disclosure and constitute a part of the specification. They are used together with the following detailed description to explain this disclosure, but do not constitute a limitation of this disclosure. In the drawings:

[0045] Figure 1 This is a flowchart illustrating a trackball operation method according to an exemplary embodiment;

[0046] Figure 2 This is a schematic diagram illustrating a specific scenario according to an exemplary embodiment;

[0047] Figure 3 This is a flowchart illustrating another trackball operation method according to an exemplary embodiment;

[0048] Figure 4 This is a flowchart illustrating a rollback operation recognition algorithm according to an exemplary embodiment;

[0049] Figure 5 This is a schematic diagram illustrating another specific scenario according to an exemplary embodiment;

[0050] Figure 6 This is a schematic diagram illustrating yet another specific scenario according to an exemplary embodiment;

[0051] Figure 7 This is a structural diagram illustrating a trackball operation device according to an exemplary embodiment;

[0052] Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Furthermore, in the embodiments of this application, "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0054] This application discloses a trackball operation method that improves the accuracy and efficiency of rollback operations.

[0055] See Figure 1 A flowchart illustrating a trackball operation method according to an exemplary embodiment is shown below. Figure 1 As shown, it includes:

[0056] S101: Obtain the current coordinate point confirmed by the trackball, and obtain the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from front to back according to the confirmation time;

[0057] The execution subject in this embodiment can be an electronic device such as an ultrasound device, with the purpose of recognizing the user's operational intent, i.e., a drawing operation or a rollback operation. In specific implementation, after the user initiates a measurement, the system enters the tracing drawing state, and the user continuously moves the trackball to draw the trajectory. As one feasible implementation, the user needs to confirm all coordinate points in the trajectory using the trackball; the trajectory line is displayed as a dashed line, meaning that each dashed point in the dashed trajectory line represents a coordinate point confirmed by the trackball. As another feasible implementation, the user confirms some coordinate points in the trajectory using the trackball; the trajectory line is displayed as a solid line, and the connecting line between adjacent confirmed coordinate points is calculated and drawn according to the Bézier curve formula.

[0058] In this step, the currently confirmed coordinate point of the trackball is obtained, and a key point set consisting of historically confirmed key points is also obtained. As a possible implementation, obtaining the key point set of the trackball includes: obtaining the historical point set of the trackball; wherein the historical point set includes all coordinate points historically confirmed by the trackball; and extracting key points from the historical point set at preset intervals to generate a key point set.

[0059] In practice, all coordinate points confirmed by the trackball are added to the historical point set. Key points are extracted from the historical point set at preset intervals to generate a key point set. For example, if the historical point set includes 10 coordinate points confirmed by the trackball (a1, a2, ..., a10), and the preset interval is 2, then one key point is extracted every two coordinate points, resulting in a key point set of a1, a3, a5, a7, and a9. Because the density of historical point sets varies, a reasonable preset interval needs to be set to screen the original historical point set and obtain the key point set. This allows for the depiction of the positional features of the entire historical point set using a relatively small number of key points, without reducing the accuracy of subsequent calculations due to excessively dense coordinate points within the historical point set.

[0060] In some embodiments, the keypoint set generation process can also be as follows: all coordinate points confirmed by the trackball are added to the historical point set, and key points are determined from each coordinate point in the historical point set. For example, turning points, inflection points, etc., are determined as key points, thereby obtaining the keypoint set. Specifically, the angle between point A and the line connecting two adjacent points is determined. When the difference between this angle and 180° is sufficiently small, point A is determined as a turning point; in the curve formed by point B and several points adjacent to point B, if point B is the outermost point, then point B is determined as an inflection point.

[0061] S102: Determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points;

[0062] Among them, the first target key point is the key point in the key point set whose confirmation time is before the current coordinate point and adjacent to the current coordinate point.

[0063] It should be noted that the adjacency of two points (which can refer to the current coordinate point and any key point in the key point set, or any two key points in the key point set) can be understood as the confirmation times of these two points being adjacent (i.e., without any other points in between), or it can be understood as the confirmation time intervals of these two points being adjacent (i.e., with at least one point in between). Furthermore, the first target key point can be: the key point in the key point set whose confirmation time is the time preceding the confirmation time of the current coordinate point, i.e., the last key point in the key point set.

[0064] S103: Determine the target angle between the first line and the second line; wherein, the first line is the line connecting the current coordinate point and the first target key point, the second line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set;

[0065] The second target keypoint is at least one keypoint in the keypoint set whose confirmation time is prior to and adjacent to the first target keypoint. Further, the second target keypoint can be a keypoint in the keypoint set whose confirmation time is prior to the confirmation time of the second target keypoint. For example, when the first target keypoint is the last keypoint in the keypoint set, the second target keypoint can be the second-to-last keypoint in the keypoint set.

[0066] S104: When the target distance and the target angle meet the back-off condition, a back-off operation is initiated.

[0067] In specific implementation, the target distance between the current coordinate point and the first target key point in the key point set is determined. The target angle between the first line connecting the current coordinate point and the first target key point and the second line connecting the first target key point and its adjacent second target key point is determined; preferably, the second target key point is the key point preceding the first target key point in the key point set. When the target distance and target angle meet the backtracking condition, a backtracking operation is initiated. The backtracking condition is that the operation trend corresponding to the target distance and target angle is opposite to the direction of the already drawn trajectory line. When the target distance and target angle do not meet the backtracking condition, a normal drawing operation is initiated, i.e., the line connecting the first target key point and the current coordinate point is drawn.

[0068] As a feasible implementation, when the target distance and the target angle meet the back-off condition, a back-off operation is responded to, including: when the current coordinate point is within the fan-shaped area corresponding to the first target key point, a back-off operation is responded to; wherein, the center of the circle containing the fan-shaped area is the first target key point, the radius is a preset distance threshold, the angular radian of the fan-shaped area is positively correlated with the preset angle threshold, and the second connecting line passes through the fan-shaped area.

[0069] In this design, the center of the circle containing the fan-shaped region is the first target key point, and the radius is a preset distance threshold. The angular radius of the fan-shaped region is positively correlated with the preset angle threshold, and the second connecting line passes through the fan-shaped region. In a specific implementation, a circle is drawn with the first target key point as the center and the target distance as the radius. A fan-shaped region is then drawn within this circle. The angular radius of this fan-shaped region is positively correlated with the preset angle threshold, and the second connecting line passes through this fan-shaped region. That is, the fan-shaped region corresponding to the first target key point represents the retracement trend region of the first target key point. If the current coordinate point is located within this fan-shaped region, it indicates that the current coordinate point has a retracement trend, and a retracement operation is initiated accordingly. Furthermore, for the area surrounding the first target key point, the area outside the fan-shaped region can be defined as the drawing trend region of the trackball. If the current coordinate point is located within this drawing trend region (i.e., outside the fan-shaped region), it is determined that the current coordinate point is the coordinate point corresponding to the drawing operation, and a drawing operation corresponding to the current coordinate point is initiated.

[0070] To determine whether the current coordinate point is within the sector area, the coordinate value of the current coordinate point can be directly compared with the coordinate values ​​of each coordinate value within the sector area. When there are matching coordinate values, it is determined that the current coordinate point is within the sector area.

[0071] Alternatively, the location of the current coordinate point can be determined based on the target distance and the target angle. As a possible implementation, when the target distance and the target angle meet the backtracking conditions, a backtracking operation is initiated, including: when it is determined based on the target distance and the target angle that the current coordinate point is within the fan-shaped area corresponding to the first target key point, a backtracking operation is initiated.

[0072] In specific implementation, when the current coordinate point is within the fan-shaped area corresponding to the first target key point, a rollback operation is initiated, including: comparing the target distance with the radius of the fan-shaped area; determining the fan-shaped angle between the line containing any radius of the fan-shaped area and the second connecting line; comparing the target angle with the fan-shaped angle; and determining that the current coordinate point is within the fan-shaped area corresponding to the first target key point when the target distance is not greater than the radius of the fan-shaped area and the target angle is not greater than the fan-shaped angle.

[0073] Furthermore, if the radius of the sector is the distance threshold, the angular radius of the sector is twice the angle threshold, and it is symmetrical about the second connecting line, then when the current coordinate point is within the sector corresponding to the first target key point, a backtracking operation is triggered, including: when the target distance is not greater than the distance threshold and the target angle is not greater than the angle threshold, it is determined that the current coordinate point is within the sector corresponding to the first target key point, and a backtracking operation is triggered.

[0074] As a feasible implementation, when the target distance and the target angle meet the backoff conditions, a backoff operation is initiated, including: when the target distance between the current coordinate point and the first target key point is less than a distance threshold and the target angle between the first connecting line and the second connecting line is less than an angle threshold, a backoff operation is initiated. In a specific implementation, if the number of key points in the key point set is less than a quantity threshold, preferably 2, a drawing operation is initiated directly; otherwise, it is determined whether the target distance is greater than the distance threshold. If the target distance is greater than the distance threshold, a drawing operation is initiated. If the target distance is not greater than the distance threshold, it is determined whether the target angle is greater than an angle threshold. If the target angle is greater than the angle threshold, a drawing operation is initiated. If the target angle is not greater than the angle threshold, a backoff operation is initiated.

[0075] As can be seen, in this embodiment, if the user is not satisfied with the drawn trajectory line, they can undo it by moving the trackball. The electronic device judges the user's movement trend of the trackball in real time. If the movement trend is opposite to the direction of the drawn trajectory line, it is determined that the user needs to undo the operation; otherwise, it is determined that the user is performing a normal drawing operation.

[0076] For example, such as Figure 2 As shown, Figure 2The middle arrow indicates the direction of the user's movement of the trackball. The current coordinate point is a blank point, and the keypoints are black points. The last keypoint in the keypoint set is black point 1, and the second-to-last keypoint is black point 2. If the current coordinate point is blank point 0, the distance between blank point 0 and black point 1 is less than a distance threshold, and the angle between the line connecting blank point 0 and black point 1 and the line connecting black point 1 and black point 2 is greater than an angle threshold; therefore, a drawing operation is triggered. If the current coordinate point is blank point 1, the distance between blank point 1 and black point 1 is greater than a distance threshold, and the angle between the line connecting blank point 1 and black point 1 and the line connecting black point 1 and black point 2 is greater than an angle threshold; therefore, a drawing operation is triggered. If the current coordinate point is blank point 2, the distance between blank point 2 and black point 1 is less than a distance threshold, and the angle between the line connecting blank point 2 and black point 1 and the line connecting black point 1 and black point 2 is less than an angle threshold; therefore, a rollback operation is triggered. If the current coordinate point is blank point 3, the distance between blank point 3 and black point 1 is less than the distance threshold, and the angle between the line connecting blank point 3 and black point 1 and the line connecting black point 1 and black point 2 is greater than the angle threshold, then a drawing operation is triggered.

[0077] The trackball operation method provided in this application analyzes the current coordinates of the trackball to identify the user's true operation intention and distinguish between normal drawing operations and undo operations. Therefore, in this application embodiment, the user only needs to operate the trackball throughout the entire process and does not need to switch buttons to complete the undo operation. The user can directly undo to the desired distance using the trackball, improving the accuracy and efficiency of the undo operation.

[0078] This application discloses a trackball operation method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0079] See Figure 3 A flowchart illustrating another trackball operation method according to an exemplary embodiment, such as... Figure 3 As shown, it includes:

[0080] S201: Obtain the historical point set of the trackball; wherein, the historical point set includes all coordinate points historically confirmed by the trackball;

[0081] S202: Extract key points from the historical point set at preset intervals to generate a key point set;

[0082] S203: Determine the maximum number of loops;

[0083] In this embodiment, different maximum number of loops can be set for different application scenarios to further improve the accuracy of the rollback operation. The maximum number of loops can be negatively correlated with the sparsity of the keypoint set; that is, the sparser the coordinates of the keypoint set, the smaller the number of loops, and the denser the coordinates of the keypoint set, the larger the number of loops. The maximum number of loops can also be negatively correlated with the sparsity of the historical point set; that is, the sparser the coordinates of the historical point set, the smaller the number of loops, and the denser the coordinates of the historical point set, the larger the number of loops. For example, the minimum number of loops is 1, and the maximum number of loops can be 5.

[0084] In one embodiment, determining the maximum number of iterations includes: determining the sparsity of the keypoint set, and determining the maximum number of iterations based on the sparsity of the keypoint set; wherein the maximum number of iterations is negatively correlated with the sparsity of the keypoint set.

[0085] S204: Determine whether the current loop count is equal to the maximum loop count; if yes, proceed to S208; if no, proceed to S205.

[0086] S205: Determine whether the target distance between the current coordinate point and the first target key point is less than the distance threshold, and whether the target angle between the first connecting line and the second connecting line is less than the angle threshold; if both are true, proceed to S207; otherwise, proceed to S206.

[0087] Wherein, the first target key point is the last key point in the set of key points, the first connecting line is the connecting line between the current coordinate point and the first target key point, the second connecting line is the connecting line between the first target key point and the second target key point, and the second target key point is the second to last key point in the set of key points;

[0088] S206: Delete the first target key point from the set of key points, determine the second target key point as the new first target key point, and re-enter S204.

[0089] S207: Respond to rollback operation;

[0090] S208: Respond to drawing operations.

[0091] In practical implementation, the algorithm for recognizing rollback operations is as follows: Figure 4As shown, the algorithm's total input parameters include the current coordinates, the historical point set, the preset interval for keypoint extraction, the default distance threshold, the angle threshold, and the maximum number of iterations. For example, the angle threshold is 5 degrees. The default distance threshold is 10, and the maximum number of iterations is 5. The algorithm's total output parameters include `true` and `false`. `true` indicates that a backtracking operation is performed, and the latest historical point set is returned. `false` indicates that no backtracking operation is performed, and the original input historical point set remains unchanged.

[0092] The loop count starts from 0. In the 0th loop, the last keypoint in the keypoint set is used in the calculation (as the aforementioned first target keypoint). In the 1st loop, the second to last keypoint is used in the calculation, and so on. That is, after each loop, the last keypoint in the keypoint set is discarded, and the second to last keypoint in the original keypoint set becomes the last keypoint in the current keypoint set.

[0093] In the specific implementation, in the 0th loop, it is determined whether the distance between the current coordinate point and the last key point in the key point set is greater than the distance threshold, and whether the angle between the first line connecting the current coordinate point and the last key point in the key point set and the second line connecting the last key point and the second-to-last key point in the key point set is greater than the angle threshold. If both are true, then proceed to S207; otherwise, delete the last key point in the key point set and proceed to the next loop, i.e., the 1st loop.

[0094] In a preferred embodiment, before determining whether the target distance between the current coordinate point and the first target key point is less than a distance threshold, and whether the target angle between the first connecting line and the second connecting line is less than an angle threshold, the method further includes: calculating the distance threshold based on the current loop count; wherein the distance threshold is positively correlated with the current loop count. The current loop count is the number of iterations in this current iteration. It can be understood that the current loop count is incremented by 1. Furthermore, as the current loop count increases, the distance threshold increases continuously.

[0095] Understandably, for normal drawing operations, the current coordinate point is closest to the last keypoint in the keypoint set, and farther away from keypoints further back in the set. Therefore, the distance threshold needs to increase with the number of iterations. Preferably, the distance threshold is calculated using the following formula: D = d × (n + 1), where D is the distance threshold, d is the default distance threshold, and n is the current iteration count. In practice, a default distance threshold d is set, and the iteration count starts from 0. In the 0th iteration, the distance threshold D = d; in the 1st iteration, the distance threshold D = 2d, and so on.

[0096] In the specific application scenario of ultrasound diagnosis, ultrasound images or spectra are often highly irregular. When rendering edges, there may be many large-angle curves, such as rapidly forming a curve close to 180 degrees within a certain range. On the other hand, when the user is not satisfied with the previous curve, they can also undo the previous curve by moving backward. Therefore, in the ultrasound diagnostic scenario, it is necessary to distinguish between the intent of large-angle rendering operations and the intent of undoing operations.

[0097] For example, such as Figure 5 As shown, black dots represent key points, and blank dots represent the current coordinates. Figure 5 The extracted keypoint set is still relatively dense, resulting in very small differences in the changes between keypoint 3 and keypoint 2, and between keypoint 2 and keypoint 1. In the 0th loop, the distance between the current coordinate point 0 and keypoint 1 is greater than the distance threshold, so no backtracking is determined. Furthermore, keypoint 1 is discarded. In the 1st loop, the distance between the current coordinate point 0 and keypoint 2 is less than the distance threshold, and the angle between the line connecting the current coordinate point 0 and keypoint 2 and keypoint 1 and keypoint 2 is less than the angle threshold, so backtracking is determined.

[0098] like Figure 6 As shown, in the 0th loop, the distance between the current coordinate point 0 and key point 1 is greater than the distance threshold, so no backtracking is determined. After discarding key point 1, in the 1st loop, the distance between the current coordinate point 0 and key point 2 is less than the distance threshold, but the angle threshold between the line connecting the current coordinate point 0 and key point 2 and key point 1 and key point 2 is greater than the angle threshold, so no backtracking is determined. It can be considered that the user's behavior is to draw a raised shape; therefore, this embodiment can avoid drawing similar shapes. Figure 6 When small bumps are incorrectly identified as rollback, the automatic rollback function using a trackball is not affected by large-angle drawing operations, thus improving the accuracy of rollback operations.

[0099] The following describes a trackball operation device provided in an embodiment of this application. The trackball operation device described below and the trackball operation method described above can be referred to each other.

[0100] See Figure 7 A structural diagram of a trackball operation device according to an exemplary embodiment is shown, as follows: Figure 7 As shown, it includes:

[0101] The acquisition module 701 is used to acquire the current coordinate point confirmed by the trackball and to acquire the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from front to back according to the confirmation time;

[0102] The first determining module 702 is used to determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points;

[0103] The second determining module 703 is used to determine the target angle between the first connecting line and the second connecting line; wherein, the first connecting line is the line connecting the current coordinate point and the first target key point, the second connecting line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set;

[0104] The response module 704 is used to respond to the back-off operation when the target distance and the target angle meet the back-off conditions.

[0105] The trackball control device provided in this application analyzes the current coordinates of the trackball to identify the user's true operational intent, distinguishing between normal drawing operations and undo operations. Therefore, in this application embodiment, the user only needs to operate the trackball throughout the entire process, without needing to switch buttons to complete the undo operation. The user can directly undo to the desired distance using the trackball, improving the accuracy and efficiency of the undo operation.

[0106] Based on the above embodiments, as a preferred implementation, the response module 704 is specifically a module that responds to a backtracking operation when it is determined that the current coordinate point is within the fan-shaped area corresponding to the first target key point based on the target distance and the target angle; wherein, the center of the circle containing the fan-shaped area is the first target key point, the radius is a preset distance threshold, the angular radius of the fan-shaped area is positively correlated with the preset angle threshold, and the second connecting line passes through the fan-shaped area.

[0107] Based on the above embodiments, as a preferred implementation, the response module 704 is specifically a module that responds to a backoff operation when the target distance is less than a distance threshold and the target angle is less than an angle threshold.

[0108] Based on the above embodiments, as a preferred embodiment, the response module 704 includes:

[0109] A determination unit is used to determine the maximum number of loops;

[0110] The first judgment unit is used to determine whether the current loop count is equal to the maximum loop count; if yes, it responds to the drawing operation; if no, it starts the workflow of the second judgment unit.

[0111] The second judgment unit is used to determine whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold; if both are true, a rollback operation is initiated.

[0112] Based on the above embodiments, as a preferred embodiment, the response module 704 further includes:

[0113] The third judgment unit is used to determine whether the number of key points in the key point set is less than the number threshold; if yes, it responds to the drawing operation; if no, it starts the workflow of the second judgment unit.

[0114] Based on the above embodiments, as a preferred embodiment, the response module 704 further includes:

[0115] A calculation unit is used to calculate a distance threshold based on the current number of iterations; wherein the distance threshold is positively correlated with the current number of iterations.

[0116] Based on the above embodiments, as a preferred implementation, the determining unit is specifically a unit that determines the sparsity of the key point set and determines the maximum number of iterations based on the sparsity of the key point set; wherein, the maximum number of iterations is negatively correlated with the sparsity of the key point set.

[0117] Based on the above embodiments, as a preferred embodiment, the first target key point is the last key point in the key point set, and the second target key point is the second to last key point in the key point set;

[0118] The response module 704 further includes:

[0119] The deletion module is used to delete the first target key point in the key point set, determine the second target key point as the new first target key point, and restart the workflow of the first judgment unit when the target distance and the target angle do not meet the backtracking conditions.

[0120] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0121] Based on the hardware implementation of the above-described program modules, and in order to implement the method of this application embodiment, this application embodiment also provides an electronic device. This electronic device can be a medical device such as an ultrasound device. Figure 8 This is a structural diagram of an electronic device according to an exemplary embodiment, such as... Figure 8 As shown, the electronic device includes:

[0122] Communication interface 1 enables information exchange with other devices, such as network devices;

[0123] Processor 2 is connected to communication interface 1 to enable information interaction with other devices and, when running a computer program, executes the trackball operation method provided by one or more of the above-mentioned technical solutions. The computer program is stored in memory 3.

[0124] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general will label all buses as Bus System 4.

[0125] The memory 3 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0126] It is understood that memory 3 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 3 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0127] The methods disclosed in the embodiments of this application can be applied to processor 2, or implemented by processor 2. Processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 2 or by instructions in the form of software. The processor 2 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 3. Processor 2 reads the program in memory 3 and completes the steps of the aforementioned method in combination with its hardware.

[0128] When processor 2 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0129] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 3 that stores a computer program, which can be executed by a processor 2 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0130] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0131] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0132] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A trackball operation method, characterized in that, include: Obtain the current coordinates of the trackball that are currently confirmed, and obtain the key point set of the trackball; wherein, the key point set includes the coordinates of the trackball that have been confirmed in the past, and the key points in the key point set are sorted from the beginning to the end according to the confirmation time; Determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points; Determine the target angle between the first line and the second line; wherein, the first line is the line connecting the current coordinate point and the first target key point, the second line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set; Determine the maximum number of loops; Determine if the current loop count is equal to the maximum loop count; If not, a rollback operation is initiated when the target distance and the included angle of the target satisfy the rollback condition; wherein, the target distance is determined based on a distance threshold, which is calculated based on the current number of loops, and the distance threshold is positively correlated with the current number of loops.

2. The trackball operation method according to claim 1, characterized in that, When the target distance and the included angle of the target satisfy the backoff condition, a backoff operation is initiated, including: When the current coordinate point is determined to be within the fan-shaped area corresponding to the first target key point based on the target distance and the target angle, a rollback operation is initiated; wherein, the center of the circle containing the fan-shaped area is the first target key point, the radius is a preset distance threshold, the angular radius of the fan-shaped area is positively correlated with the preset angle threshold, and the second connecting line passes through the fan-shaped area.

3. The trackball operation method according to claim 1, characterized in that, When the target distance and the included angle of the target satisfy the backoff condition, a backoff operation is initiated, including: When the target distance is less than a distance threshold and the target angle is less than an angle threshold, a rollback operation is initiated.

4. The trackball operation method according to claim 1, characterized in that, After determining whether the current loop count is equal to the maximum loop count, the method further includes: If the current loop count is equal to the maximum loop count, then a drawing operation is performed.

5. The trackball operation method according to claim 4, characterized in that, Before determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold, the method further includes: Determine whether the number of key points in the key point set is less than a number threshold; If so, then respond to the drawing operation; If not, proceed to the steps of determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold.

6. The trackball operation method according to claim 4, characterized in that, Before determining whether the target distance is less than a distance threshold and whether the target angle is less than an angle threshold, the method further includes: A distance threshold is calculated based on the current number of iterations; wherein the distance threshold is positively correlated with the current number of iterations.

7. The trackball operation method according to any one of claims 1 to 6, characterized in that, The first target key point is the last key point in the set of key points, and the second target key point is the second to last key point in the set of key points; The method further includes: When the target distance and the target angle do not meet the backtracking conditions, delete the first target key point in the key point set, determine the second target key point as the new first target key point, and re-determine whether the target distance and the target angle meet the backtracking conditions.

8. A trackball control device, characterized in that, include: The acquisition module is used to acquire the current coordinate point confirmed by the trackball and to acquire the key point set of the trackball; wherein, the key point set includes the coordinate points confirmed by the trackball in the past, and the key points in the key point set are sorted from the beginning to the end according to the confirmation time; The first determining module is used to determine the target distance between the current coordinate point and the first target key point; wherein, the first target key point is a key point in the set of key points; The second determining module is used to determine the target angle between the first connecting line and the second connecting line; wherein, the first connecting line is the line connecting the current coordinate point and the first target key point, the second connecting line is the line connecting the first target key point and the second target key point, and the second target key point is the adjacent key point before the first target key point in the key point set; The response module is used to determine the maximum number of loops; determine whether the current number of loops is equal to the maximum number of loops; if not, when the target distance and the target angle meet the backoff condition, a backoff operation is performed; wherein, the determination of whether the target distance meets the backoff condition is based on a distance threshold, the distance threshold is calculated based on the current number of loops, and the distance threshold is positively correlated with the current number of loops.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the trackball operation method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the trackball operation method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for recognizing motion direction of touch track on touch screen

    CN104123026A

  • Electronic whiteboard trace tracking method and apparatus

    CN105468208A