Image processing method and device, electronic device and storage medium
By determining the relative positional relationship between the editing tool and the contour line, the contour adjustment process is simplified, the problem of low contour adjustment efficiency is solved, and efficient contour adjustment and lesion area labeling is achieved.
Patent Information
- Application Number
- CN202110479949.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-04-30
AI Technical Summary
In image processing, especially in the contour adjustment process, for scenes with large areas and many control points, the existing technology requires users to make contour adjustments a lot of time and energy, and the operation process is cumbersome and the efficiency is low.
By obtaining the contour lines on the target image, determining the relative positional relationship between the editing tool and the contour lines, performing editing operations in response to user instructions, simplifying the contour adjustment process, including operations such as shrinking, expanding and free drawing, and reducing the number of control points to improve efficiency.
It realizes efficient adjustment of contour lines, simplifies the operation process, reduces the time and energy investment of users in contour adjustment, improves the efficiency and accuracy of contour adjustment, and is especially suitable for lesion area annotation in pathological images.
Smart Images

Figure CN113096213B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method and device, an electronic device, and a storage medium. Background Art
[0002] With the continuous development of image processing technology, more and more image processing methods are available to users, so that images with specific effects can be obtained. Changing the shape of an object or area in an image is a common image processing method. By adjusting the contour of the object or area, the control points on the contour can be dragged one by one during the adjustment process to change the shape of the object or area.
[0003] However, this contour adjustment method will consume a lot of user time and energy for scenes with large areas and many control points. Summary of the invention
[0004] The present disclosure proposes a contour adjustment technical solution.
[0005] According to one aspect of the present disclosure, there is provided an image processing method, comprising: acquiring a target image, on which a contour line of a target area is marked; based on the contour line, determining a relative positional relationship between an editing tool acting on the target image and the contour line; in response to an editing indication, performing an editing operation on the contour line based on the relative positional relationship to obtain an adjusted contour line.
[0006] In the disclosed embodiment, the editing operation to be performed on the contour line is determined based on the relative position relationship between the editing tool and the contour line, which can reduce the user's constant dragging of control points and frequent switching of editing tools when adjusting the contour, simplify the contour adjustment operation process, and is suitable for contour adjustment scenarios with a large area and a large number of control points, thereby improving the efficiency of contour adjustment.
[0007] In one or more possible implementations, performing the editing operation on the contour line includes: performing the editing operation on the contour line when the contour line of the target area is selected. In this way, the selected contour line can be adjusted, and the unselected contour line is in an uneditable state, thereby reducing the occurrence of erroneous operations.
[0008] In one or more possible implementations, performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: when the editing tool is located outside the contour line, performing a first editing operation through the editing tool, wherein the first editing operation is to push the contour line from the outside of the contour line toward the inside of the contour line, and the area corresponding to the adjusted contour line is smaller than the area corresponding to the contour line before adjustment. Through the first editing operation, the adjustment effect of reducing the contour line can be achieved, the adjustment method is simple, and the process of contour line adjustment is simplified.
[0009] In one or more possible implementations, performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: when the editing tool is located inside the contour line, performing a second editing operation by the editing tool, wherein the second editing operation is to push the contour line from the inside of the contour line toward the outside of the contour line, and the area corresponding to the adjusted contour line is larger than the area corresponding to the contour line before adjustment. Through the second editing operation, the adjustment effect of expanding the contour line can be achieved, the adjustment method is simple, and the process of contour line adjustment is simplified.
[0010] In one or more possible implementations, performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: when the editing tool intersects a target area corresponding to the contour line, performing a third editing operation by the editing tool, wherein the third editing operation is to draw a new contour, and the adjusted contour line is formed based on the boundary of the editing tool. The third editing operation can realize free drawing of the contour line.
[0011] In one or more possible implementations, performing the third editing operation by the editing tool includes: when the center of the editing tool is located inside the contour line, replacing the part of the contour line intersecting with the editing tool with a newly added contour, wherein the newly added contour is formed by the boundary of the editing tool located outside the contour line. In this way, the newly added contour can be freely drawn outside the original contour line.
[0012] In one or more possible implementations, performing the third editing operation by the editing tool includes: determining two image areas formed by a newly added contour and the contour line when the center of the editing tool is located outside the contour line, wherein the newly added contour is formed by the boundary of the editing tool located inside the contour line; and drawing the newly added contour on the basis of the contour line based on the areas of the two image areas. In this way, different methods of drawing the newly added contour can be provided to the user according to the areas of the two image areas, further satisfying different contour adjustment requirements of the user.
[0013] In one or more possible implementations, the drawing of the newly added contour based on the contour line based on the areas of the two image areas includes: determining the ratio of the areas between the two image areas; when the ratio is within a preset threshold interval, drawing the newly added contour based on the contour line, wherein the adjusted contour line includes the contour lines of the two image areas; when the ratio is not within the preset threshold interval, drawing the newly added contour based on the contour line, and deleting a portion of the contour line corresponding to the first image area, wherein the first image area is the image area with a smaller area in the two image areas. In this way, when the ratio between the two image areas is within the preset threshold interval, the contour line of the target area can be split into two, and when the ratio between the two image areas is not within the preset threshold interval, the portion of the contour corresponding to the image area with a smaller area in the two image areas can be deleted, which is simple to operate and can improve the efficiency of contour adjustment.
[0014] In one or more possible implementations, the method further includes: receiving a size adjustment instruction; and adjusting the size of the editing tool in response to the size adjustment instruction.
[0015] In one or more possible implementations, the method further includes: in the process of performing the editing operation on the contour line, counting the number of control points included in the contour line, wherein the control points are used to control the shape of the contour line; and when the number of control points is greater than a preset number threshold, resampling the control points included in the contour line. In this way, while ensuring that the shape of the contour line remains unchanged, the density distribution and spatial interval of the control points on the contour line are adjusted, the number of control points of the contour line is reduced, and the performance of the system is improved.
[0016] In one or more possible implementations, the target image includes a pathological image, and the target region includes a lesion region. In this way, the contour line of the lesion region in the pathological image can be adjusted, so that the obtained contour line can more accurately mark the lesion region.
[0017] According to one aspect of the present disclosure, there is provided an image processing apparatus, comprising:
[0018] An acquisition module, used for acquiring a target image, wherein the target image is marked with a contour line of a target area;
[0019] A determination module, configured to determine, based on the contour line, a relative positional relationship between an editing tool acting on the target image and the contour line;
[0020] The execution module is used to perform an editing operation on the contour line in response to the editing instruction and based on the relative position relationship to obtain an adjusted contour line.
[0021] In one or more possible implementations, the execution module is configured to execute the editing operation on the contour line when the contour line of the target area is in a selected state.
[0022] In one or more possible implementations, the execution module is used to perform a first editing operation through the editing tool when the editing tool is located outside the contour line, wherein the first editing operation is to push the contour line from the outside of the contour line toward the inside of the contour line, and the area corresponding to the adjusted contour line is smaller than the area corresponding to the contour line before adjustment.
[0023] In one or more possible implementations, the execution module is used to perform a second editing operation through the editing tool when the editing tool is located inside the contour line, wherein the second editing operation is to push the contour line from the inside of the contour line toward the outside of the contour line, and the area corresponding to the adjusted contour line is larger than the area corresponding to the contour line before adjustment.
[0024] In one or more possible implementations, the execution module is used to perform a third editing operation through the editing tool when the editing tool intersects the target area corresponding to the contour line, wherein the third editing operation is to draw a new contour, and the adjusted contour line is formed based on the boundary of the editing tool.
[0025] In one or more possible implementations, the execution module is used to replace a portion of the contour where the contour line intersects the editing tool with a new contour when the center of the editing tool is located inside the contour line, wherein the new contour is formed by the boundary of the editing tool located outside the contour line.
[0026] In one or more possible implementations, the execution module is used to determine two image areas formed by a newly added contour and the contour line when the center of the editing tool is located outside the contour line, wherein the newly added contour is formed by the boundary of the editing tool located inside the contour line; and draw the newly added contour on the basis of the contour line based on the areas of the two image areas.
[0027] In one or more possible implementations, the execution module is used to determine the ratio of the areas between the two image areas; when the ratio is within a preset threshold range, draw the newly added contour on the basis of the contour line, wherein the adjusted contour line includes the contour lines of the two image areas; when the ratio is not within the preset threshold range, draw the newly added contour on the basis of the contour line, and delete the partial contour in the contour line corresponding to the first image area, wherein the first image area is the smaller image area of the two image areas.
[0028] In one or more possible implementations, the device further includes: a size adjustment module, configured to receive a size adjustment instruction; and adjust the size of the editing tool in response to the size adjustment instruction.
[0029] In one or more possible implementations, the device also includes: a sampling module, used to count the number of control points included in the contour line during the process of performing the editing operation on the contour line, wherein the control points are used to control the shape of the contour line; when the number of control points is greater than a preset number threshold, resample the control points included in the contour line.
[0030] In one or more possible implementations, the target image includes a pathological image, and the target area includes a lesion area.
[0031] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0032] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor.
[0033] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present disclosure. Other features and aspects of the present disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0035] Figure 1 A flowchart of an image processing method according to an embodiment of the present disclosure is shown.
[0036] Figure 2 A schematic diagram showing a first editing operation performed on a contour line according to an embodiment of the present disclosure.
[0037] Figure 3 A schematic diagram showing a second editing operation performed on a contour line according to an embodiment of the present disclosure.
[0038] Figure 4 A schematic diagram showing a third editing operation performed on a contour line according to an embodiment of the present disclosure.
[0039] Figure 5 A schematic diagram showing a third editing operation performed on a contour line according to an embodiment of the present disclosure.
[0040] Figure 6 A schematic diagram showing an example of an image processing interface according to an embodiment of the present disclosure.
[0041] Figure 7 A block diagram of an image processing apparatus according to an embodiment of the present disclosure is shown.
[0042] Figure 8 A block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0043] Fig. 9 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0044] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0045] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0046] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0047] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0048] The image processing solution provided by the embodiments of the present disclosure can be applied to image modification, image editing, drawing software, and other scenarios. For example, in the scenario of medical pathology reading or lesion annotation, the image processing solution provided by the present disclosure can be used to automatically identify the relative position relationship between the editing tool and the contour line, so as to adjust the contour line of the lesion area in the pathological image by using the editing operation corresponding to the relative position relationship. The user operation is simple and meets the user's needs for contour modification.
[0049] The image processing method provided by the embodiment of the present disclosure can be executed by a terminal device, a server or other types of electronic devices, wherein the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the image processing method can be implemented by a processor calling a computer-readable instruction stored in a memory. Alternatively, the method can be executed by a server. The image processing method of the embodiment of the present disclosure is described below by taking an electronic device as an example of the execution subject.
[0050] Figure 1 A flowchart of an image processing method according to an embodiment of the present disclosure is shown. Figure 1 As shown, the image processing method includes:
[0051] Step S11, acquiring a target image, wherein the target image is marked with a contour line of a target area.
[0052] In an embodiment of the present disclosure, an electronic device may acquire a target image, and the target image may be marked with a contour line of a target area. The target area may be an area of interest in the target image. For example, in the case where the target image is a pathological image, the target area may be a lesion area in the pathological image, so that the contour line of the lesion area in the pathological image may be adjusted, so that the obtained contour line may more accurately mark the lesion area. For another example, in the case where the target image is an image collected for the user's face, the target area may be a face area in the image. The contour line of the target area may be used to distinguish the target area from other areas in the target image except the target area. The contour line of the target area is usually closed, and in some cases, the contour line of the target area may also be non-closed. The contour line of the target area may be determined according to a user operation, that is, the user may manually draw the contour line of the target area. In some implementations, the contour line of the target area may be obtained by performing target detection on the target image. For example, target detection may be performed on the target image by some trained neural networks or detection algorithms, the target area in the target image may be determined, and the target area may be marked to obtain the contour line of the target area.
[0053] Here, the target image may include at least one target area, and each target area may be marked by a contour line. The contour line of each target area may have a corresponding contour number, and the contour lines of different target areas have different contour numbers, so that the contour lines of different target areas can be distinguished by the contour numbers.
[0054] Here, the electronic device may obtain the target image in a local storage or cache, or may obtain the target image from another electronic device in a wired or wireless manner.
[0055] Step S12: determining the relative positional relationship between the editing tool acting on the target image and the contour line based on the contour line.
[0056] In the disclosed embodiment, the user can use the editing tool to edit the contour of the target area, and the editing tool can be controlled by the mouse to adjust the contour. When the target image is in the editing mode, the editing tool can act on the target image, and the electronic device can determine the relative position relationship between the editing tool acting on the target image and the contour according to the image position of the editing tool and the image position of the contour.
[0057] Here, the relative positional relationship between the editing tool and the contour line may include at least one of the following: the editing tool is inside the contour line, the editing tool is outside the contour line, and the editing tool intersects the contour line. Among them, the editing tool is inside the contour line, which can be understood as the target area indicated by the contour line includes the image area where the editing tool is located, and the boundary of the editing tool can be circumscribed with the contour line. The editing tool is outside the contour line, which can be understood as the image area where the editing tool is located is outside the target area indicated by the contour line, and the boundary of the editing tool can be inscribed with the contour line. The editing tool intersects with the contour line, which can be understood as the image area where the editing tool is located intersects with the target area indicated by the contour line, and there are multiple intersections between the boundary of the editing tool and the contour line.
[0058] Here, the editing tool may be a preset shape, or may be determined according to user selection. The shape of the editing tool may be a regular or irregular shape such as a circle, an ellipse, a quadrilateral, a polygon, etc. The shape of the editing tool is related to the shape of the line drawn by the editing tool. For example, when the shape of the editing tool is a circle, the line drawn by the editing tool may be a circle or a part of a circle.
[0059] Here, the size of the editing tool can be adjusted. When a size adjustment instruction is received, the size of the editing tool can be adjusted in response to the size adjustment instruction, so that the size of the editing tool can be adjusted according to the actual application scenario, which is suitable for the adjustment of contour lines of irregular shapes. For example, when editing contour lines through the editing tool, the user can scroll the mouse wheel, and the user operation of scrolling the wheel can trigger the size adjustment instruction. When the size adjustment instruction is received, the size of the editing tool can be adjusted according to the enlargement or reduction adjustment parameters carried by the size adjustment instruction. In this way, the contour line can be adjusted under various contour modification scales, which is convenient for users to add or delete contour lines of target areas.
[0060] Step S13, in response to the editing instruction, performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line.
[0061] In an embodiment of the present disclosure, the editing operation corresponding to the relative position relationship between the editing tool and the contour line can be determined, and different relative position relationships can correspond to different editing operations. In the case of receiving an editing instruction, in response to the editing instruction, the editing operation corresponding to the relative position relationship can be performed for the partial contour of the contour line acted by the editing tool. For example, the partial contour acted by the editing tool can be extended or shortened, and the adjusted contour line of the target area can be obtained after the adjustment. The partial contour can be a part of the contour line. Here, the editing instruction can be triggered based on a user operation. For example, the editing instruction can be triggered by a user operation of clicking the mouse or a user operation of long pressing the mouse. The present disclosure does not limit the specific user operation that triggers the editing instruction.
[0062] Here, when performing an editing operation on the contour line of the target area, control points can be automatically added according to the position of the editing tool acting on the contour line, and then the added control points and the existing control points on the contour line are connected to form an adjusted contour line, and the adjusted contour line passes through the newly added control points and the existing control points on the contour line. In some implementations, the existing control points on the contour line can be deleted while adding control points under the action of the editing tool. In this case, the adjusted contour line can be formed according to the newly added control points and the remaining control points on the contour line. The adjusted contour line passes through the newly added control points and the remaining control points on the contour line.
[0063] It is understandable that the control points can be used to control the shape of the contour line, and the contour line can be formed by connecting the control points. In some implementations, when the adjusted contour line is formed according to the control points, smooth interpolation can also be performed based on the control points, that is, a smooth curve is drawn between the control points so that different control points can smoothly transition to obtain a smooth adjusted contour line. Here, when smooth interpolation is performed based on the control points, some interpolation algorithms, such as Bezier interpolation algorithm, spline interpolation algorithm, etc., can be used to achieve smooth transition between control points.
[0064] In some implementations, since the number of control points included in the contour line is constantly changing during the process of editing the contour line, if the number of control points of the contour line increases too much, it may affect the performance of the system, so that in the process of performing the editing operation on the contour line, the number of control points included in the contour line can be counted, and when the number of control points is greater than a preset number threshold, the control points included in the contour line can be resampled, that is, while ensuring that the shape of the contour line remains unchanged, the density distribution and spatial interval of the control points on the contour line are adjusted so that the control points on the contour line are less than or equal to the preset number threshold. Here, the preset number threshold can be the maximum value of the number of control points set according to the actual application scenario or demand.
[0065] Here, the editing mode of the contour line can be exited according to the received stop instruction. For example, the stop instruction can be triggered according to the user operation of single-clicking or double-clicking, and the editing mode of the contour line is exited when the stop instruction is received. In some implementations, the editing mode of the contour line can also be automatically exited when the editing tool has no operation for a preset time.
[0066] The image processing solution provided by the present invention can automatically adjust the contour line according to the relative position relationship between the editing tool and the contour line, thereby changing the shape and / or position of the contour line, which can reduce the user's frequent switching between the brush tool and the eraser tool. The operation is simple and can meet the user's needs for modifying the contour line.
[0067] In some implementations, the target image may be marked with contour lines of multiple target areas. In order to reduce misoperation of different contour lines, editing operations may be performed on the contour lines of the target area while the contour lines of the target area are in a selected state, so that adjustments can be made to the selected contour lines. Unselected contour lines are in an uneditable state, thereby reducing the occurrence of misoperation.
[0068] In some implementations, the editing operation corresponding to the relative position relationship can also be prompted by an operation identifier, and different editing operations correspond to different operation identifiers. For example, the editing operation can include a first editing operation, a second editing operation, and a third editing operation. The operation identifier corresponding to the first editing operation can be represented by "-", the operation identifier corresponding to the second editing operation can be represented by "+", and the operation identifier corresponding to the third editing operation can be represented by an operation identifier different from the first editing operation and the second editing operation. In this way, the user can be prompted by the operation identifier for the editing operation corresponding to the current relative position relationship, and the user can change the relative position relationship between the editing tool and the contour line of the target area through the prompt of the operation identifier to select the editing operation.
[0069] In the above step S13, an editing operation may be performed on the contour line based on the relative position relationship to obtain an adjusted contour line of the target area. The editing operation performed on the contour line is described below through various implementation methods.
[0070] In some implementations, when the editing tool is located outside the contour line, that is, when the editing tool is separated from or circumscribed to the contour line, a first editing operation can be performed through the editing tool. The first editing operation can be an operation of pushing the contour line from the outside of the contour line to the inside of the contour line, that is, under the action of the first editing operation, the partial contour of the contour line acted by the editing tool can be changed according to the boundary of the editing tool, so that the shape of the partial contour of the contour line acted by the editing tool fits the boundary of the editing tool. At the same time, the partial contour will not move to the inside of the editing tool, presenting the effect that the editing tool pushes the contour line from the outside of the contour line to the inside of the contour line. After the adjustment is completed, the adjusted contour line of the target area can be obtained. The area corresponding to the contour line after adjustment is smaller than the area corresponding to the contour line before adjustment. In this way, the adjustment effect of reducing the contour line can be achieved, the adjustment method is simple, and the process of contour line adjustment is simplified.
[0071] Figure 2 A schematic diagram of performing a first editing operation on a contour line according to an embodiment of the present disclosure is shown, wherein A shows the contour line before adjustment of the contour line. In response to the editing instruction triggered by the user operation of long pressing the mouse, under the effect of the first editing operation, the editing tool can move in the direction indicated by the dotted arrow, pushing the contour line from the outside to the inside. B shows the contour line after adjustment of the contour line, the editing tool moves to the position indicated by the dotted arrow, and the adjusted contour line fits the boundary of the editing tool.
[0072] In some implementations, when the editing tool is located inside the contour line, that is, when the editing tool is contained or inscribed with the contour line, a second editing operation can be performed through the editing tool. The second editing operation can be an operation of pushing the contour line from the inside of the contour line to the outside of the contour line, that is, under the action of the second editing operation, the partial contour of the contour line acted by the editing tool can be changed according to the boundary of the editing tool, so that the shape of the partial contour of the contour line acted by the editing tool fits the boundary of the editing tool. At the same time, the partial contour will not move to the inside of the editing tool, presenting the effect that the editing tool pushes the contour line from the inside of the contour line to the outside of the contour line. After the adjustment is completed, the adjusted contour line of the target area can be obtained. The area corresponding to the contour line after adjustment is larger than the area corresponding to the contour line before adjustment. In this way, the adjustment effect of expanding the contour line can be achieved, the adjustment method is simple, and the process of contour line adjustment is simplified.
[0073] Figure 3A schematic diagram of performing a second editing operation on a contour line according to an embodiment of the present disclosure is shown, wherein A shows the contour line before adjustment, and in response to an editing instruction triggered by a user operation of long pressing the mouse, under the effect of the second editing operation, the editing tool can move in the direction indicated by the dotted arrow, pushing the contour line from the inside to the outside. B shows the contour line after adjustment, the editing tool moves to the position indicated by the dotted arrow, and the adjusted contour line fits the boundary of the editing tool.
[0074] In some implementations, when the editing tool intersects with the target area corresponding to the contour line, that is, when the image area where the editing tool is located intersects with the target area indicated by the contour line, a third editing operation can be performed by the editing tool, and the third editing operation can be an operation of drawing a new contour. Under the action of the third editing operation, a new contour can be formed according to the boundary of the editing tool, and the new contour can form a new contour line with the part of the original contour line that does not intersect with the editing tool. After the adjustment is completed, the adjusted contour line of the target area can be obtained. In this way, free drawing of contour lines can be achieved.
[0075] In the case of performing the third editing operation through the editing tool, if the center of the editing tool is located inside the contour line, that is, the editing tool intersects the contour line of the target area, and the center of the editing tool is located inside the contour line, the part of the contour where the contour line intersects with the boundary of the editing tool can be replaced with a newly added contour, and the adjusted contour line of the target area can be obtained after the adjustment is completed. The newly added contour can be formed by the boundary of the editing tool located outside the contour line. In some examples, the boundary of the editing tool located outside the contour line can be used as a newly added contour, and the newly added contour is added, and the part of the contour where the contour line intersects with the boundary of the editing tool is deleted. After the adjustment is completed, the adjusted contour line of the target area can be obtained, so that the newly added contour can be freely drawn outside the original contour line.
[0076] Figure 4 A schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure is shown. A shows the contour line before adjustment, and in the case where the center of the editing tool is located inside the contour line and intersects with the contour line, in response to an editing instruction triggered by a user operation of clicking a mouse, under the action of the third editing operation, the boundary of the editing tool located outside the contour line is used as a newly added contour, the newly added contour is added, and the part of the contour line (the dotted part) intersecting the boundary of the editing tool is deleted. B shows the contour line after adjustment, and the newly added contour fits the boundary of the editing tool.
[0077] In the case of performing the third editing operation through the editing tool, if the center of the editing tool is located outside the contour line, that is, the editing tool intersects with the contour line of the target area, and the center of the editing tool is located outside the contour line, the boundary of the editing tool located inside the contour line can be used as a newly added contour. Further determine the two image areas formed by the newly added contour and the contour line, that is, the newly added contour inside the target area can divide the target area into two image areas. Further, based on the areas of the two image areas, a newly added contour can be drawn on the basis of the original contour line of the target area, and the adjusted contour line of the target area can be obtained after the adjustment. For example, based on the areas of the two image areas, a newly added contour can be drawn on the basis of the contour line of the target area, or, while drawing the newly added contour, part of the contour of the target area can be deleted to obtain the adjusted contour line of the target area. In this way, different methods of drawing newly added contours can be provided to users according to the areas of the two image areas, further meeting the different contour adjustment needs of users.
[0078] Figure 5 A schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure is shown. A shows the contour line before adjustment, and in the case where the center of the editing tool is located outside the contour line and intersects with the contour line, in response to an editing instruction triggered by a user operation of clicking a mouse, under the action of the third editing operation, the boundary of the editing tool located inside the contour line is used as a newly added contour, the newly added contour is added, and the part of the contour line (the dotted part) intersecting the boundary of the editing tool is deleted. B shows the contour line after adjustment, and the newly added contour fits the boundary of the editing tool.
[0079] In the above implementation, based on the areas of the two image regions, a new contour can be drawn on the basis of the contour line to obtain the contour line of the target area after adjustment. The following examples illustrate the method of drawing a new contour based on the areas of the two image regions.
[0080] In one example, the ratio of the areas of the two image regions can be determined, and then the ratio is compared with the endpoints of a preset threshold interval. If the ratio is within the preset threshold interval, a new contour can be drawn based on the original contour, and the new contour can be formed by the boundary of the editing tool located inside the original contour. The adjusted contour can include the contours of the two image regions. For example, based on the drawn new contour, another new contour can be copied, and one new contour and a part of the contour of the target region form the contour of one image region, and another new contour and another part of the contour of the target region form the contour of another image region, so as to obtain the contours of the two image regions. In some examples, a new contour number can also be automatically generated, and the contour number can indicate the contour of one of the two image regions, and the contour of the other of the two image regions can retain the contour number of the original contour of the target region.
[0081] Here, the preset threshold interval can be set according to the actual application scenario, for example, it can be set to (0.8, 1.25). When the ratio between the two image areas is within the preset threshold interval, it can be considered that the areas of the two image areas are relatively close. In this case, it can be considered that the user wants to split the contour line of the target area into two. A new contour can be drawn on the basis of the original contour line of the target area. The new contour can form the contour lines of the two image areas with the contour line of the target area. In this way, the original contour line of the target area can be adjusted to the contour line of the two image areas, and the operation is simple, which improves the efficiency of contour adjustment.
[0082] In another example, when the ratio of the areas between the two image regions is not within the preset threshold interval, it can be considered that the areas of the two image regions differ greatly. In this case, a new contour is drawn based on the contour line of the target region. The new contour can be formed by the boundary of the editing tool located inside the original contour line. At the same time, the partial contour corresponding to the first image region in the contour line of the target region is deleted. After the adjustment is completed, the adjusted contour line of the target region can be obtained. Here, the first image region can be the image region with the smaller area in the two image regions. In this way, when the ratio of the areas between the two image regions is not within the preset threshold interval, the partial contour corresponding to the image region with the smaller area in the two image regions can be deleted, and the contour line formed by the new contour and the partial contour corresponding to the image region with the larger area in the two image regions can be used as the adjusted contour line. In this way, the partial contour of the original contour line of the target region can be deleted by drawing the new contour, and the operation is simple, which improves the efficiency of contour adjustment.
[0083] The image processing method provided by the embodiment of the present disclosure is described below by using an example. Figure 6A schematic diagram of an example of an image processing interface according to an embodiment of the present disclosure is shown. In this example, the target image is a pathological image, and the target area is a lesion area. On the left side of the contour adjustment interface, a lesion list is displayed, and the lesion list lists the various lesion areas included in the pathological image, and different lesion areas correspond to different contour numbers. The contour adjustment interface displays the contour line (lesion contour) of the lesion area selected in the target image. On the right side of the contour adjustment interface, a toolbar is displayed, and the toolbar includes a fine-tuning tool button. The user can click the fine-tuning tool button in the toolbar and select the editing tool to adjust the contour line. The editing mark of the editing operation is displayed inside the editing tool. The current editing tool is inside the contour line, and the editing mark is displayed as "+", indicating that the editing tool can perform a second editing operation on the contour line that pushes the contour line from the inside to the outside. The user can select other editing operations by changing the relative position relationship between the editing tool and the contour line.
[0084] The image processing solution provided in this example can obtain the relative position relationship between the editing tool and the lesion area in real time. When receiving the editing instruction triggered by the user operation, the editing operation corresponding to the relative position relationship can be performed on the contour line of the lesion area. This method can reduce the user's frequent switching of brushes and erasers. The image processing method is simple, meets the user's needs for contour modification, increases user experience, and improves the efficiency of contour modification.
[0085] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0086] In addition, the present disclosure also provides an image processing device, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any image processing method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0087] Figure 7 A block diagram of an image processing device according to an embodiment of the present disclosure is shown. Figure 7 As shown, the device comprises:
[0088] An acquisition module 31 is used to acquire a target image, wherein the target image is marked with a contour line of a target area;
[0089] A determination module 32, configured to determine, based on the contour line, a relative positional relationship between an editing tool acting on the target image and the contour line;
[0090] The execution module 33 is used to perform an editing operation on the contour line in response to the editing instruction and based on the relative position relationship to obtain an adjusted contour line.
[0091] In one or more possible implementations, the execution module 33 is configured to execute the editing operation on the contour line when the contour line of the target area is in a selected state.
[0092] In one or more possible implementations, the execution module 33 is used to perform a first editing operation through the editing tool when the editing tool is located outside the contour line, wherein the first editing operation is to push the contour line from the outside of the contour line toward the inside of the contour line, and the area corresponding to the adjusted contour line is smaller than the area corresponding to the contour line before adjustment.
[0093] In one or more possible implementations, the execution module 33 is used to perform a second editing operation through the editing tool when the editing tool is located inside the contour line, wherein the second editing operation is to push the contour line from the inside of the contour line toward the outside of the contour line, and the area corresponding to the adjusted contour line is larger than the area corresponding to the contour line before adjustment.
[0094] In one or more possible implementations, the execution module 33 is used to perform a third editing operation through the editing tool when the editing tool intersects the target area corresponding to the contour line, wherein the third editing operation is to draw a new contour, and the adjusted contour line is formed based on the boundary of the editing tool.
[0095] In one or more possible implementations, the execution module 33 is used to replace a portion of the contour where the contour line intersects the editing tool with a new contour when the center of the editing tool is located inside the contour line, wherein the new contour is formed by the boundary of the editing tool located outside the contour line.
[0096] In one or more possible implementations, the execution module 33 is used to determine two image areas formed by a newly added contour and the contour line when the center of the editing tool is located outside the contour line, wherein the newly added contour is formed by the boundary of the editing tool located inside the contour line; and based on the areas of the two image areas, draw the newly added contour on the basis of the contour line.
[0097] In one or more possible implementations, the execution module 33 is used to determine the ratio of the areas between the two image regions; when the ratio is within a preset threshold range, draw the newly added contour on the basis of the contour line, wherein the adjusted contour line includes the contour lines of the two image regions; when the ratio is not within the preset threshold range, draw the newly added contour on the basis of the contour line, and delete the partial contour in the contour line corresponding to the first image region, wherein the first image region is the smaller image region of the two image regions.
[0098] In one or more possible implementations, the device further includes: a size adjustment module, configured to receive a size adjustment instruction; and adjust the size of the editing tool in response to the size adjustment instruction.
[0099] In one or more possible implementations, the device also includes: a sampling module, used to count the number of control points included in the contour line during the process of performing the editing operation on the contour line, wherein the control points are used to control the shape of the contour line; when the number of control points is greater than a preset number threshold, resample the control points included in the contour line.
[0100] In one or more possible implementations, the target image includes a pathological image, and the target area includes a lesion area.
[0101] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0102] The embodiment of the present disclosure also provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0103] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to call the instructions stored in the memory to execute the above method.
[0104] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code. When the computer-readable code is executed on a device, a processor in the device executes instructions for implementing the image processing method provided in any of the above embodiments.
[0105] The embodiment of the present disclosure also provides another computer program product for storing computer-readable instructions, which, when executed, enables a computer to perform the operations of the image processing method provided by any of the above embodiments.
[0106] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0107] Figure 8 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0108] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0109] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0110] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0111] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0112] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0113] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0114] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0115] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0116] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0117] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0118] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.
[0119] Fig. 9 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. Fig. 9 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0120] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as a Microsoft Server operating system (Windows Server 2003). TM), a graphical user interface operating system launched by Apple (Mac OSX TM ), a multi-user, multi-process computer operating system (Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.
[0121] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0122] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0123] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0124] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0125] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0126] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0127] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0128] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0129] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0130] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK) and the like.
[0131] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. An image processing method, characterized in that: include: Acquire a target image, wherein the target image is marked with a contour line of a target area; Based on the contour line, determining a relative positional relationship between an editing tool acting on the target image and the contour line; In response to the editing instruction, performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line; The step of performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: In the case where the editing tool intersects the target area corresponding to the contour line, performing a third editing operation by the editing tool, wherein the third editing operation is drawing a newly added contour, and the adjusted contour line is formed based on the boundary of the editing tool; The performing a third editing operation by the editing tool includes: In a case where the center of the editing tool is located outside the contour line, determining two image areas formed by a newly added contour and the contour line, wherein the newly added contour is formed by a boundary of the editing tool located inside the contour line; Based on the areas of the two image regions, drawing the newly added contour on the basis of the contour line; The step of drawing the newly added contour based on the contour line based on the areas of the two image regions includes: determining a ratio of areas between the two image regions; When the ratio is within a preset threshold range, drawing the newly added contour on the basis of the contour line, wherein the adjusted contour line includes the contour lines of the two image areas; When the ratio is not within a preset threshold range, the newly added contour is drawn based on the contour line, and the partial contour of the contour line corresponding to the first image area is deleted, wherein the first image area is the smaller image area of the two image areas.
2. The method according to claim 1, characterized in that The performing of the editing operation on the contour line comprises: When the contour line of the target area is in a selected state, an editing operation is performed on the contour line.
3. The method according to claim 1 or 2, characterized in that: The step of performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: When the editing tool is located outside the contour line, a first editing operation is performed by the editing tool, wherein the first editing operation is to push the contour line from the outside of the contour line toward the inside of the contour line, and the area corresponding to the adjusted contour line is smaller than the area corresponding to the contour line before adjustment.
4. The method according to claim 1 or 2, characterized in that: The step of performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: When the editing tool is located inside the contour line, a second editing operation is performed by the editing tool, wherein the second editing operation is to push the contour line from the inside of the contour line toward the outside of the contour line, and the area corresponding to the adjusted contour line is larger than the area corresponding to the contour line before adjustment.
5. The method according to claim 1, characterized in that The performing a third editing operation by the editing tool includes: When the center of the editing tool is located inside the contour line, a portion of the contour line intersecting the editing tool is replaced with a newly added contour, wherein the newly added contour is formed by a boundary of the editing tool located outside the contour line.
6. The method according to claim 1, characterized in that The method further comprises: receiving a size adjustment instruction; In response to the size adjustment instruction, the size of the editing tool is adjusted.
7. The method according to claim 1, characterized in that The method further comprises: In the process of performing the editing operation on the contour line, counting the number of control points included in the contour line, wherein the control points are used to control the shape of the contour line; When the number of the control points is greater than a preset number threshold, the control points included in the contour line are resampled.
8. The method according to claim 1, characterized in that The target image includes a pathological image, and the target area includes a lesion area.
9. An image processing device, characterized in that: include: An acquisition module, used for acquiring a target image, wherein the target image is marked with a contour line of a target area; A determination module, configured to determine, based on the contour line, a relative positional relationship between an editing tool acting on the target image and the contour line; An execution module, configured to, in response to an editing instruction, perform an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line; wherein the execution module is configured to, when the editing tool intersects the target area corresponding to the contour line, perform a third editing operation by the editing tool, wherein the third editing operation is to draw a new contour, and the adjusted contour line is formed based on the boundary of the editing tool; The performing a third editing operation by the editing tool includes: In a case where the center of the editing tool is located outside the contour line, determining two image areas formed by a newly added contour and the contour line, wherein the newly added contour is formed by a boundary of the editing tool located inside the contour line; Based on the areas of the two image regions, drawing the newly added contour on the basis of the contour line; The step of drawing the newly added contour based on the contour line based on the areas of the two image regions includes: determining a ratio of areas between the two image regions; When the ratio is within a preset threshold range, drawing the newly added contour on the basis of the contour line, wherein the adjusted contour line includes the contour lines of the two image areas; When the ratio is not within a preset threshold range, the newly added contour is drawn based on the contour line, and the partial contour of the contour line corresponding to the first image area is deleted, wherein the first image area is the smaller image area of the two image areas.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 8.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Three-dimensional animation posture modeling method by adopting sketch
CN101958007A
Picture format conversion method, device, apparatus, and storage medium
CN109064525A
Image tool acquisition method and device, image equipment and storage medium
CN109739597A
Tissue contour editing method and device, computer device and storage medium
CN109754472A
A simulation portrait generation method and device based on deep learning
CN109886873A
