Curve editing method and device, electronic equipment and storage medium
By using fixed point groups and cursor control points to perform curve fitting on medical images, and generating and displaying the fitted curve segments, the problems of cumbersome and inefficient operation in the prior art are solved, and efficient curve editing is achieved.
Patent Information
- Application Number
- CN202410060448.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-07-18
AI Technical Summary
The existing curve editing methods are cumbersome and inefficient. When the user repeatedly adjusts, the last editing result will overwrite the next editing result, resulting in an increase in operation time.
By obtaining the fixed point group and cursor control points on the curve to be edited, multiple control points are determined in real time for curve fitting, forming fitted curve segments, and displaying fixed curve segments and fitted curve segments on the display interface. When the user is satisfied, the user enters a determination instruction to replace the curve to be edited.
It simplifies curve editing operations, improves editing efficiency, avoids frequent coverage of users' work results, facilitates users to observe and adjust curves in real time, and reduces editing complexity.
Smart Images

Figure CN120339446A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular, to a curve editing method, an apparatus, an electronic device, and a storage medium. Background Art
[0002] Medical imaging technology is a widely used non-invasive or minimally invasive diagnostic technology that can image human tissues and organs through various imaging techniques to obtain images of human tissues and assist users in measuring and diagnosing lesions of human tissues and organs.
[0003] It is often necessary to identify and measure the boundary of a target object in the human body on a medical image. The target object can also be referred to as a target observation object, which can be, for example, a lesion site. Usually, the trace curve of the target object is automatically recognized by an image algorithm or manually drawn by a person, which can provide an accurate measurement basis for the measurement of the target object. However, since there may be a deviation between the trace curve generated automatically or manually drawn and the boundary of the actual target object, a secondary editing technology for the initially generated trace curve needs to be provided to compensate for the curve error caused by automatic recognition or manual drawing to a certain extent.
[0004] In the existing curve editing methods, a new fitted curve is directly used to replace the entire original curve. This existing curve editing method is not only cumbersome and inefficient in operation, but also when the user adjusts repeatedly, the next editing result will completely cover the previous editing result, bringing great inconvenience to the user and also greatly increasing the operation time. Summary of the Invention
[0005] The present invention is proposed in view of the above problems. The present invention provides a curve editing method, a curve editing apparatus, an electronic device, and a storage medium.
[0006] According to one aspect of the present invention, there is provided a curve editing method, the method comprising: obtaining at least two curve points on a curve to be edited, the curve to be edited being a traced curve for indicating the position of at least a part of the edge of an object of interest on a medical image; the at least two curve points including a fixed point group, the fixed point group including at least two fixed points; determining in real time a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group, and performing curve fitting based on the cursor control point and the plurality of control points to obtain a fitted curve segment, wherein the cursor control point is the point corresponding to the current cursor position on the medical image, and the plurality of control points are located between two target fixed points in the fixed point group; displaying in real time on a display interface a medical image including a real-time curve, wherein the real-time curve includes a fixed curve segment and a fitted curve segment, the fixed curve segment being the curve segment of the curve to be edited other than the target curve segment, and the target curve segment being the curve segment between two control points at both ends of the plurality of control points; and in response to a first determination instruction input by a user, replacing the curve to be edited with the real-time curve.
[0007] Exemplarily, determining a target curve point group from among the at least two curve points based on the distances between the cursor control point and each curve point among the at least two curve points includes: calculating the distances between the cursor control point and each curve point among the at least two curve points to determine a reference curve point, the reference curve point being the curve point among the at least two curve points that is closest to the cursor control point; taking the position of the reference curve point on the curve to be edited as a reference, and respectively determining corresponding target curve point groups along a first direction and a second direction; wherein the first direction and the second direction are opposite, and the target curve point group includes a first curve point and a second curve point, the first curve point being the curve point whose distance from the cursor control point is closest to a first target distance, and the second curve point being the curve point whose distance from the cursor control point is closest to a second target distance, and the first target distance is less than the second target distance.
[0008] Exemplarily, selecting, from the determined target curve point group and the fixed point group, the curve points located between two target fixed points as the plurality of control points includes: taking the first direction and the second direction respectively as target directions, and taking the position of the reference curve point on the curve to be edited as a reference, selecting one or more curve points from the target curve point group and the fixed points in the target direction as control points in the target direction; wherein the first direction and the second direction are opposite, the one or more curve points are located between the reference curve point and the target fixed point in the target direction, and among the target curve point group and the fixed points in the target direction, sorted in ascending order of the number of curve points separated from the reference curve point, the one or more curve points are at the front; wherein the reference curve point is the curve point among the at least two curve points that is closest to the cursor control point; and the target fixed point is the fixed point with the smallest number of curve points separated from the reference curve point in the target direction.
[0009] Exemplarily, selecting one or more curve points as control points in the target direction from the target curve point group and the fixed points in the target direction includes: if there is no additional fixed point in the target direction, selecting the first curve point and the second curve point in the target direction as the control points in the target direction; wherein, the target curve point group includes the first curve point and the second curve point, the first curve point is the curve point with the distance closest to the first target distance from the reference curve point, the second curve point is the curve point with the distance closest to the second target distance from the reference curve point, and the first target distance is less than the second target distance; if there is an additional fixed point in the target direction, perform the following operations: if the number of third intervals is less than or equal to the number of first intervals, selecting the target fixed point in the target direction as the control point in the target direction; if the number of third intervals is greater than the number of first intervals and less than the number of second intervals, selecting the first curve point and the target fixed point in the target direction as the control points in the target direction; if the number of third intervals is greater than or equal to the number of second intervals, selecting the first curve point and the second curve point in the second target direction as the control points in the target direction; wherein, the number of first intervals is the number of curve points separated between the first curve point and the reference curve point, the number of second intervals is the number of curve points separated between the second curve point and the reference curve point, and the number of third intervals is the number of curve points separated between the target fixed point and the reference curve point; wherein, when the curve to be edited is a non-closed curve, the additional fixed point is the fixed point in the fixed point group other than the starting curve point and the ending curve point of the curve to be edited; when the curve to be edited is a closed curve, the additional fixed point is the fixed point in the fixed point group.
[0010] Exemplarily, when the curve to be edited is a non-closed curve, at least two curve points each have a corresponding serial number, and the serial numbers are arranged from small to large in the first direction; when the target direction is the first direction, there is the following relationship: the serial number of the target fixed point is less than or equal to the serial number of the first curve point, indicating that the number of third intervals is less than or equal to the number of first intervals; the serial number of the target fixed point is greater than the serial number of the first curve point and less than the serial number of the second curve point, indicating that the number of third intervals is greater than the number of first intervals and less than the number of second intervals; the serial number of the target fixed point is greater than or equal to the serial number of the second curve point, indicating that the number of third intervals is greater than or equal to the number of second intervals; when the target direction is the second direction, there is the following relationship: the serial number of the target fixed point is greater than or equal to the serial number of the first curve point, indicating that the number of third intervals is less than or equal to the number of first intervals; the serial number of the target fixed point is less than the serial number of the first curve point and greater than the serial number of the second curve point, indicating that the number of third intervals is greater than the number of first intervals and less than the number of second intervals; the serial number of the target fixed point is less than or equal to the serial number of the second curve point, indicating that the number of third intervals is greater than or equal to the number of second intervals.
[0011] Exemplarily, the multiple control points include control points located in a first direction with reference to a reference curve point and control points located in a second direction, where the reference curve point is the curve point closest to the cursor control point among at least two curve points, and the first direction and the second direction are opposite. Among them, curve fitting is performed based on the cursor control point and the multiple control points to obtain a fitted curve segment, including: determining a first control point sequence based on the cursor control point and at least some of the control points located in the first direction among the multiple control points; determining a second control point sequence based on the cursor control point and at least some of the control points located in the second direction among the multiple control points; performing curve fitting based on the first control point sequence and the second control point sequence to obtain a fitted curve segment; where each control point in the first control point sequence is expressed as: C1 = {L M ,L M +A(L c11 -L c21 ),L c11 -B(L c12 -L M ),L c11}; and / or, where each control point in the second control point sequence is expressed as: C2 = {L c21 ,L c21 +A(L M -L c22 ),L M -B(L c11 -L c21 ),L M}; where C1 represents the first control point sequence, C2 represents the second control point sequence, L M represents the position corresponding to the cursor control point, L c11 represents the position corresponding to the first control point located in the first direction, L c12 represents the position corresponding to the second control point located in the first direction, L c21 represents the position corresponding to the first control point located in the second direction, L c22 represents the position corresponding to the second control point located in the second direction, and A and B respectively represent two preset parameters and the sum of A and B is 1; where the first control point is the control point with the smallest number of curve points separated from the reference curve point among the control points in the corresponding direction, and the second control point is the control point with the largest number of curve points separated from the reference curve point among the control points in the corresponding direction.
[0012] Exemplarily, curve fitting is performed based on a first control point sequence and a second control point sequence to obtain a fitted curve segment, including: calculating an average distance between adjacent curve points among at least two curve points; calculating a first total distance between each control point in the first control point sequence and a second total distance between each second control point in the second control point sequence; determining a first interpolation point number based on the average distance and the first total distance, and determining a second interpolation point number based on the average distance and the second total distance, where the first interpolation point number is equal to the integer obtained by dividing the first total distance by the average distance, and the second interpolation point number is equal to the integer obtained by dividing the second total distance by the average distance; performing interpolation on the first control point sequence according to the first interpolation point number, and performing interpolation on the second control point sequence according to the second interpolation point number to obtain an interpolated control point sequence; performing curve fitting based on the interpolated control point sequence to obtain an initial curve segment or a fitted curve segment; when obtaining the initial curve segment, determining the fitted curve segment based on the initial curve segment.
[0013] According to another aspect of the present invention, there is also provided a curve editing device, including: an acquisition module, configured to acquire at least two curve points on a curve to be edited, where the curve to be edited is a tracing curve for indicating the position of at least part of the edge of a target object on a medical image; at least two curve points include a fixed point group, and the fixed point group includes at least two fixed points; a determination module, configured to determine, in real time, a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group, and perform curve fitting based on the cursor control point and the plurality of control points to obtain a fitted curve segment, where the cursor control point is a point corresponding to the current cursor position on the medical image, and the control points among the plurality of control points located on the curve to be edited are located between two target fixed points in the fixed point group; a display module, configured to display, in real time, a medical image including a real-time curve on a display interface, where the real-time curve includes a fixed curve segment and a fitted curve segment, the fixed curve segment is a curve segment other than the target curve segment in the curve to be edited, and the target curve segment is a curve segment between two control points at both ends of the plurality of control points; a replacement module, configured to replace the curve to be edited with the real-time curve in response to a first determination instruction input by the user.
[0014] According to still another aspect of the present invention, there is also provided an electronic device, including a processor and a memory, where a computer program is stored in the memory, and when the computer program instructions are run by the processor, they are used to execute the above-mentioned curve editing method.
[0015] According to yet another aspect of the present invention, there is also provided a storage medium storing a computer program / instructions, and when the computer program / instructions are run, they are used to execute the above-mentioned curve editing method.
[0016] Curve editing method, curve editing device, electronic device and storage medium according to an embodiment of the present invention. At least two curve points including a fixed point group are obtained on the curve to be edited. In this way, the editable range of the curve can be controlled by setting fixed points, and then at least part of the curve to be edited can be edited. A plurality of control points can be determined based on the cursor control point and the fixed point group, and curve fitting can be performed in real time based on the cursor control point and the plurality of control points. The real-time curve obtained by fitting can be displayed on the display interface, which can facilitate the user to quickly find the traced curve that meets the requirements by viewing the fitting result of the traced curve in real time. The solution of displaying the real-time closed curve based on the cursor position does not require the user to specifically set control points, which can reduce the complexity of the editing operation. In addition, after the user inputs the first confirmation instruction, the curve to be edited is replaced with the real-time closed curve. When the user does not input the first confirmation instruction, the real-time curve is generated and displayed in real time following the cursor position. This solution can facilitate the user to replace the curve when the real-time curve meets the user's requirements on the basis of ensuring that the user can observe the curve fitting effect in real time, and avoid frequent overwriting of the closed curve to be edited. In addition, the above solution restricts the editable range of the curve to be edited through fixed points, so that the user can fix the curve segments that meet the requirements on the curve to be edited through fixed points, and continue to edit other curve segments that do not meet the requirements. Therefore, this solution can avoid changing the previously edited curve segments during user adjustment and wasting the user's work results. This solution can effectively simplify the user's operation process, thereby greatly improving the efficiency of curve editing.
[0017] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are specifically exemplified below. Brief Description of the Drawings
[0018] By describing the embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features and advantages of the present invention will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention. In the drawings, the same reference numerals generally represent the same components or steps.
[0019] Figure 1 A schematic block diagram showing a curve editing method according to an embodiment of the present invention;
[0020] Figure 2 A schematic diagram showing a non-closed curve according to an embodiment of the present invention;
[0021] Figure 3Shows a schematic diagram of editing a curve to be edited according to an embodiment of the present invention;
[0022] Figure 4 Shows a schematic diagram of editing a curve to be edited according to another embodiment of the present invention;
[0023] Figure 5 Shows a schematic flowchart of a curve editing method according to another embodiment of the present invention;
[0024] Figure 6 Shows a schematic flowchart of a curve editing method according to a specific embodiment of the present invention;
[0025] Figure 7 Shows a schematic block diagram of a curve editing device according to an embodiment of the present invention; and
[0026] Figure 8 Shows a schematic block diagram of an electronic device according to an embodiment of the present invention. Detailed Description of Specific Embodiments
[0027] In order to make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Apparently, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein. Based on the embodiments described in the present invention, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present invention.
[0028] To solve the above technical problems, the present invention provides a curve editing method. Figure 1 Shows a schematic block diagram of a curve editing method 100 according to an embodiment of the present invention, as Figure 1 shown, the method 100 may include the following steps S110, step S120, step S130, and step S140.
[0029] Step S110, obtaining at least two curve points on the curve to be edited, where the curve to be edited is a tracing curve for indicating the position of at least a part of the edge of the target object on the medical image; the at least two curve points include a fixed point group, and the fixed point group may include at least two fixed points.
[0030] Exemplarily, the curve editing method 100 can run on any electronic device. The electronic device can be any device with data processing capabilities and / or instruction execution capabilities. The electronic device can include, but is not limited to, one or more of a personal computer, a server, a mobile terminal, and a medical device (such as an ultrasound device, an endoscope device), etc. When the electronic device is a device independent of the medical device, the electronic device can optionally be communicatively connected to the medical device to obtain medical images from the medical device. Of course, the medical images collected by the medical device can also be transferred from the medical device to the above-mentioned electronic device by means of copying using a storage device such as a flash memory. Exemplarily, the electronic device for executing the curve editing method 100 can include a processing device, a display device, an input device, etc. In the electronic device, the curve editing method 100 can be specifically executed by the processing device. The input device can include, but is not limited to, one or more of the following: a keyboard, a mouse, a touch screen, a touchpad, etc. The touchpad can be referred to as a control panel. The display device can be used to display the collected medical images. Exemplarily and non-limitingly, the medical images can be any type of medical images such as ultrasound images collected by an ultrasound device or endoscope images collected by an endoscope device. For the convenience of description and understanding, the following takes the medical image as an ultrasound image as an example for description. The ultrasound image can be an image collected for any target object, such as an intravascular ultrasound image, a musculoskeletal ultrasound image, etc. The target object can be any specific part or tissue in an organism or a specific area in any specific part or tissue. In an embodiment of the present invention, the target object is a blood vessel, and the medical image can be an intravascular ultrasound image. The curve to be edited can be a tracing curve at the position of at least part of the edge (inner edge or outer edge) of the blood vessel on the intravascular ultrasound image. It can be understood that if the curve to be edited is a tracing curve at the position of part of the edge of the blood vessel, then the curve to be edited is a non-closed tracing curve. If the curve to be edited is a tracing curve at the position of all the edges of the blood vessel, then the curve to be edited is a closed tracing curve. Exemplarily, the user can edit part of the curve segment of the curve to be edited through a cursor control point. The curve to be edited can be a tracing curve obtained by manual tracing, or a tracing curve obtained by automatic tracing, or a curve obtained after further processing of the curve obtained by manual tracing or automatic tracing, such as a tracing curve obtained by smoothing the curve obtained by manual tracing, etc., and the present invention does not limit this.
[0031] The curve to be edited can include at least two curve points. The at least two curve points can be discretely distributed on the curve to be edited. The angle between any two adjacent curve points among the at least two curve points can be less than or equal to a preset angle threshold. The angle between two curve points can be the angle between the lines connecting these two curve points to the target center respectively. The target center is the center of the medical image or the curve center of the curve to be edited.
[0032] At least two curve points may include a fixed point group. The fixed points in the fixed point group are used to limit the editable range of the curve to be edited. The editable range can be understood as the part of the curve to be edited that can be changed, and this part can be the following target curve segment. That is, when the user moves the cursor control point, at most only the curve part within the editable range is allowed to change, and the rest of the curve part is fixed. The fixed curve part on the curve to be edited can be determined by the fixed points in the fixed point group. Exemplarily, when the curve to be edited is a non-closed curve, the fixed point group may include two initial fixed points on the curve to be edited. The initial fixed points are fixed points set by default. For example, when the curve to be edited is a non-closed curve, the two initial fixed points can be the starting point and the ending point of the non-closed curve respectively. Optionally, when the curve to be edited is a non-closed curve, the fixed point group may further include one or more fixed points set by the user on the curve to be edited. In one embodiment, if the user designates one or more curve points on the curve to be edited as fixed points, then the fixed point group may include two initial fixed points and one or more fixed points designated by the user. When the curve to be edited is a closed curve, the fixed point group may include at least two fixed points set by the user on the curve to be edited. Optionally, when the curve to be edited is a closed curve, the fixed point group may also include one or more initial fixed points set by default.
[0033] Step S120: Real-time determine multiple control points among at least two curve points based on the cursor control point and the fixed point group, and perform curve fitting based on the cursor control point and the multiple control points to obtain a fitted curve segment, where the cursor control point is the point corresponding to the current cursor position on the medical image, and the multiple control points are located between two target fixed points in the fixed point group.
[0034] Exemplarily, the above input device may include a mouse or a touchpad, etc. The user can change the position of the cursor in the display interface by moving the position of the mouse or operating the trackball on the touchpad, etc. In this way, when the cursor is at any position on the display interface, there is a point corresponding to the current cursor position on the medical image. The point corresponding to the current cursor position on the medical image can be used as the cursor control point.
[0035] Exemplarily, a plurality of control points among at least two curve points can be determined based on a cursor control point and a fixed point group. The positions of the plurality of control points on the curve to be edited are located between two target fixed points in the fixed point group. The target fixed points can be any two fixed points in the fixed point group, or two fixed points in the fixed point group that meet specific conditions. In one embodiment, two fixed points in the fixed point group that are closest to the reference curve point and are located on both sides of the reference curve point can be used as the target fixed points. In another embodiment, the fixed point group can be filtered first based on preset filtering conditions (including the preset deletion conditions described herein), and two fixed points in the remaining fixed points after filtering that are closest to the reference curve point and are located on both sides of the reference curve point can be used as the target fixed points. The reference curve point is the curve point on the curve to be edited that is closest to the cursor control point. Exemplarily, when the curve to be edited is a non-closed curve, if the user does not specify fixed points, the starting curve point and the ending curve point of the non-closed curve can be used as the target fixed points on both sides respectively.
[0036] Exemplarily, the two target fixed points can be used as control points, and / or some curve points located between the two target fixed points can be used as control points. Curve fitting is performed based on the cursor control point and the plurality of control points on the curve to be edited, and a fitted curve segment can be obtained. Optionally, when performing curve fitting based on the cursor control point and the plurality of control points on the curve to be edited, one or more external control points located outside the curve to be edited can be further determined based on the cursor control point and the plurality of control points on the curve to be edited. The cursor control point, the control points on the curve to be edited, and the control points located outside the curve to be edited can form a control point sequence, and curve fitting can be performed based on the control point sequence to obtain a fitted curve segment. When the cursor position changes, the cursor control point will change in real time following the cursor position, and thus the real-time curve obtained after curve fitting can be displayed in real time on the display interface.
[0037] In step S120, the curve fitting method adopted can include but is not limited to one or more of the following: least squares curve fitting algorithm, cubic natural spline curve fitting algorithm, Hermite spline curve fitting algorithm, Cardinal spline curve fitting algorithm, 4th-order Bezier spline curve fitting algorithm, etc. In one embodiment of the present invention, a 4th-order Bezier spline curve fitting algorithm can be adopted for curve fitting.
[0038] Step S130, a medical image including the real-time curve is displayed in real time on the display interface, where the real-time curve can include a fixed curve segment and a fitted curve segment. The fixed curve segment is the curve segment in the curve to be edited other than the target curve segment, and the target curve segment is the curve segment located between two control points at both ends among the plurality of control points.
[0039] Exemplarily, based on the obtained real-time curve, a medical image with the current real-time curve can be displayed in real time on the display interface of the display device. When the cursor position changes, the real-time curve corresponding to the changed cursor position can be displayed in real time on the display interface. The real-time curve can include a fixed curve segment and a fitted curve segment. The fixed curve segment is the curve segment of the curve to be edited other than the target curve segment. The target curve segment is the curve segment located between two control points at both ends among a plurality of control points. The target curve segment is the curve segment that can be updated, and the fixed curve segment is the fixed and unupdatable curve segment. When generating the real-time curve, the fixed curve segment on the curve to be edited is kept unchanged, and a new fitted curve segment is generated to replace the target curve segment to generate the real-time curve. It can be understood that when the curve to be edited is a non-closed curve, if the two control points at both ends among the plurality of control points are the starting curve point and the ending curve point of the curve to be edited respectively, then the length of the target curve segment can be equal to the length of the real-time curve, and the length of the fixed curve segment can be equal to 0.
[0040] Step S140, in response to the first determination instruction input by the user, replace the curve to be edited with the real-time curve.
[0041] Exemplarily, the user can input the first determination instruction through an input device. For example, the user can input text information such as "OK" through the keyboard to indicate that it is determined to replace the curve to be edited with the current real-time curve. Another example is that the display interface can include a first determination control, and the user can click the first determination control with the mouse to indicate that it is determined to replace the curve to be edited with the current real-time curve. In an embodiment of the present invention, the user can input the first determination instruction by clicking the left set button on the touchpad. When the user clicks the left set button on the touchpad, the curve to be edited can be replaced with the current real-time curve. The electronic device for executing the curve editing method 100 may further include a storage device. The above "replace the curve to be edited with the real-time curve" can be understood as overwriting the curve to be edited stored in the storage device with the current real-time curve, or deleting the curve to be edited stored in the storage device and storing the current real-time curve in the storage device.
[0042] According to the above technical solution, at least two curve points including a fixed point group are obtained on the curve to be edited. In this way, the editable range of the curve can be controlled by setting fixed points, and then at least part of the curve on the curve to be edited can be edited. Multiple control points can be determined based on the cursor control point and the fixed point group, and curve fitting can be performed in real time based on the cursor control point and the multiple control points. The real-time curve obtained by fitting can be displayed on the display interface, so that it is convenient for the user to help quickly find the traced curve that meets the requirements by viewing the fitting result of the traced curve in real time. The solution of displaying the real-time curve based on the cursor position does not require the user to specifically set control points, which can reduce the complexity of the editing operation. In addition, after the user inputs the first confirmation instruction, the curve to be edited is replaced with the real-time curve. When the user does not input the first confirmation instruction, the real-time curve is generated and displayed in real time following the cursor position. This solution can facilitate the user to replace the real-time curve when it meets the user's requirements on the basis of ensuring that the user can observe the curve fitting effect in real time, and avoid frequent overwriting of the curve to be edited. In addition, the above solution restricts the editable range of the curve to be edited through fixed points, so that the user can fix the curve segments that meet the requirements on the curve to be edited through fixed points and continue to edit other curve segments that do not meet the requirements. Therefore, this solution can avoid changing the previously edited curve segments during user adjustment and wasting the user's work results. This solution can effectively simplify the user's operation process, thereby greatly improving the efficiency of curve editing.
[0043] Exemplarily, the curve to be edited is a non-closed curve, and the fixed point group includes the starting curve point and the ending curve point of the curve to be edited; or, the curve to be edited is a closed curve, and the fixed point group includes at least two fixed points specified by the user.
[0044] In one embodiment, the curve to be edited may be a non-closed curve. Figure 2 FIG. shows a schematic diagram of a non-closed curve according to an embodiment of the present invention. As Figure 2 shown, the fixed point group may include the starting curve point S and the ending curve point E of the curve to be edited. In this way, the non-closed curve can be edited at least based on the cursor position and the starting curve point and the ending curve point.
[0045] In another embodiment, the curve to be edited may be a closed curve. The fixed point group may include at least two fixed points specified by the user. For example, the user can click on the positions of any two curve points on the closed curve with the mouse to determine these two curve points as fixed points. It can be understood that the number of fixed points specified by the user can be equal to any value greater than or equal to 2, and the present invention does not limit this. In this way, the closed curve can be edited at least based on the cursor position and the fixed points specified by the user.
[0046] Exemplarily, determining a plurality of control points among at least two curve points in real time based on a cursor control point and a set of fixed points may include: determining a target curve point set from the at least two curve points based on the distances between the cursor control point and each of the at least two curve points; and selecting, from the determined target curve point set and the set of fixed points, the curve points located between two target fixed points as the plurality of control points.
[0047] In one embodiment, based on the distances between the cursor control point and each of the at least two curve points, a target curve point set may be determined from the at least two curve points. The target curve point set may include one or more target curve points. During the process of moving the cursor towards the inside or outside of the curve to be edited, the distances between the cursor control point and each of the at least two curve points will change as the cursor moves. The distances between the cursor control point and each curve point may be calculated, and the curve points that meet a preset requirement with respect to the distance from the cursor control point may be used as the target curve points. The preset requirement may be set according to experience, and the present invention places no limitation thereon. In one embodiment of the invention, the preset requirement may include that the distance between the curve point and the cursor control point is closest to a first target distance or a second target distance in the following embodiments. Based on the determined target curve point set and the set of fixed points, the curve points located between two target fixed points may be respectively determined as the control points.
[0048] According to the above technical solution, based on the distances between the cursor control point and each of the at least two curve points, a target curve point set may be determined. Based on the target curve point set and the set of fixed points, the curve points located between two target fixed points may be determined as the plurality of control points. This method can facilitate the real-time determination of corresponding control points based on the cursor control point. When the cursor control point changes, the control points can also change accordingly.
[0049] Exemplarily, determining a target curve point set from the at least two curve points based on the distances between the cursor control point and each of the at least two curve points may include: calculating the distances between the cursor control point and each of the at least two curve points to determine a reference curve point, where the reference curve point is the curve point among the at least two curve points that is closest to the cursor control point; and determining corresponding target curve point sets along a first direction and a second direction respectively with the position of the reference curve point on the curve to be edited as a reference; wherein the first direction and the second direction are opposite, and the target curve point set includes a first curve point and a second curve point, the first curve point is the curve point whose distance from the cursor control point is closest to a first target distance, the second curve point is the curve point whose distance from the cursor control point is closest to a second target distance, and the first target distance is less than the second target distance.
[0050] In one embodiment, the distances between the cursor control point and each of at least two curve points may be calculated to determine a reference curve point. The distance may include any distance such as Mahalanobis distance, Euclidean distance, etc., and the present invention places no limitation thereon. The reference curve point may be the curve point among the at least two curve points that is closest to the cursor control point. That is to say, the reference curve point is the curve point corresponding to the minimum distance among the calculated multiple distances. Based on the position of the reference curve point on the curve to be edited, corresponding target curve point groups may be determined in the first direction and the second direction respectively. The first direction and the second direction are opposite. The first direction may be the clockwise direction, and the second direction may be the counterclockwise direction. It can be understood that if the first direction is the counterclockwise direction, then the second direction is the clockwise direction. Refer to Figure 2 , in one embodiment of the present invention, the first direction is the clockwise direction and the second direction is the counterclockwise direction. The target curve point group may include a first curve point and a second curve point. The first curve point is the curve point whose distance from the cursor control point is closest to the first target distance. The second curve point is the curve point whose distance from the cursor control point is closest to the second target distance. Exemplarily, if the distance between the cursor control point and the reference curve point is used as the reference distance, then the first target distance may be equal to any value greater than the reference distance, and there may be a first preset proportional relationship between the first target distance and the reference distance (for example, the ratio between the first target distance and the reference distance may be equal to c1 in the following embodiments), and the present invention places no limitation thereon. The second target distance may be equal to any value greater than or equal to the first target distance. There may be a second preset proportional relationship between the second target distance and the reference distance (for example, the ratio between the second target distance and the reference distance may be equal to c2 in the following embodiments). Refer to again Figure 2 , the target curve point group in the first direction may include a first curve point Q c11 and a second curve point Q c12 , the target curve point group in the second direction may include a first curve point Q c21 and a second curve point Q c22 . Exemplarily, if the distance between the cursor control point and the reference control point is D n , the first target distance may be D H1 = c1*D n , the second target distance may be D H2 = c2*D n . c1 and c2 respectively represent two different constants. The magnitudes of c1 and c2 may be preset fixed values or may be determined based on D n . For example, the magnitudes of c1 and c2 may be calculated by the following formula:
[0051] K = 60 / (50 - k2);
[0052] c1 = k1 * K * D n + k2;
[0053]
[0054] Among them, k1 and k2 are preset curve coefficients. Different curve coefficients can correspond to different editable ranges. That is, for the same curve to be edited, when k1 and k2 change, its editable range can be changed. Both k1 and k2 are fixed coefficients, which can be preset in advance, that is, the magnitudes of k1 and k2 can remain unchanged during the curve editing process. K represents the editing distance coefficient, and both 50 and 60 in the formula for calculating K are empirical values, and users can set them arbitrarily according to experience.
[0055] According to the above technical solution, based on the position of the calculated reference curve points on the curve to be edited, target curve point groups are determined along the first direction and the second direction respectively. In this way, corresponding target curve point groups can be determined according to different curves to be edited, with high flexibility and wide adaptability.
[0056] Exemplarily, before selecting the curve points located between two target fixed points from the determined target curve point group and fixed point group as multiple control points, the method may further include: when the fixed point group includes at least one additional fixed point, deleting the additional fixed points that meet the preset deletion conditions from the fixed point group to update the fixed point group; where, when the curve to be edited is a non-closed curve, the additional fixed points are the fixed points in the fixed point group other than the starting curve point and the ending curve point of the curve to be edited; when the curve to be edited is a closed curve, the additional fixed points are the fixed points in the fixed point group.
[0057] The additional fixed points can be fixed points set by the user. In one embodiment, when the curve to be edited is a non-closed curve, the other fixed points in the fixed point group except the starting curve point and the ending curve point can be referred to as additional fixed points. When the curve to be edited is a closed curve, the closed curve does not include the starting curve point and the ending curve point, and the additional fixed points can be all the fixed points in the fixed point group. It can be understood that there may be a situation where the fixed point group does not include additional fixed points. For example, when the curve to be edited is a non-closed curve, the fixed point group only includes the starting curve point and the ending curve point. When the fixed point group includes at least one additional fixed point, the additional fixed points in the fixed point group that meet the preset deletion conditions can be deleted to update the fixed point group. The preset deletion conditions can be set as needed. For example, one of the two fixed points with too close a distance (such as a distance less than or equal to the third distance threshold) can be deleted, the fixed point too close to the starting curve point or the ending curve point (such as a distance less than or equal to the fourth distance threshold) can be deleted, the fixed point too close to the reference curve point (such as a distance less than or equal to the first or second distance threshold) can be deleted, etc. Exemplarily, any one of the two additional fixed points with a relatively close distance in the fixed point group can be deleted. For example, the fixed point group includes the starting curve point S, the additional fixed point F1, the additional fixed point F2, the additional fixed point F3, and the ending curve point E. The distance between the additional fixed point F1 and the additional fixed point F2 is relatively close, and any one of these two additional fixed points can be deleted to update the fixed point group. In Figure 2 the embodiment shown, if the additional fixed point F1 ( Figure 2 not shown) is deleted, then the updated fixed point group includes the starting curve point S, the additional fixed point F2, the additional fixed point F3, and the ending curve point E.
[0058] In the above embodiment, the operation of determining multiple control points among at least two curve points based on the cursor control point and the fixed point group can be selected according to the updated fixed point group.
[0059] According to the above technical solution, when the fixed point group includes at least one additional fixed point, the additional fixed points that meet the preset deletion conditions can be deleted from the fixed point group. Sometimes the fixed points set by the user may not be appropriate either, such as being too dense or too close to the starting curve point, the ending curve point, etc. For such inappropriately set fixed points, they can be deleted. This can reduce the amount of calculation to a certain extent and avoid meaningless calculations.
[0060] Exemplarily, the preset deletion condition may include: the distance between the additional fixed point and the reference curve point is less than or equal to the first preset distance threshold; or, the distance between the additional fixed point and the reference curve point is less than or equal to the second preset distance threshold, and the number of curve points between the additional fixed point and the reference curve point is less than or equal to the preset number threshold; wherein, the reference curve point is the curve point closest to the cursor control point among at least two curve points.
[0061] In one embodiment, the preset deletion condition may include: the distance between the additional fixed point and the reference curve point is less than or equal to the first preset distance threshold T DH1 . For example, assuming there are three additional fixed points F1, F2, and F3, by calculating the distance between each additional fixed point and the reference curve point respectively, it can be determined that the distance between the additional fixed point F1 and the reference curve point N is D1, the distance between the additional fixed point F2 and the reference curve point N is D2, and the distance between the additional fixed point F3 and the reference curve point N is D3. Compare the distances D1, D2, and D3 with the first preset distance threshold T DH1 respectively. When any one of the distances is less than or equal to the first preset distance threshold T DH1 , delete the additional fixed point corresponding to that distance. For example, if after comparing the distances D1, D2, and D3 with the first preset distance threshold T DH1 respectively, it is determined that the distance D1 is less than the first preset distance threshold T DH1 , the additional fixed point F1 can be deleted. The first preset distance threshold T DH1 can be set as needed, and it can be any value, and the present invention does not limit this.
[0062] In another embodiment, the preset deletion condition may include: the distance between the additional fixed point and the reference curve point is less than or equal to the second preset distance threshold T DH2 , and the number of curve points between the additional fixed point and the reference curve point is less than or equal to the preset number threshold. For any additional fixed point, the method of determining whether the distance between the additional fixed point and the reference curve point is less than or equal to the second preset distance threshold T DH2 is similar to the method of comparing with the first preset distance threshold T DH1 in the previous embodiment. For the sake of brevity, it will not be elaborated here. The second preset distance threshold T DH2 and the first preset distance threshold T DH1 can be the same or different, and the present invention does not limit this. When the distance between any additional fixed point and the reference curve point is less than or equal to the second preset distance threshold T DH2, and when the number of curve points between the additional fixed point and the reference curve point is less than or equal to a preset number threshold, it can be determined that the additional fixed point meets the preset deletion condition. The preset number threshold can be set as needed and can be any value, and the present invention does not limit this. Exemplarily rather than restrictively, the curve points on the curve to be edited can be sorted in the first direction or the second direction to obtain the serial number of each curve point. The number of curve points between the additional fixed point and the reference curve point can be represented by the difference between the serial numbers of the additional fixed point and the reference curve point.
[0063] According to the above technical solution, delete the additional fixed points whose distance from the reference curve point is less than or equal to the first preset distance threshold or delete the additional fixed points whose distance from the reference curve point is less than or equal to the first preset distance threshold and the number of curve points between the additional fixed point and the reference curve point is less than or equal to the preset number threshold. This can avoid the editable range of the curve to be edited being restricted too small, affecting the editing effect.
[0064] Exemplarily, selecting the curve points located between two target fixed points from the determined target curve point group and fixed point group as multiple control points may include: taking the first direction and the second direction as the target directions respectively, and taking the position of the reference curve point on the curve to be edited as the reference, selecting one or more curve points from the target curve point group and fixed points in the target direction as the control points in the target direction; wherein, the first direction and the second direction are opposite, one or more curve points are located between the reference curve point and the target fixed point in the target direction, and in the target curve point group and fixed points in the target direction, they are sorted in ascending order of the number of curve points between them and the reference curve point, and one or more curve points are at the front; wherein, the reference curve point is the curve point closest to the cursor control point among at least two curve points; the target fixed point is the fixed point with the smallest number of curve points between it and the reference curve point in the target direction.
[0065] In one embodiment, the first direction and the second direction can be used as the target directions respectively to select the control points in this direction. One or more curve points used as the control points in the target direction can be located between the reference curve point and the target fixed point in the target direction. One or more curve points used as the control points in the target direction can optionally include the target fixed point itself. For the convenience of description and understanding, the following takes the target direction as the first direction as an example for description. Assume that the first direction is the clockwise direction, then the target direction is also the clockwise direction. Taking the position of the reference curve point on the curve to be edited as the reference, in the target curve point group and fixed points in the first direction (clockwise direction), one or more curve points can be selected as the control points in the target direction. For example, multiple curve points can be selected as the control points in the first direction. Such asFigure 2 As shown, the target curve point group in the first direction includes the first curve point Q c11 and the second curve point Q c12 The fixed points include an additional fixed point F3 and an end curve point E. F3 is a target fixed point. At least some of the curve points between the reference curve point N and the target fixed point F3 can be selected from the four curve points in the first direction to obtain a plurality of control points in the first direction. For example, the first curve point Q c11 and the second curve point Q c12 As a control point. It can be understood that the target fixed point itself can also be used as a control point. At the same time, the target curve point group in the target direction and each curve point in the fixed point are sorted in order from small to large according to the number of curve points separated from the reference curve point, and one or more curve points are located at the front. For example, if there are 5 curve points between the reference curve point and the target fixed point, and two control points are required, then the two curve points with the smallest number of curve points separated from the reference curve point can be selected from the 5 curve points as control points. For another example, if there is 1 curve point between the reference curve point and the target fixed point, and two control points are required, then the curve point can be directly used as a control point.
[0066] According to the above technical solution, the first direction and the second direction are respectively used as the target direction, and the position of the reference curve point on the curve to be edited is used as the reference. One or more curve points can be selected from the target curve point group and the fixed point in the target direction as the control point in the target direction. This method can easily and quickly determine multiple control points for curve fitting to assist in calculating the fitting curve.
[0067] Exemplarily, selecting one or more curve points as control points in the target direction from the target curve point group and the fixed points in the target direction may include: if there is no additional fixed point in the target direction, selecting the first curve point and the second curve point in the target direction as the control points in the target direction; wherein, the target curve point group includes the first curve point and the second curve point, the first curve point is the curve point with the distance closest to the first target distance from the reference curve point, the second curve point is the curve point with the distance closest to the second target distance from the reference curve point, and the first target distance is less than the second target distance; if there is an additional fixed point in the target direction, perform the following operations: if the number of third intervals is less than or equal to the number of first intervals, select the target fixed point in the target direction as the control point in the target direction; if the number of third intervals is greater than the number of first intervals and less than the number of second intervals, select the first curve point and the target fixed point in the target direction as the control points in the target direction; if the number of third intervals is greater than or equal to the number of second intervals, select the first curve point and the second curve point in the second target direction as the control points in the target direction; wherein, the number of first intervals is the number of curve points separated between the first curve point and the reference curve point, the number of second intervals is the number of curve points separated between the second curve point and the reference curve point, and the number of third intervals is the number of curve points separated between the target fixed point and the reference curve point; wherein, when the curve to be edited is a non-closed curve, the additional fixed point is the fixed point in the fixed point group other than the starting curve point and the ending curve point of the curve to be edited; when the curve to be edited is a closed curve, the additional fixed point is the fixed point in the fixed point group.
[0068] In one embodiment, if there is no additional fixed point in the target direction, then the first curve point and the second curve point in the target direction can be selected as the control points in the target direction. Figure 3 FIG. shows a schematic diagram of editing a curve to be edited according to an embodiment of the present invention. As Figure 3 shown, assume that the current target direction is the first direction (clockwise direction). When there is no additional fixed point in the target direction, the target fixed point in the target direction is the ending curve point. At this time, the first curve point and the second curve point must be located between the reference curve point and the target fixed point, so the first curve point and the second curve point can be directly used as the control points in the target direction. As Figure 3 shown in the curve to be edited, taking the reference curve point N as the reference, there is no additional fixed point in both the first direction and the second direction. During the process of the cursor moving along with the moving direction of the mouse, the curve can be fitted based on the cursor control points (such as M1, M2, and M3) and the determined multiple control points to obtain different real-time curves (such as Figure 3 the fitting curve segment ①, the fitting curve segment ②, and the fitting curve segment ③ shown) and the fixed curve segment. Figure 3The connection point in [it] is the second curve point in the previous embodiment. The connection point is the point where the fitting curve segment is connected to the fixed curve segment on the curve to be edited.
[0069] In another embodiment, if there are additional fixed points in the target direction, the control points in the target direction can be determined based on the number of curve points between the target fixed point and the reference curve point. The number of curve points between the target fixed point and the reference curve point can be referred to as the third interval number. If the third interval number is less than or equal to the first interval number, then the target fixed point in the target direction can be selected as the control point in the target direction. The first interval number can represent the number of curve points between the first curve point and the reference curve point. If the third interval number is greater than the first interval number and less than the second interval number, the first curve point and the target fixed point in the target direction can be used as the control points in the target direction respectively. The second interval number can represent the number of curve points between the second curve point and the reference curve point. If the third interval number is greater than or equal to the second interval number, then the first curve point and the second curve point in the second target direction can be used as the control points in the target direction respectively. It can be understood that the smaller the number of curve points between any curve point or fixed point and the reference curve point, the closer the corresponding curve point or fixed point is to the reference curve point along the curve to be edited (this distance is not the Euclidean distance).
[0070] Figure 4 Figure [shows] a schematic diagram of editing a curve to be edited according to another embodiment of the present invention. As Figure 4 shown in the curve to be edited, after deleting the fixed points in the initial fixed point group on the curve to be edited, it can be determined that the curve to be edited includes additional fixed points F4 and F5. During the process of the cursor moving along with the moving direction of the mouse, the curve can be fitted based on the cursor control points (such as M4, M5, and M6) and the determined multiple control points to obtain different real-time curves. Different real-time curves have their respective corresponding fitting curve segments (such as Figure 4 the fitting curve segment ④, the fitting curve segment ⑤, and the fitting curve segment ⑥ shown) and fixed curve segments. Figure 4 The connection point in [it] is the second curve point in the previous embodiment.
[0071] According to the above technical solution, if there is no additional fixed point in the target direction, the first curve point and the second curve point in the target direction can be directly selected as the control points in the target direction. If there is an additional fixed point in the target direction, the control points in the target direction can be determined according to the magnitude relationship between the third interval quantity of the curve points separated between the target fixed point and the reference curve point and the second interval quantity and the first interval quantity. This method can use different ways to determine the control points in the target direction for different fixed point settings to meet the editing requirements of users for different curves to be edited.
[0072] Exemplarily, the curve to be edited is a non-closed curve, and at least two curve points each have a corresponding serial number, and the serial numbers are arranged in ascending order along the first direction; when the target direction is the first direction, the following relationships exist: the serial number of the target fixed point is less than or equal to the serial number of the first curve point, indicating that the third interval quantity is less than or equal to the first interval quantity; the serial number of the target fixed point is greater than the serial number of the first curve point and less than the serial number of the second curve point, indicating that the third interval quantity is greater than the first interval quantity and less than the second interval quantity; the serial number of the target fixed point is greater than or equal to the serial number of the second curve point, indicating that the third interval quantity is greater than or equal to the second interval quantity; when the target direction is the second direction, the following relationships exist: the serial number of the target fixed point is greater than or equal to the serial number of the first curve point, indicating that the third interval quantity is less than or equal to the first interval quantity; the serial number of the target fixed point is less than the serial number of the first curve point and greater than the serial number of the second curve point, indicating that the third interval quantity is greater than the first interval quantity and less than the second interval quantity; the serial number of the target fixed point is less than or equal to the serial number of the second curve point, indicating that the third interval quantity is greater than or equal to the second interval quantity.
[0073] In one embodiment, when the curve to be edited is a non-closed curve, each of at least two curve points has a corresponding serial number. The serial numbers can be arranged in ascending order from small to large in the first direction. For example, if the first direction is the clockwise direction and there are 10 curve points on the curve to be edited, then starting from the starting curve point, the serial numbers of these 10 curve points can be successively represented as P0, P1, P2,....P9. Where P0 is the serial number of the starting curve point and P9 is the serial number of the ending curve point. For the first direction, when the serial number of the target fixed point is less than or equal to the serial number of the first curve point, it can be determined that the third interval quantity is less than or equal to the first interval quantity. When the serial number of the target fixed point is greater than the serial number of the first curve point and less than the serial number of the second curve point, it can be determined that the third interval quantity is greater than the first interval quantity and less than the second interval quantity. When the serial number of the target fixed point is greater than or equal to the serial number of the second curve point, it can be determined that the third interval quantity is greater than or equal to the second interval quantity. The second direction is opposite to the first direction. Therefore, for the second direction, the larger the serial number of any curve point, the closer the curve point is to the reference curve point. That is to say, the larger the serial number of any curve point, the smaller the number of curve points separated between the curve point and the reference curve point. In a similar manner, when the target direction is the second direction, the magnitude relationship between the third interval quantity and the first interval quantity and the second interval quantity can be judged. For the sake of brevity, it will not be elaborated here.
[0074] According to the above technical solution, when the curve to be edited is a non-closed curve, it can be determined that each of at least two curve points has a corresponding serial number. Based on the fact that each of at least two curve points has a corresponding serial number, the magnitude relationship between the third interval quantity and the first interval quantity and the second interval quantity is determined. This method is relatively intuitive and convenient, and has high efficiency.
[0075] Exemplarily, when there is an additional fixed point in the target direction, the step of "selecting one or more curve points from the target curve point group and the fixed point in the target direction as the control points in the target direction" can be implemented in the following manner.
[0076] Next, continue with the scheme where each of at least two curve points has a corresponding serial number and the serial numbers are arranged in ascending order from small to large in the first direction. When the target direction is the first direction, assume that P max is the serial number of the target fixed point in the first direction. If P max ≥P c12 , then the curve points Q c11 and Q c12 corresponding to the serial numbers P c11 and P c12 can continue to be used as the first curve point and the second curve point respectively. At this time, the control points in the target direction include the curve points Q c11 and Q c12 . If Pc12 >P max >P c11 , then the curve point Q corresponding to the serial number P c11 can continue to be used as the first curve point, and the curve point Q corresponding to the serial number P c11 max can be used as the new second curve point Q max . At this time, the control points in the target direction include the curve points Q c12 and Q c11 . If P max ≤P max c11 , then the curve point Q corresponding to the serial number P max can be used as the updated first curve point Q max and the updated second curve point Q c11 , that is, the updated first curve point Q c12 and the updated second curve point Q c11 coincide. At this time, the control points in the target direction include the curve point Q c12 . The curve point Q max can be the fixed point in the target curve point group and the fixed point group (or the updated fixed point group) in the first direction that has a serial number larger than the reference curve point and is the closest to the reference curve point. max
[0077] When the target direction is the second direction, assume that P min is the serial number of the target fixed point in the second direction. If P min ≤P c22 c21 and P c22 c21 and Q c22 corresponding to them can continue to be used as the first curve point and the second curve point. At this time, the control points in the target direction include the curve points Q c21 and Q c22 . If P c22 <P min <P c21 c21 corresponding to the curve point Q c21 can continue to be used as the first curve point, and the curve point Q corresponding to the serial number P min min can be used as the new second curve point Q c22 . At this time, the control points in the target direction include the curve points Q c21 and Q min . If P min ≥P c21 min corresponding to the curve point Q min As the updated first curve point Q c21 and the updated second curve point Q c22 , that is, the updated first curve point Q c21 coincides with the updated second curve point Q c22 . At this time, the control points in the target direction include the curve point Q min . The curve point Q min can be the fixed point in the target curve point group and the fixed point group (or the updated fixed point group) in the second direction that has a smaller serial number than the reference curve point and is the closest to the reference curve point.
[0078] Exemplarily, the multiple control points can include the control points in the first direction and the control points in the second direction based on the reference curve point. The reference curve point is the curve point closest to the cursor control point among at least two curve points. The first direction and the second direction are opposite. Among them, curve fitting is performed based on the cursor control point and the multiple control points to obtain a fitted curve segment, which can include: determining a first control point sequence based on the cursor control point and at least some of the control points in the first direction among the multiple control points; determining a second control point sequence based on the cursor control point and at least some of the control points in the second direction among the multiple control points; performing curve fitting based on the first control point sequence and the second control point sequence to obtain a fitted curve segment; among them, each control point in the first control point sequence is expressed as: C1 = {L M , L M + A(L c11 - L c21 ), L c11 - B(L c12 - L M ), L c11}; and / or, among them, each control point in the second control point sequence is expressed as: C2 = {L c21 , L c21 + A(L M - L c22 ), L M - B(L c11 - L c21 ), L M}; where C1 represents the first control point sequence, C2 represents the second control point sequence, L M represents the position corresponding to the cursor control point, L c11 represents the position corresponding to the first control point in the first direction, L c12 represents the position corresponding to the second control point in the first direction, L c21 represents the position corresponding to the first control point in the second direction, L c22Denote the position corresponding to the second control point in the second direction, where A and B respectively represent two preset parameters and the sum of A and B is 1; among them, the first control point is the control point with the smallest number of curve points separated from the reference curve point among the control points in the corresponding direction, and the second control point is the control point with the largest number of curve points separated from the reference curve point among the control points in the corresponding direction.
[0079] In one embodiment, taking the reference curve point as a reference, multiple control points can be divided into a first group of control points and a second group of control points. The first group of control points is at least part of the control points in the first direction. The second group of control points is at least part of the control points in the second direction. Based on the cursor control point and at least part of the control points in the first direction (i.e., the first group of control points) among the multiple control points, a first control point sequence can be determined. Each first control point in the first control point sequence can have its own position information, and this position information represents the position of the corresponding first control point on the medical image. For example, if the size of the medical image is 1000 pixels × 1000 pixels, and the position information corresponding to the first control point X in the first control point sequence is (100, 100), then it can represent that the position of the first control point X on the medical image is the pixel point at the 100th row and 100th column. Exemplarily, each control point in the first control point sequence can be expressed as: C1 = {L M , L M + A(L c11 - L c21 ), L c11 - B(L c12 - L M ), L c11}. The position of any control point can be determined based on the position information corresponding to this control point, or can be determined based on the serial number corresponding to this control point. In one embodiment of the present invention, the position of any control point can be determined based on the serial number corresponding to this control point. The first control point is the control point with the smallest number of curve points separated from the reference curve point among the control points in the corresponding direction. For example, the first control point in the first direction can be the first curve point Q c11 in the previous embodiment. The second control point is the control point with the largest number of curve points separated from the reference curve point among the control points in the corresponding direction. For example, the second control point in the first direction can be the second curve point Q c12 in the previous embodiment.. A and B can represent any two preset parameters whose sum is 1, and the present invention does not limit this. For example, A can be equal to 1 / 3 and B can be equal to 2 / 3. Another example is that A can be equal to 1 / 2 and B can also be equal to 1 / 2. Similarly, based on the cursor control point and the control points among the multiple control points in the second direction (i.e., the second set of control points), a second control point sequence can be determined. Based on the first control point sequence and the second control point sequence, curve fitting can be performed to obtain a fitted curve segment. The method of curve fitting has been described in detail in step S120. For the sake of brevity, it will not be elaborated here. Exemplarily, each control point in the second control point sequence is represented as: C2 = {L c21 , L c21 + A(L M - L c22 ), L M - B(L c11 - L c21 ), L M}.
[0080] According to the above technical solution, based on the cursor control point, the control points among the multiple control points in the first direction, and some of the control points in the second direction, a first control point sequence and a second control point sequence can be determined. Then, based on the first control point sequence and the second control point sequence, curve fitting can be performed to obtain a fitted curve segment. This method can ensure that the curve is relatively smooth and avoid sudden changes, so as to ensure that the obtained fitted curve segment meets the requirements of the user.
[0081] Exemplarily, performing curve fitting based on the first control point sequence and the second control point sequence to obtain a fitted curve segment may include: calculating the average distance between adjacent curve points among at least two curve points; calculating the first total distance between each control point in the first control point sequence and the second total distance between each second control point in the second control point sequence; determining the first interpolation point number based on the average distance and the first total distance, and determining the second interpolation point number based on the average distance and the second total distance, where the first interpolation point number is equal to the integer obtained by dividing the first total distance by the average distance, and the second interpolation point number is equal to the integer obtained by dividing the second total distance by the average distance; performing interpolation on the first control point sequence according to the first interpolation point number and performing interpolation on the second control point sequence according to the second interpolation point number to obtain an interpolated control point sequence; performing curve fitting based on the interpolated control point sequence to obtain an initial curve segment or a fitted curve segment; when obtaining the initial curve segment, determining the fitted curve segment based on the initial curve segment.
[0082] In one embodiment, if the number of curve points on the curve to be edited is 10, which are curve points Q0 to Q9 in sequence, the average distance D m between adjacent curve points among the 10 curve points is equal to the distance D 总Divided by the number k of spaced curve points. That is, D m = D 总 / k. By summing the distances between the control points in the first control point sequence C1, the first total distance D1 can be obtained. For example, if the first control point sequence C1 includes 4 control points, the distances d1 between the first control point and the second control point, d2 between the second control point and the third control point, and d3 between the third control point and the fourth control point can be successively added along the first direction to obtain the first total distance D1. Similarly, by summing the distances between the second control points in the second control point sequence C2, the second total distance D2 can be obtained. According to the calculated average distance D m and the first total distance D1, the first interpolation point number can be determined. The first interpolation point number N1 is equal to the first total distance D1 divided by the average distance D m and then rounded up or down, that is, N1 = [D1 / D m . According to the average distance D m and the second total distance D2, the second interpolation point number N2 is determined. The second interpolation point number N2 is equal to the second total distance D2 divided by the average distance D m and then rounded up or down, that is, N2 = [D2 / D m . Based on the determined first interpolation point number N1 and the second interpolation point N2, interpolation is performed on the first control point sequence C1 and the second control point sequence C2 respectively, and the interpolated control point sequences corresponding to the control point sequences can be obtained. Exemplarily, any interpolation method such as linear interpolation, nearest neighbor interpolation, cubic spline curve interpolation, etc. can be used for interpolation, and the present invention does not limit this. Based on the interpolated control point sequences, curve fitting can be performed to obtain an initial curve segment or a fitted curve segment. In an embodiment of the present invention, if the curve segment obtained after curve fitting of the interpolated control point sequence is an initial curve segment, then the fitted curve segment can be further determined based on the initial curve segment. The fitted curve segment determined based on the initial curve segment is smoother than the initial curve segment. In another embodiment of the present invention, if the curve segment obtained after curve fitting of the interpolated control point sequence is a fitted curve line segment, then a medical image including the fitted curve segment and the fixed curve segment can be displayed on the display interface in real time.
[0083] According to the above technical solution, based on the average distance between adjacent curve points among at least two curve points obtained by calculation, as well as the first total distance and the second total distance, the first interpolation point number and the second interpolation point number can be determined. Interpolation is performed on the first control point sequence and the second control point sequence respectively according to the first interpolation point number and the second interpolation point number, and curve fitting is performed based on the interpolated control point sequences. This can avoid too few control points in the first control point sequence and the second control point sequence, so as to ensure the improvement of the accuracy of subsequent curve fitting, and further ensure the accuracy of subsequent editing of the curve to be edited.
[0084] Exemplarily, determining the fitting curve segment based on the initial curve segment may include: extracting at least some control points from the interpolated control point sequence based on a preset distance coefficient; performing curve fitting based on the extracted control points to obtain the fitting curve segment.
[0085] In one embodiment, at least some control points can be extracted from the interpolated control point sequence through a preset distance coefficient S. In a manner similar to curve fitting in the previous embodiment, curve fitting can be performed based on the extracted control points to obtain the fitting curve segment. For the sake of brevity, it will not be elaborated here. The value of the preset distance coefficient S can be set as needed, and the present invention does not limit this. The larger the value of the preset distance coefficient S, the smoother the initial curve segment or the fitting curve segment obtained after fitting.
[0086] According to the above technical solution, at least some control points are extracted from the interpolated control point sequence based on the preset distance coefficient, and then curve fitting is performed according to the extracted control points. This can effectively reduce the amount of calculation in the curve fitting process to improve the efficiency of curve fitting.
[0087] Exemplarily, the method may further include: in response to a second determination instruction input by the user, determining the current cursor control point as a fixed point, and adding the determined fixed point to the fixed point group.
[0088] In one embodiment, if the editing effect of a partial curve segment on the currently obtained real-time curve meets the user's requirements, the user can input a second confirmation instruction, such as clicking the right mouse button (or left mouse button) or clicking the right (or left) button of the trackball on the touchpad, to determine the current cursor control point as a fixed point, so as to fix the curve segment between the fixed point and another fixed point (such as the starting curve point or the ending curve point) to form a fixed curve segment. Of course, the fixed points set by the user may not necessarily be effective during subsequent curve editing. As described above, in some embodiments, these fixed points may be deleted when at least some of the fixed points meet the preset deletion conditions. In one embodiment, in response to the second confirmation instruction input by the user, the current cursor control point can be determined as a fixed point, and the determined fixed point can be added to the fixed point group stored in the storage device. It should be noted that after the determined fixed point is added to the fixed point group, the newly stored fixed point group in the storage device is the new fixed point group. If the user needs to continue editing the curve to be edited, the user can return to execute step S110, and in this step, obtain the new curve to be edited and the fixed point group stored in the storage device.
[0089] According to the above technical solution, based on the second confirmation instruction, the current cursor control point can be determined as a fixed point, and at the same time, the determined fixed point can be added to the fixed point group. This can timely save the fixed points determined by the user and facilitate the user to continue editing the curve to be edited based on the new fixed point group.
[0090] Exemplarily, before determining multiple control points among at least two curve points in real time based on the cursor control point and the fixed point group, the method may further include: in response to an editing instruction input by the user, determining that the curve to be edited is in an editable state; wherein the step of determining multiple control points among at least two curve points in real time based on the cursor control point and the fixed point group is executed when the curve to be edited is in an editable state.
[0091] In one embodiment, through an input device, the user can input an editing instruction. After the user inputs the editing instruction, it can be determined that the curve to be edited is in an editable state. For example, the user can input "edit" in a text box to make the curve to be edited in an editable state. Another example is that the user can stop the cursor in the area where the curve to be edited is located by using the mouse or trackball and click the left mouse button (or right mouse button) or the left (or right) button of the trackball to make the curve to be edited in an editable state. The present invention does not limit this. The above step S120 is executed when the curve to be edited is in an editable state.
[0092] According to the above technical solution, before determining multiple control points among at least two curve points in real time based on a cursor control point and a fixed point group, in response to an editing instruction input by a user, it is determined that the curve to be edited is in an editable state. Moreover, the step of determining multiple control points among at least two curve points in real time based on the cursor control point and the fixed point group is executed when the curve to be edited is in an editable state. This can avoid misoperation on the curve to be edited due to accidental touch of an input device.
[0093] Exemplarily, the method may further include: in response to a first determination instruction input by a user, determining to end the editing of the curve to be edited and making the curve to be edited exit the editable state.
[0094] In one embodiment, the user may input a first determination instruction to determine to end the editing of the curve to be edited and exit the editing state. The display interface may include a first determination control, and the user may click the first determination control with a mouse to indicate determining to end the editing of the curve to be edited and making the curve to be edited exit the editable state. In one embodiment of the present invention, the user may input the first determination instruction by clicking the right set button on the touchpad. When the user clicks the right set button on the touchpad, the editing of the curve to be edited may be ended and the curve to be edited may exit the editable state.
[0095] According to the above technical solution, through the first determination instruction input by the user, the editing of the curve to be edited can be ended and the editing state can be exited. This can end the editing in a timely manner and make the curve to be edited exit the editable state when the edited curve meets the user's requirements, avoiding the loss of the curve that meets the user's requirements due to accidental touch of the touchpad or other controls on the display interface by the user.
[0096] Figure 5Fig. shows a schematic flow chart of a curve editing method according to another embodiment of the present invention. Exemplarily, before step S510, the curve to be edited can be determined by an automatic tracing method. Alternatively, before step S510, the curve to be edited can also be determined by a manual tracing method. In step S510, the user can input an editing instruction, and the electronic device receives the editing instruction. For example, the user can click the left button of the trackball on the area where the curve to be edited is located to activate the editing of the curve to be edited, that is, to make the curve to be edited in an editable state. In step S520, the user can move the cursor position, and the electronic device can edit the curve in real time according to the cursor position after the user moves, and obtain the corresponding real-time curve. For example, the user can move the trackball to change the cursor position on the display interface. When the cursor position changes, a medical image with the real-time curve can be displayed on the display interface in real time. In step S530, it can be determined whether the user inputs a second confirmation instruction. Step S530 can be executed in real time during the execution of step S520, that is, it can be monitored in real time whether the user inputs a second confirmation instruction. If the current real-time curve meets the user's requirements, the user can click the right button of the trackball to input the second confirmation instruction. When the electronic device receives the second confirmation instruction input by the user, step S540 can be executed. In step S540, the user can click the right button of the mouse to add the point corresponding to the current cursor position to the fixed point group to update the fixed point group, and at the same time replace the fixed point group corresponding to the curve to be edited with the updated fixed point group. If the user does not input the second confirmation instruction, the real-time curve can continue to be generated based on the cursor position. In addition, step S550 can also be executed, that is, it can be determined in real time whether the user inputs a first confirmation instruction. When the first confirmation instruction is received, step S560 can be executed, replacing the curve to be edited with the real-time curve, and the editing can be ended, that is, the editable state can be exited. If the first confirmation instruction is not received, the real-time curve can continue to be generated based on the cursor position. It should be noted that Figure 5 The execution order of the steps shown is only an example. Step S550 can be executed in real time during the execution of steps S520 and S530, that is, it can be monitored in real time whether the user inputs a first confirmation instruction. For example, the user can click the left button of the trackball to input the first confirmation instruction. Once the electronic device receives the first confirmation instruction input by the user, step S560 can be executed to end the editing of the curve to be edited. It can be understood that the above steps S520, S530, S540, and S550 can all be repeatedly executed until the first confirmation instruction is received.
[0097] Figure 6 Fig. shows a schematic flow chart of a curve editing method according to a specific embodiment of the present invention. As Figure 6As shown, the serial numbers corresponding to at least two curve points on the curve to be edited can be determined, such as P0, P1, P2, ... P9 in the previous embodiments. Calculate the distances between the cursor control point M and the at least two curve points, and determine the curve point closest to the cursor control point as the reference curve point N, and determine the serial number P corresponding to the reference curve point. n Taking the reference curve point N as a reference, target curve point groups Q c1 and Q c2 (i.e., Q c11 , Q c12 and Q c21 , Q c22 ) are respectively determined along the first direction and the second direction. Determine whether there are additional fixed points on the curve to be edited. If there are additional fixed points on the curve to be edited, the serial numbers corresponding to the respective fixed points on the curve to be edited can be determined and the serial numbers corresponding to the respective fixed points are arranged in ascending order. Taking the reference curve point N with the serial number P n as a reference, delete the fixed points that meet the preset deletion conditions. For a detailed description of the preset deletion conditions, reference can be made to the previous embodiments. For the sake of brevity, it will not be elaborated here. Determine the fixed point Q max in the target curve point group in the first direction and the fixed point group (or the updated fixed point group) that is smaller than the serial number of the reference curve point but closest to the reference curve point, and the fixed point Q min in the target curve point group in the second direction and the fixed point group (or the updated fixed point group) that is smaller than the serial number of the reference curve point but closest to the reference curve point. Compare the serial numbers between Q c11 , Q c12 and Q max in the two target curve point groups and the serial numbers between Q c21 , Q c22 and Q min to determine the new Q c1 and Q c2 . Determine the first control point sequence and the second control point sequence along the first direction and the second direction respectively. Calculate the average distance D m between adjacent control points on the curve to be edited, as well as the total distances D1 and D2 between the control points corresponding to the first control point sequence and the second control point sequence respectively. Based on the average distance D m and the first total distance D1, calculate the first interpolation point number N1. Based on the average distance D m and the second total distance D2, calculate the second interpolation point number N2. Then, curve fitting can be performed based on the interpolated first control point sequence and second control point sequence to obtain an initial curve or a fitting curve segment. If the obtained is an initial curve, at least some control points can be extracted from the interpolated control point sequence based on the preset distance coefficient S, so as to perform curve fitting based on the extracted control points to obtain a fitting curve segment.
[0098] According to another aspect of the present invention, a curve editing device is further provided. Figure 7 A schematic block diagram of a curve editing device 700 according to an embodiment of the present invention is shown. As Figure 7 shown, the device 700 may include an acquisition module 710, a determination module 720, a display module 730, and a replacement module 740.
[0099] The acquisition module 710 is configured to acquire at least two curve points on a curve to be edited, where the curve to be edited is a traced curve for indicating the position of at least a part of the edge of a target object on a medical image; at least two curve points include a fixed point group, and the fixed point group includes at least two fixed points.
[0100] The determination module 720 is configured to determine, in real time, a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group, and perform curve fitting based on the cursor control point and the plurality of control points to obtain a fitted curve segment, where the cursor control point is the point corresponding to the current cursor position on the medical image, and the plurality of control points are located between two target fixed points in the fixed point group.
[0101] The display module 730 is configured to display, in real time, a medical image including a real-time curve on a display interface, where the real-time curve includes a fixed curve segment and a fitted curve segment, the fixed curve segment is the curve segment other than the target curve segment in the curve to be edited, and the target curve segment is the curve segment between two control points at both ends of the plurality of control points.
[0102] The replacement module 740 is configured to replace the curve to be edited with the real-time curve in response to a first determination instruction input by a user.
[0103] Those of ordinary skill in the art can understand the specific implementation solutions and beneficial effects of the above curve editing device 700 by reading the relevant descriptions of the above curve editing method 100. For the sake of brevity, they are not described herein again.
[0104] Each component embodiment of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some modules in the curve editing device according to the embodiments of the present invention. The present invention may also be implemented as a device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0105] According to another aspect of the present invention, there is also provided an electronic device. Figure 8 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. As Figure 8 shown, the electronic device 800 includes a processor 810 and a memory 820. A computer program is stored in the memory 820. When the computer program instructions are run by the processor 810, they are used to execute the above-mentioned curve editing method.
[0106] According to still another aspect of the present invention, there is also provided a storage medium storing a computer program / instructions. The storage medium may include, for example, a storage component of a tablet computer, a hard disk of a personal computer, an erasable programmable read-only memory (EPROM), a portable read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The storage medium may be any combination of one or more computer-readable storage media. The computer program / instructions are used to execute the above-mentioned curve editing method when run by a processor.
[0107] Those of ordinary skill in the art can understand the specific implementation solutions of the above-mentioned electronic device and storage medium by reading the relevant descriptions of the above-mentioned curve editing method. For the sake of brevity, they will not be described in detail here.
[0108] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present invention thereto. Those of ordinary skill in the art can make various changes and modifications therein without departing from the scope and spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as claimed in the appended claims.
[0109] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled artisans can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.
[0110] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies have not been shown in detail so as not to obscure the understanding of this specification.
[0111] Similarly, it should be understood that, for the purpose of streamlining the present invention and aiding in the understanding of one or more of the various inventive aspects, in the description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the methods of the present invention should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected by the corresponding claims, the inventive point lies in that the corresponding technical problems can be solved by features fewer than all the features of a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim itself serves as a separate embodiment of the present invention.
[0112] Those skilled in the art will appreciate that, except where features are mutually exclusive, any combination can be employed for all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and for all the processes or units of any method or apparatus so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature serving the same, equivalent, or similar purpose.
[0113] It should be noted that, in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several distinct elements and by means of a suitably programmed computer. In a unit claim listing several devices, several of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words may be interpreted as names.
Claims
1. A curve editing method, characterized in that The method includes: Obtaining at least two curve points on a curve to be edited, where the curve to be edited is a traced curve for indicating the position of at least part of the edge of an object of interest on a medical image; at least two curve points of the at least two curve points include a fixed point group, and the fixed point group includes at least two fixed points; Determining, in real time, a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group, and performing curve fitting based on the cursor control point and the plurality of control points to obtain a fitted curve segment, where the cursor control point is a point corresponding to the current cursor position on the medical image, and the plurality of control points are located between two target fixed points in the fixed point group; Displaying, in real time, on a display interface, the medical image including a real-time curve, where the real-time curve includes a fixed curve segment and the fitted curve segment, the fixed curve segment is a curve segment other than a target curve segment in the curve to be edited, and the target curve segment is a curve segment between two control points at both ends of the plurality of control points; In response to a first determination instruction input by a user, replacing the curve to be edited with the real-time curve.
2. The method according to claim 1, wherein The curve to be edited is a non-closed curve, and the fixed point group includes a starting curve point and an ending curve point of the curve to be edited; or, the curve to be edited is a closed curve, and the fixed point group includes the at least two fixed points specified by the user.
3. The method according to claim 1 or 2, characterized in that, The determining, in real time, a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group includes: Determining a target curve point group from the at least two curve points based on the distances between the cursor control point and each curve point among the at least two curve points; Selecting, from the determined target curve point group and the fixed point group, curve points located between the two target fixed points as the plurality of control points.
4. The method according to claim 3, wherein The determining a target curve point group from the at least two curve points based on the distances between the cursor control point and each curve point among the at least two curve points includes: Calculating the distances between the cursor control point and each curve point among the at least two curve points to determine a reference curve point, where the reference curve point is the curve point closest to the cursor control point among the at least two curve points; Based on the position of the reference curve point on the curve to be edited as a reference, respectively determining the corresponding target curve point group in a first direction and a second direction; Wherein, the first direction and the second direction are opposite, the target curve point group includes a first curve point and a second curve point, the first curve point is the curve point whose distance from the cursor control point is closest to a first target distance, the second curve point is the curve point whose distance from the cursor control point is closest to a second target distance, and the first target distance is less than the second target distance.
5. The method according to claim 3, wherein Before the selecting, from the determined target curve point group and the fixed point group, curve points located between the two target fixed points as the plurality of control points, the method further includes: When at least one additional fixed point is included in the fixed point group, the additional fixed points that meet the preset deletion conditions are deleted from the fixed point group to update the fixed point group; Among them, when the curve to be edited is a non-closed curve, the additional fixed points are the fixed points in the fixed point group other than the starting curve point and the ending curve point of the curve to be edited; when the curve to be edited is a closed curve, the additional fixed points are the fixed points in the fixed point group.
6. The method according to claim 5, wherein The preset deletion conditions include: The distance between the additional fixed point and the reference curve point is less than or equal to the first preset distance threshold; or, The distance between the additional fixed point and the reference curve point is less than or equal to the second preset distance threshold, and the number of curve points between the additional fixed point and the reference curve point is less than or equal to the preset number threshold; Among them, the reference curve point is the curve point closest to the cursor control point among the at least two curve points.
7. The method according to claim 3, wherein The step of selecting the curve points located between the two target fixed points as the multiple control points from the determined target curve point group and the fixed point group includes: Taking the first direction and the second direction as the target directions respectively, and based on the position of the reference curve point on the curve to be edited, selecting one or more curve points from the target curve point group and the fixed points in the target direction as the control points in the target direction; Among them, the first direction and the second direction are opposite, the one or more curve points are located between the reference curve point and the target fixed point in the target direction, and in the target curve point group and the fixed points in the target direction, they are sorted in ascending order of the number of curve points between them and the reference curve point, and the one or more curve points are at the front; Among them, the reference curve point is the curve point closest to the cursor control point among the at least two curve points; the target fixed point is the fixed point with the smallest number of curve points between it and the reference curve point in the target direction.
8. The method according to claim 7, wherein The step of selecting one or more curve points from the target curve point group and the fixed points in the target direction as the control points in the target direction includes: If there are no additional fixed points in the target direction, select the first curve point and the second curve point in the target direction as the control points in the target direction; among them, the target curve point group includes the first curve point and the second curve point, the first curve point is the curve point with the distance closest to the first target distance from the reference curve point, the second curve point is the curve point with the distance closest to the second target distance from the reference curve point, and the first target distance is less than the second target distance; If there are additional fixed points in the target direction, perform the following operations: If the third interval quantity is less than or equal to the first interval quantity, select the target fixed point in the target direction as the control point in the target direction; If the number of the third intervals is greater than the number of the first intervals and less than the number of the second intervals, select the first curve point and the target fixed point in the target direction as the control points in the target direction; If the number of the third intervals is greater than or equal to the number of the second intervals, select the first curve point and the second curve point in the second target direction as the control points in the target direction; Wherein, the number of the first intervals is the number of curve points spaced between the first curve point and the reference curve point, the number of the second intervals is the number of curve points spaced between the second curve point and the reference curve point, and the number of the third intervals is the number of curve points spaced between the target fixed point and the reference curve point; Wherein, when the curve to be edited is a non-closed curve, the additional fixed point is a fixed point in the fixed point group other than the starting curve point and the ending curve point of the curve to be edited; when the curve to be edited is a closed curve, the additional fixed point is a fixed point in the fixed point group.
9. The method according to claim 8, characterized in that, The curve to be edited is a non-closed curve, and each of the at least two curve points has a corresponding serial number, and the serial numbers are arranged in ascending order along the first direction; When the target direction is the first direction, the following relationships exist: the serial number of the target fixed point is less than or equal to the serial number of the first curve point, indicating that the number of the third intervals is less than or equal to the number of the first intervals; the serial number of the target fixed point is greater than the serial number of the first curve point and less than the serial number of the second curve point, indicating that the number of the third intervals is greater than the number of the first intervals and less than the number of the second intervals; the serial number of the target fixed point is greater than or equal to the serial number of the second curve point, indicating that the number of the third intervals is greater than or equal to the number of the second intervals; When the target direction is the second direction, the following relationships exist: the serial number of the target fixed point is greater than or equal to the serial number of the first curve point, indicating that the number of the third intervals is less than or equal to the number of the first intervals; the serial number of the target fixed point is less than the serial number of the first curve point and greater than the serial number of the second curve point, indicating that the number of the third intervals is greater than the number of the first intervals and less than the number of the second intervals; the serial number of the target fixed point is less than or equal to the serial number of the second curve point, indicating that the number of the third intervals is greater than or equal to the number of the second intervals.
10. The method according to claim 1 or 2, characterized in that, The multiple control points include control points located in the first direction and control points located in the second direction with the reference curve point as the reference, the reference curve point is the curve point closest to the cursor control point among the at least two curve points, and the first direction and the second direction are opposite, wherein, Performing curve fitting based on the cursor control point and the multiple control points to obtain a fitted curve segment, including: Determining a first control point sequence based on the cursor control point and at least some of the control points located in the first direction among the multiple control points; Determining a second control point sequence based on the cursor control point and at least some of the control points located in the second direction among the multiple control points; Perform curve fitting based on the first control point sequence and the second control point sequence to obtain the fitted curve segment; Among them, each control point in the first control point sequence is represented as: C1 = {L M , L M + A(L c11 - L c21 ), L c11 - B(L c12 - L M ), L c11}; and / or Among them, each control point in the second control point sequence is represented as: C2 = {L c21 , L c21 + A(L M - L c22 ), M - B(L c11 - L c21 ), L M}; Among them, C1 represents the first control point sequence, C2 represents the second control point sequence, L M represents the position corresponding to the cursor control point, L c11 represents the position corresponding to the first control point in the first direction, L c12 represents the position corresponding to the second control point in the first direction, L c21 represents the position corresponding to the first control point in the second direction, L c22 represents the position corresponding to the second control point in the second direction, A and B respectively represent two preset parameters and the sum of A and B is 1; Among them, the first control point is the control point with the smallest number of curve points separated from the reference curve point among the control points in the corresponding direction, and the second control point is the control point with the largest number of curve points separated from the reference curve point among the control points in the corresponding direction.
11. The method according to claim 10, characterized in that, The performing curve fitting based on the first control point sequence and the second control point sequence to obtain the fitted curve segment includes: Calculate the average distance between adjacent curve points among the at least two curve points; Calculate the first total distance between each control point in the first control point sequence and the second total distance between each second control point in the second control point sequence; Determine the first interpolation point number based on the average distance and the first total distance, and determine the second interpolation point number based on the average distance and the second total distance, where the first interpolation point number is equal to the integer obtained by dividing the first total distance by the average distance, and the second interpolation point number is equal to the integer obtained by dividing the second total distance by the average distance; Interpolate the first control point sequence according to the first interpolation point number, and interpolate the second control point sequence according to the second interpolation point number to obtain the interpolated control point sequence; Perform curve fitting based on the interpolated control point sequence to obtain the initial curve segment or the fitted curve segment; When the initial curve segment is obtained, determine the fitted curve segment based on the initial curve segment.
12. The method according to claim 11, wherein The determining the fitted curve segment based on the initial curve segment includes: Extract at least some control points from the interpolated control point sequence based on a preset distance coefficient; Perform curve fitting based on the extracted control points to obtain the fitted curve segment.
13. The method according to claim 1 or 2, characterized in that, The method further includes: In response to a second determination instruction input by the user, determine the current cursor control point as a fixed point, and add the determined fixed point to the fixed point group.
14. The method according to claim 1 or 2, characterized in that, Before the step of determining multiple control points among the at least two curve points based on the cursor control point and the fixed point group in real time, the method further includes: In response to an edit instruction input by the user, determine that the curve to be edited is in an editable state; Among them, the step of determining multiple control points among the at least two curve points based on the cursor control point and the fixed point group in real time is executed when the curve to be edited is in an editable state.
15. The method according to claim 14, wherein The method further includes: In response to the first determination instruction input by the user, determine to end the editing of the curve to be edited and make the curve to be edited exit the editable state.
16. A curve editing device, characterized in that, The device includes: An acquisition module, configured to acquire at least two curve points on a curve to be edited, where the curve to be edited is a tracing curve used to indicate the position of at least a part of the edge of a target object on a medical image; at least two curve points among the at least two curve points include a fixed point group, and the fixed point group includes at least two fixed points; A determination module, configured to determine, in real time, a plurality of control points among the at least two curve points based on a cursor control point and the fixed point group, and perform curve fitting based on the cursor control point and the plurality of control points to obtain a fitted curve segment, wherein the cursor control point is the point corresponding to the current cursor position on the medical image, and the control points among the plurality of control points that are located on the curve to be edited are located between two target fixed points in the fixed point group; A display module, configured to display, in real time, on a display interface, the medical image including a real-time curve, wherein the real-time curve includes a fixed curve segment and the fitted curve segment, the fixed curve segment is the curve segment other than the target curve segment in the curve to be edited, and the target curve segment is the curve segment between two control points at both ends of the plurality of control points; A replacement module, configured to replace the curve to be edited with the real-time curve in response to a first determination instruction input by a user.
17. An electronic device, comprising a processor and a memory, characterized in that, A computer program is stored in a memory, and when the computer program instructions are run by a processor, they are used to execute the curve editing method according to any one of claims 1-15.
18. A storage medium stores computer programs / instructions, characterized in that, The computer program / instructions are used to execute the curve editing method according to any one of claims 1-15 when running.