CN113096213A - Image processing method and device, electronic equipment and storage medium - Google Patents

Image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113096213A
CN113096213A CN202110479949.4A CN202110479949A CN113096213A CN 113096213 A CN113096213 A CN 113096213A CN 202110479949 A CN202110479949 A CN 202110479949A CN 113096213 A CN113096213 A CN 113096213A
Authority
CN
China
Prior art keywords
contour line
contour
editing
image
editing tool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110479949.4A
Other languages
Chinese (zh)
Inventor
段琦
曹诗晴
张黎玮
张少霆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Shangtang Shancui Medical Technology Co ltd
Original Assignee
Shanghai Sensetime Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Sensetime Intelligent Technology Co Ltd filed Critical Shanghai Sensetime Intelligent Technology Co Ltd
Priority to CN202110479949.4A priority Critical patent/CN113096213A/en
Publication of CN113096213A publication Critical patent/CN113096213A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present disclosure relates to an image processing method and apparatus, an electronic device, and a storage medium, the method including: acquiring a target image, wherein a contour line of a target area is marked on the target image; determining the relative position relation between an editing tool acting on the target image and the contour line based on the contour line; and responding to an editing instruction, and executing editing operation on the contour line based on the relative position relation to obtain the adjusted contour line. The embodiment of the disclosure can be applied to a medical scene, and the efficiency of adjusting the outline of the focus area can be improved.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of image processing technology, more and more image processing means are available for users, so that images with specific effects can be obtained. Changing the shape of an object or an area in an image is a relatively common image processing means, and by adjusting the contour line of the object or the area, control points on the contour can be dragged one by one in the adjustment process, so that the shape of the object or the area can be changed.
However, for a scene with a large area and a large number of control points, the contour adjustment method consumes a lot of time and effort of the user.
Disclosure of Invention
The present disclosure provides a profile adjustment technical solution.
According to an aspect of the present disclosure, there is provided an image processing method including: acquiring a target image, wherein a contour line of a target area is marked on the target image; determining the relative position relation between an editing tool acting on the target image and the contour line based on the contour line; and responding to an editing instruction, and executing editing operation on the contour line based on the relative position relation to obtain the adjusted contour line.
In the embodiment of the disclosure, the editing operation performed on the contour line is determined according to the relative position relationship between the editing tool and the contour line, so that the number of editing tools that a user continuously drags a control point and frequently switches during contour adjustment can be reduced, the operation flow of contour adjustment is simplified, the method is suitable for contour adjustment scenes with large areas and more control points, and the efficiency of contour adjustment is improved.
In one or more possible implementations, the performing an editing operation on the contour line includes: and executing the editing operation on the contour line of the target area under the selected state of the contour line. In this way, the selected contour lines can be adjusted, and the unselected contour lines are in an un-editable state, so that the occurrence of misoperation is reduced.
In one or more possible implementation manners, the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: and under the condition that the editing tool is positioned outside the contour line, executing 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 to 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 the reduced contour line can be realized, the adjustment mode is simple, and the contour line adjustment process is simplified.
In one or more possible implementation manners, the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: and under the condition that the editing tool is positioned in the contour line, executing a second editing operation through the editing tool, wherein the second editing operation is to push the contour line from the inside of the contour line to 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 enlarging the contour line can be realized, the adjustment mode is simple, and the flow of contour line adjustment is simplified.
In one or more possible implementation manners, the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line includes: and under the condition that the editing tool is intersected with the target area corresponding to the contour line, executing a third editing operation through the editing tool, wherein the third editing operation is used for drawing a newly added contour line, and the adjusted contour line is formed on the basis of the boundary of the editing tool. By the third editing operation, free drawing of the contour line can be realized.
In one or more possible implementations, the performing, by the editing tool, a third editing operation includes: and under the condition that the center of the editing tool is positioned inside the contour line, replacing the part of the contour line intersected with the editing tool with a new contour, wherein the new contour is formed by the boundary of the editing tool positioned outside the contour line. Therefore, the newly added contour can be freely drawn outside the original contour line.
In one or more possible implementations, the performing, by the editing tool, a third editing operation includes: determining two image areas formed by a newly added contour and the contour line under the condition that the center of the editing tool is positioned outside the contour line, wherein the newly added contour is formed by the boundary of the editing tool positioned inside the contour line; and drawing the newly-added contour on the basis of the contour lines based on the areas of the two image regions. Therefore, different new contour drawing modes can be provided for the user according to the areas of the two image areas, and different contour adjustment requirements of the user are further met.
In one or more possible implementations, the drawing the new 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; under the condition that the ratio is within a preset threshold value interval, drawing the newly-added contour on the basis of the contour lines, wherein the adjusted contour lines comprise the contour lines of the two image areas; and under the condition that the ratio is not within a preset threshold value interval, drawing the newly added contour on the basis of the contour line, and deleting a part of contour corresponding to a first image area in the contour line, wherein the first image area is the image area with a small area in the two image areas. By the method, 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 partial contour corresponding to the image area with the small area in the two image areas can be deleted, so that the operation is simple, and the contour adjusting efficiency can be improved.
In one or more possible implementations, the method further includes: receiving a size adjustment instruction; adjusting the size of the editing tool in response to the size adjustment instruction.
In one or more possible implementations, the method further includes: counting the number of control points included in the contour line in the process of executing the editing operation on the contour line, wherein the control points are used for controlling the shape of the contour line; and under the condition that the number of the control points is larger than a preset number threshold, resampling the control points included in the contour line. Therefore, under the condition of ensuring that the shape of the contour line is not changed, the density distribution and the space interval of the control points on the contour line are adjusted, the number of the control points of the contour line is reduced, and the performance of the system is improved.
In one or more possible implementations, the target image includes a pathology image, and the target region includes a lesion region. Therefore, the contour line of the focus area in the pathological image can be adjusted, and the obtained contour line can mark the focus area more accurately.
According to an aspect of the present disclosure, there is provided an image processing apparatus including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a target image, and a contour line of a target area is marked on the target image;
the determining module is used for determining the relative position relation between the editing tool acting on the target image and the contour line based on the contour line;
and the execution module is used for responding to the editing instruction and executing editing operation on the contour line based on the relative position relation to obtain the adjusted contour line.
In one or more possible implementation manners, the executing module is configured to execute the editing operation on the contour line of the target region in a selected state.
In one or more possible implementation manners, the executing module is configured to execute, by the editing tool, a first editing operation when the editing tool is located outside the contour line, where 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 an area corresponding to the adjusted contour line is smaller than an area corresponding to the contour line before the adjustment.
In one or more possible implementation manners, the executing module is configured to execute, by the editing tool, a second editing operation when the editing tool is located inside the contour line, where 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 an area corresponding to the adjusted contour line is larger than an area corresponding to the contour line before the adjustment.
In one or more possible implementation manners, the executing module is configured to execute, by the editing tool, a third editing operation when the editing tool intersects with a target area corresponding to the contour line, where the third editing operation is to draw a newly added contour, and the adjusted contour line is formed based on a boundary of the editing tool.
In one or more possible implementations, the executing module is configured to, in a case that a center of the editing tool is located inside the contour line, replace a part of the contour line where the contour line intersects with the editing tool with an additional contour, where the additional contour is formed by a boundary of the editing tool located outside the contour line.
In one or more possible implementations, the execution module is configured to determine, when a center of the editing tool is located outside the contour line, two image regions formed by a new contour and the contour line, where the new contour is formed by a boundary of the editing tool located inside the contour line; and drawing the newly-added contour on the basis of the contour lines based on the areas of the two image regions.
In one or more possible implementations, the execution module is to determine a ratio of areas between the two image regions; under the condition that the ratio is within a preset threshold value interval, drawing the newly-added contour on the basis of the contour lines, wherein the adjusted contour lines comprise the contour lines of the two image areas; and under the condition that the ratio is not within a preset threshold value interval, drawing the newly added contour on the basis of the contour line, and deleting a part of contour corresponding to a first image area in the contour line, wherein the first image area is the image area with a small area in the two image areas.
In one or more possible implementations, the apparatus further includes: the size adjusting module is used for receiving a size adjusting instruction; adjusting the size of the editing tool in response to the size adjustment instruction.
In one or more possible implementations, the apparatus further includes: the sampling module is used for counting the number of control points included in the contour line in the process of executing the editing operation on the contour line, wherein the control points are used for controlling the shape of the contour line; and under the condition that the number of the control points is larger than a preset number threshold, resampling the control points included in the contour line.
In one or more possible implementations, the target image includes a pathology image, and the target region includes a lesion region.
According to an aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to an aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure.
Fig. 2 shows a schematic diagram of performing a first editing operation on a profile according to an embodiment of the present disclosure.
FIG. 3 illustrates a schematic diagram of performing a second editing operation on a contour line according to an embodiment of the present disclosure.
FIG. 4 illustrates a schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure.
FIG. 5 illustrates a schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure.
FIG. 6 shows a schematic diagram of an example of an image processing interface according to an embodiment of the present disclosure.
Fig. 7 illustrates a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
FIG. 8 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure.
Fig. 9 shows a block diagram of an electronic device in accordance with an embodiment of the disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
The image processing scheme provided by the embodiment of the disclosure can be applied to scenes such as image modification, image editing, drawing software and the like. For example, in a medical pathology radiograph reading or lesion marking scene, the image processing scheme provided by the present disclosure can be used to automatically identify the relative position relationship between the editing tool and the contour line, so that the contour line of the lesion area in the pathology image is adjusted by using the editing operation corresponding to the relative position relationship, the user operation is simple, and the requirement of the user on contour modification is met.
The image processing method provided by the embodiment of the present disclosure may be executed by a terminal device, a server, or other types of electronic devices, where the terminal device may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like. In some possible implementations, the image processing method may be implemented by a processor calling computer readable instructions stored in a memory. Alternatively, the method may be performed by a server. The following describes an image processing method according to an embodiment of the present disclosure, taking an electronic device as an execution subject.
Fig. 1 illustrates a flowchart of an image processing method according to an embodiment of the present disclosure, which includes, as illustrated in fig. 1:
step S11, a target image is acquired, and a contour line of the target area is marked on the target image.
In the embodiment of the disclosure, the electronic device may acquire a target image, and a contour line of a target area may be marked on the target image. The target region may be a region of interest in the target image. For example, in the case that the target image is a pathological image, the target region may be a lesion region in the pathological image, so that the contour line of the lesion region in the pathological image may be adjusted, and the obtained contour line may more accurately mark the lesion region. For another example, in the case where the target image is an image captured for the face of the user, the target region may be a human face region in the image. The contour of the target area may be used to distinguish the target area from other areas in the target image other than the target area, and the contour of the target area is normally closed, and in some cases, the contour 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 outline the contour line of the target area. In some implementations, the contour line of the target region may be obtained by performing target detection on the target image, for example, the target image may be subjected to target detection through some trained neural networks or detection algorithms, a target region in the target image is determined, and the target region is labeled to obtain the contour line of the target region.
Here, the target image may include at least one target region, and each target region may be labeled by a contour line. The contour line of each target area can have a corresponding contour number, and the contour numbers of the contour lines of different target areas are different, so that the contour lines of different target areas can be distinguished through the contour numbers.
Here, the electronic device may obtain the target image in a local storage or cache, or may obtain the target image at another electronic device in a wired manner or a wireless manner.
Step S12 is a step of determining a relative positional relationship between the editing tool acting on the target image and the contour line based on the contour line.
In the embodiment of the present disclosure, a user may edit the contour line of the target region using an editing tool, and the editing tool may be controlled by a mouse, so as to adjust the contour line. When the target image is in the editing mode, the editing tool can act on the target image, and the electronic equipment can determine the relative position relationship between the editing tool acting on the target image and the contour line according to the image position of the editing tool and the image position of the contour line.
Here, the relative positional relationship between the editing tool and the contour line may include at least one of: the editing tool is inside the contour line, the editing tool is outside the contour line, and the editing tool intersects the contour line. The editing tool is located inside the contour line, and the target area indicated by the contour line can be understood to include 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, it can be understood that 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 in the contour line. The editing tool intersects with the contour line, which can be understood as that the image area where the editing tool is located intersects with the target area indicated by the contour line, and the boundary of the editing tool and the contour line have a plurality of intersection points.
Here, the editing tool may be a preset shape, or may be determined according to a user selection. The shape of the editing tool can be a regular or irregular shape such as a circle, an ellipse, a quadrangle, a polygon and the like. The shape of the editing tool is related to the shape of the line drawn by the editing tool, for example, where the shape of the editing tool is a circle, the line drawn by the editing tool may be a circle or a portion of a circle.
Here, the size of the editing tool may be adjusted, and in a case where the size adjustment instruction is received, the size of the editing tool may be adjusted in response to the size adjustment instruction, so that the size of the editing tool may be adjusted according to an actual application scene, and the method is suitable for adjusting the irregular-shaped contour line. For example, in the case of editing a contour line by an editing tool, a user may scroll a scroll wheel of a mouse, a user operation of the scroll wheel may trigger a size adjustment instruction, and in the case of receiving the size adjustment instruction, the size of the editing tool may be adjusted according to an adjustment parameter for enlargement or reduction carried by the size adjustment instruction. Therefore, the contour line can be adjusted under various contour modification scales, and a user can add or delete the contour line of the target area conveniently.
And step S13, responding to the editing instruction, and executing and editing operation on the contour line based on the relative position relation to obtain the adjusted contour line.
In the embodiment of the present disclosure, the editing operation corresponding to the relative position relationship may be determined according to the relative position relationship between the editing tool and the contour line, and different relative position relationships may correspond to different editing operations. When an edit instruction is received, in response to the edit instruction, an edit operation corresponding to the relative positional relationship may be performed on the partial contour of the contour line acted on by the editing tool, for example, the partial contour acted on by the editing tool may be extended or shortened, and the contour line after adjustment of the target region may be obtained after the adjustment is completed. The partial contour may be a portion of a contour line. Here, the edit instruction may be triggered based on a user operation, for example, an edit instruction may be triggered by a user operation of clicking a mouse or a user operation of long-pressing a mouse. The present disclosure is not limited to a specific user operation that triggers an edit instruction.
Here, in the case of performing an editing operation on the contour line of the target region, the control points may be automatically added according to the action position of the editing tool on the contour line, and then the added control points and the existing control points on the contour line may be connected to form an adjusted contour line, which passes through the newly added control points and the existing control points on the contour line. In some implementations, under the action of the editing tool, existing control points on the contour line may be deleted while adding new control points, and in this case, the adjusted contour line may be formed according to the new control points and the remaining control points on the contour line. The adjusted contour line passes through the newly added control points and the rest control points on the contour line.
It will be appreciated that control points may be used to control the shape of the contour lines and connecting control points may form the contour lines. In some implementations, when the adjusted contour line is formed according to the control points, smooth interpolation may be performed based on the control points, that is, a smooth curve is drawn between the control points, so that smooth transition between different control points is possible, and a smooth adjusted contour line is obtained. Here, when performing smooth interpolation based on the control points, smooth transition between the control points may be achieved by some interpolation algorithm, for example, by a Bezier interpolation algorithm, a spline interpolation algorithm, or the like.
In some implementations, since the number of control points included in the contour line is continuously changed during the process of editing the contour line, if the number of control points of the contour line is increased too much, the performance of the system may be affected, so that the number of control points included in the contour line may be counted during the process of performing the editing operation on the contour line, and in the case that the number of control points is greater than the preset number threshold, the control points included in the contour line may be resampled, that is, in the case that the shape of the contour line is not changed, the density distribution and the 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 may be a maximum value of the number of control points that is set according to an actual application scenario or a requirement.
Here, the editing mode of the outline may be exited according to the received stop instruction, for example, the stop instruction may be triggered according to a user operation of a single click or a double click, and in a case where the stop instruction is received, the editing mode of the outline may be exited. In some implementations, the editing mode of the contour line can be automatically exited when the duration of the editing tool without any operation reaches a preset duration.
The image processing scheme provided by the disclosure can automatically adjust the contour line according to the relative position relation between the editing tool and the contour line, so that the shape and/or position of the contour line can be changed, frequent switching between a painting tool and an eraser tool by a user can be reduced, the operation is simple, and the requirement of the user for modifying the contour line can be met.
In some implementations, the object image may be marked with contour lines of a plurality of object regions, and in order to reduce the misoperation of different contour lines, the contour lines of the object regions may be edited while the contour lines of the object regions are in a selected state, so that the selected contour lines may be adjusted, and unselected contour lines are in a non-editable state, thereby reducing the occurrence of the misoperation.
In some implementation manners, the editing operation corresponding to the relative position relationship may also be prompted by the operation identifier, and the operation identifiers corresponding to different editing operations are different. For example, the editing operation may include a first editing operation, a second editing operation, and a third editing operation, where an operation identifier corresponding to the first editing operation may be denoted by "-", an operation identifier corresponding to the second editing operation may be denoted by "+", and an operation identifier corresponding to the third editing operation may be denoted by an operation identifier different from the first editing operation and the second editing operation. Therefore, the editing operation corresponding to the current relative position relation of the user can be prompted through the operation identifier, and the user can change the relative position relation between the editing tool and the contour line of the target area through the prompting of the operation identifier so as to select the editing operation.
In step S13, the outline may be edited based on the relative position relationship to obtain the adjusted object region, and the editing performed on the outline may be described in various ways.
In some implementations, in a case where the editing tool is located outside the contour line, that is, the editing tool is separated from or circumscribed about the contour line, the first editing operation may be performed by the editing tool, and the first editing operation may be an operation of pushing the contour line from the outside of the contour line toward the inside of the contour line, that is, under the action of the first editing operation, a part of the contour line on which the editing tool acts may be changed according to a boundary of the editing tool, so that a shape of the part of the contour line on which the editing tool acts may fit the boundary of the editing tool, and at the same time, the part of the contour may not move to the inside of the editing tool, and an effect of the editing tool pushing the contour line from the outside of the contour line toward the inside of the contour line may be exhibited, and the adjusted contour line of the target. The area of the region corresponding to the contour line after adjustment is smaller than the area of the region corresponding to the contour line before adjustment, and by adopting the mode, the adjustment effect of reducing the contour line can be realized, the adjustment mode is simple, and the flow of contour line adjustment is simplified.
Fig. 2 is a schematic diagram illustrating a first editing operation performed on a contour line according to an embodiment of the present disclosure, where a shows the contour line before contour line adjustment, and in response to an editing instruction triggered by a user operation of pressing a mouse for a long time, an editing tool may move in a direction indicated by a dotted arrow under the action of the first editing operation, so as to push the contour line from outside to inside. B shows the contour line after the contour line adjustment, the editing tool is moved to the position indicated by the dotted arrow, and the adjusted contour line fits the boundary of the editing tool.
In some implementations, in a case where the editing tool is located inside the contour line, that is, the editing tool is internally included or inscribed in the contour line, the second editing operation may be performed by the editing tool, and the second editing operation may be an operation of pushing the contour line from the inside of the contour line toward the outside of the contour line, that is, under the action of the second editing operation, a partial contour applied to the contour line by the editing tool may be changed according to a boundary of the editing tool, so that a shape of the partial contour applied to the contour line by the editing tool fits a boundary of the editing tool, and at the same time, the partial contour does not move to the inside of the editing tool, and an effect that the editing tool pushes the contour line from the inside of the contour line toward the outside of the contour line is presented, and the contour line after the adjustment is completed can be obtained after. The area of the region corresponding to the contour line after adjustment is larger than the area of the region corresponding to the contour line before adjustment, and by adopting the mode, the effect of enlarging the contour line adjustment can be realized, the adjustment mode is simple, and the flow of contour line adjustment is simplified.
Fig. 3 is a schematic diagram illustrating a second editing operation performed on the contour line according to an embodiment of the disclosure, where a shows the contour line before the contour line is adjusted, and in response to an editing instruction triggered by a user operation of pressing a mouse for a long time, the editing tool may move in a direction indicated by a dotted arrow under the action of the second editing operation, and the contour line is pushed from inside to outside. B shows the contour line after the contour line adjustment, the editing tool is moved to the position indicated by the dotted arrow, and the adjusted contour line fits the boundary of the editing tool.
In some implementations, in a case where the editing tool intersects with the target area corresponding to the contour line, that is, in a case where there is an intersection between the image area where the editing tool is located and the target area indicated by the contour line, a third editing operation may be performed by the editing tool, and the third editing operation may be an operation of drawing a newly added contour. Under the action of the third editing operation, a new contour can be formed according to the boundary of the editing tool, the new contour can form a new contour line with the contour of the part of the original contour line which is not intersected with the editing tool, and the contour line of the target area after adjustment can be obtained after the adjustment is finished. In this way, free drawing of the contour line can be achieved.
In the case where the third editing operation is performed by 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 region, and the center of the editing tool is located inside the contour line, the contour line where the contour line intersects the boundary of the editing tool may be replaced with a new contour, and the adjusted contour line of the target region may be obtained after the adjustment is completed. The newly added contour may be formed by a boundary of an editing tool located outside the contour line, and in some examples, the boundary of the editing tool located outside the contour line may be used as the newly added contour, the newly added contour may be added, a part of the contour line where the contour line intersects with the boundary of the editing tool may be deleted, and the contour line after the adjustment of the target region may be obtained after the adjustment is completed, so that the newly added contour may be freely drawn outside the original contour line.
FIG. 4 illustrates a schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure. Wherein, A shows the contour line before contour line adjustment, under the condition that the center of the editing tool is positioned in the contour line and intersected with the contour line, in response to an editing instruction triggered by a user operation of clicking a mouse by a user, under the action of a third editing operation, the boundary of the editing tool positioned outside the contour line is taken as a new contour, the new contour is added, and the partial contour (dotted line part) intersected with the boundary of the contour line and the editing tool is deleted. And B, showing the contour line after contour line adjustment, and adding a boundary of the contour line fitting editing tool.
In the case where the third editing operation is performed by the editing tool, if the center of the editing tool is located outside the contour line, that is, the editing tool intersects the contour line of the target region, and the center of the editing tool is located outside the contour line, the boundary of the editing tool located inside the contour line may be regarded as the newly added contour. The two image areas formed by the new contour and the contour line are further determined, namely, the new contour in the target area can divide the target area into two image areas. The new contour may be further drawn based on the areas of the two image areas on the basis of the original contour of the target area, and the adjusted contour of the target area may be obtained after the adjustment is completed. By the method, different new contour drawing modes can be provided for the user according to the areas of the two image areas, and different contour adjustment requirements of the user are further met.
FIG. 5 illustrates a schematic diagram of performing a third editing operation on a contour line according to an embodiment of the present disclosure. Wherein, A shows the contour line before contour line adjustment, under the condition that the center of the editing tool is positioned outside the contour line and intersected with the contour line, in response to an editing instruction triggered by a user operation of clicking a mouse by a user, under the action of a third editing operation, the boundary of the editing tool positioned inside the contour line is taken as a new contour, the new contour is added, and the partial contour (dotted line part) intersected with the boundary of the contour line and the editing tool is deleted. And B, showing the contour line after contour line adjustment, and adding a boundary of the contour line fitting editing tool.
In the above implementation manner, the new contour may be drawn based on the areas of the two image areas on the basis of the contour line to obtain the contour line after the target area is adjusted, and a manner of drawing the new contour based on the areas of the two image areas is exemplified below by some examples.
In one example, a ratio of areas between two image regions may be determined, and then the ratio may be compared with an end point of a preset threshold interval, and in a case where the ratio is within the preset threshold interval, a new contour may be drawn on the basis of an original contour, the new contour may be formed by a boundary of an editing tool located inside the original contour, and the adjusted contour may include contours of the two image regions, for example, a new contour may be copied on the basis of the drawn new contour, one new contour and a part of the contour of the target region form a contour of one image region, and the other new contour and another part of the contour of the target region form a contour of the other image region, so as to obtain contours of the two image regions. In some examples, a new contour number may be automatically generated, the contour number may indicate the contour of one of the two image regions, and the contour of the other of the two image regions may retain the contour number of the original contour of the target region.
Here, the preset threshold interval may be set according to an actual application scenario, for example, may be set to (0.8, 1.25). When the ratio of the two image areas is within the preset threshold interval, the areas of the two image areas are considered to be relatively close, in this case, the user can be considered to split the contour line of the target area into two, the newly added contour can be drawn on the basis of the original contour line of the target area, the newly added contour and the contour line of the target area can form the contour lines of the two image areas, so that the original contour line of the target area can be adjusted into the contour lines of the two image areas, the operation is simple, and the contour adjusting efficiency is improved.
In another example, in a case that the ratio of the areas between the two image regions is not within the preset threshold interval, the area difference between the two image regions may be considered to be large, in this case, a new contour is drawn based on the contour line of the target region, the new contour may be formed by the boundary of an editing tool located inside the original contour line, and a portion of the contour line of the target region corresponding to the first image region is deleted, and the adjusted contour line of the target region may be obtained after the adjustment is completed. Here, the first image region may be an image region having a small area of 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 of the two image regions is deleted, and the contour line formed by the newly added contour and the partial contour corresponding to the image region with the larger area of the two image regions can be used as the adjusted contour line. Therefore, partial contour of the original contour line of the target area can be deleted through the drawn new contour, the operation is simple, and the contour adjusting efficiency is improved.
The following describes an image processing method provided by an embodiment of the present disclosure by way of an example. FIG. 6 shows a schematic diagram of an example of an image processing interface according to an embodiment of the present disclosure. In the present example, the target image is a pathological image, and the target region is a lesion region. And a focus list is displayed on the left side of the contour adjustment interface, each focus area included in the pathological image is listed in the focus list, and different focus areas are correspondingly provided with different contour numbers. The contour line of the lesion region selected in the target image (lesion contour) is displayed in the contour adjustment interface. And a tool bar is displayed on the right side of the contour adjusting interface, the tool bar comprises a fine adjustment tool button, and a user can click the fine adjustment tool button in the tool bar and select an 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, the editing mark is displayed as "+" which indicates that the editing tool can execute a second editing operation of pushing the contour line from inside to outside on the contour line. The user can select other editing operations by changing the relative position relationship between the editing tool and the contour line.
The image processing scheme provided by this example can obtain the relative positional relationship between the editing tool and the lesion area in real time, and can perform the editing operation corresponding to the relative positional relationship on the contour line of the lesion area when receiving the editing instruction triggered by the user operation. The method can reduce the frequent switching of the painting brush and the eraser by a user, has a simple image processing mode, meets the requirement of the user on the contour modification, increases the user experience, and improves the efficiency of the contour modification.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the image processing methods provided by the present disclosure, and the descriptions and corresponding descriptions of the corresponding technical solutions and the corresponding descriptions in the methods section are omitted for brevity.
Fig. 7 illustrates a block diagram of an image processing apparatus according to an embodiment of the present disclosure, the apparatus including, as illustrated in fig. 7:
an obtaining module 31, configured to obtain a target image, where a contour line of a target area is marked on the target image;
a determining 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;
and the executing module 33 is configured to, in response to the editing instruction, execute an editing operation on the contour line based on the relative position relationship, so as to obtain an adjusted contour line.
In one or more possible implementation manners, the executing module 33 is configured to execute the editing operation on the contour line of the target region in a selected state.
In one or more possible implementations, the executing module 33 is configured to execute, by the editing tool, a first editing operation when the editing tool is located outside the contour line, where 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 an area corresponding to the adjusted contour line is smaller than an area corresponding to the contour line before the adjustment.
In one or more possible implementations, the executing module 33 is configured to execute, by the editing tool, a second editing operation when the editing tool is located inside the contour line, where 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 an area corresponding to the adjusted contour line is larger than an area corresponding to the contour line before the adjustment.
In one or more possible implementations, the executing module 33 is configured to execute, by the editing tool, a third editing operation when the editing tool intersects with the target area corresponding to the contour line, where the third editing operation is to draw a new contour, and the adjusted contour line is formed based on a boundary of the editing tool.
In one or more possible implementations, the executing module 33 is configured to, in a case that the center of the editing tool is located inside the contour line, replace a part of the contour line where the contour line intersects with the editing tool with an additional contour, where the additional contour is formed by a boundary of the editing tool located outside the contour line.
In one or more possible implementations, the executing module 33 is configured to determine, in a case that a center of the editing tool is located outside the contour line, two image regions formed by a new contour and the contour line, where the new contour is formed by a boundary of the editing tool located inside the contour line; and drawing the newly-added contour on the basis of the contour lines based on the areas of the two image regions.
In one or more possible implementations, the performing module 33 is configured to determine a ratio of areas between the two image regions; under the condition that the ratio is within a preset threshold value interval, drawing the newly-added contour on the basis of the contour lines, wherein the adjusted contour lines comprise the contour lines of the two image areas; and under the condition that the ratio is not within a preset threshold value interval, drawing the newly added contour on the basis of the contour line, and deleting a part of contour corresponding to a first image area in the contour line, wherein the first image area is the image area with a small area in the two image areas.
In one or more possible implementations, the apparatus further includes: the size adjusting module is used for receiving a size adjusting instruction; adjusting the size of the editing tool in response to the size adjustment instruction.
In one or more possible implementations, the apparatus further includes: the sampling module is used for counting the number of control points included in the contour line in the process of executing the editing operation on the contour line, wherein the control points are used for controlling the shape of the contour line; and under the condition that the number of the control points is larger than a preset number threshold, resampling the control points included in the contour line.
In one or more possible implementations, the target image includes a pathology image, and the target region includes a lesion region.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The embodiments of the present disclosure also provide a computer program product, which includes computer readable code, and when the computer readable code runs on a device, a processor in the device executes instructions for implementing the image processing method provided in any one of the above embodiments.
The embodiments of the present disclosure also provide another computer program product for storing computer readable instructions, which when executed cause a computer to perform the operations of the image processing method provided in any of the above embodiments.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 8 illustrates a block diagram of an electronic device 800 in accordance with an embodiment of the disclosure. 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 terminal.
Referring to fig. 8, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices 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 or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a 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 an input signal from a 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 boundary of a 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 facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. 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 a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or 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.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may 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 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 9 illustrates a block diagram of an electronic device 1900 in accordance with an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 9, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power 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, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of the present application based on the graphic user interface operating System (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, 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 disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or 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 may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (14)

1. An image processing method, comprising:
acquiring a target image, wherein a contour line of a target area is marked on the target image;
determining the relative position relation between an editing tool acting on the target image and the contour line based on the contour line;
and responding to an editing instruction, and executing editing operation on the contour line based on the relative position relation to obtain the adjusted contour line.
2. The method of claim 1, wherein the performing an editing operation on the contour line comprises:
and executing the editing operation on the contour line of the target area under the selected state of the contour line.
3. The method according to claim 1 or 2, wherein the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line comprises:
and under the condition that the editing tool is positioned outside the contour line, executing 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 to 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, wherein the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line comprises:
and under the condition that the editing tool is positioned in the contour line, executing a second editing operation through the editing tool, wherein the second editing operation is to push the contour line from the inside of the contour line to 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 or 2, wherein the performing an editing operation on the contour line based on the relative position relationship to obtain an adjusted contour line comprises:
and under the condition that the editing tool is intersected with the target area corresponding to the contour line, executing a third editing operation through the editing tool, wherein the third editing operation is used for drawing a newly added contour line, and the adjusted contour line is formed on the basis of the boundary of the editing tool.
6. The method of claim 5, wherein performing a third editing operation by the editing tool comprises:
and under the condition that the center of the editing tool is positioned inside the contour line, replacing the part of the contour line intersected with the editing tool with a new contour, wherein the new contour is formed by the boundary of the editing tool positioned outside the contour line.
7. The method of claim 5, wherein performing a third editing operation by the editing tool comprises:
determining two image areas formed by a newly added contour and the contour line under the condition that the center of the editing tool is positioned outside the contour line, wherein the newly added contour is formed by the boundary of the editing tool positioned inside the contour line;
and drawing the newly-added contour on the basis of the contour lines based on the areas of the two image regions.
8. The method of claim 7, wherein said drawing said new contour based on said contour lines based on areas of said two image regions comprises:
determining a ratio of areas between the two image regions;
under the condition that the ratio is within a preset threshold value interval, drawing the newly-added contour on the basis of the contour lines, wherein the adjusted contour lines comprise the contour lines of the two image areas;
and under the condition that the ratio is not within a preset threshold value interval, drawing the newly added contour on the basis of the contour line, and deleting a part of contour corresponding to a first image area in the contour line, wherein the first image area is the image area with a small area in the two image areas.
9. The method according to any one of claims 1 to 8, further comprising:
receiving a size adjustment instruction;
adjusting the size of the editing tool in response to the size adjustment instruction.
10. The method according to any one of claims 1 to 9, further comprising:
counting the number of control points included in the contour line in the process of executing the editing operation on the contour line, wherein the control points are used for controlling the shape of the contour line;
and under the condition that the number of the control points is larger than a preset number threshold, resampling the control points included in the contour line.
11. The method of any one of claims 1 to 10, wherein the target image comprises a pathology image and the target region comprises a lesion region.
12. An image processing apparatus characterized by comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a target image, and a contour line of a target area is marked on the target image;
the determining module is used for determining the relative position relation between the editing tool acting on the target image and the contour line based on the contour line;
and the execution module is used for responding to the editing instruction and executing editing operation on the contour line based on the relative position relation to obtain the adjusted contour line.
13. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 11.
14. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 11.
CN202110479949.4A 2021-04-30 2021-04-30 Image processing method and device, electronic equipment and storage medium Pending CN113096213A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110479949.4A CN113096213A (en) 2021-04-30 2021-04-30 Image processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110479949.4A CN113096213A (en) 2021-04-30 2021-04-30 Image processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113096213A true CN113096213A (en) 2021-07-09

Family

ID=76680914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110479949.4A Pending CN113096213A (en) 2021-04-30 2021-04-30 Image processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113096213A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113689355A (en) * 2021-09-10 2021-11-23 数坤(北京)网络科技股份有限公司 Image processing method, image processing device, storage medium and computer equipment
CN114063858A (en) * 2021-11-26 2022-02-18 北京百度网讯科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114415912A (en) * 2021-12-31 2022-04-29 乐美科技股份私人有限公司 Element editing method and device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113689355A (en) * 2021-09-10 2021-11-23 数坤(北京)网络科技股份有限公司 Image processing method, image processing device, storage medium and computer equipment
CN114063858A (en) * 2021-11-26 2022-02-18 北京百度网讯科技有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114415912A (en) * 2021-12-31 2022-04-29 乐美科技股份私人有限公司 Element editing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110647834B (en) Human face and human hand correlation detection method and device, electronic equipment and storage medium
CN109816764B (en) Image generation method and device, electronic equipment and storage medium
CN109087238B (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
EP3301558A1 (en) Method and device for sharing content
CN107908351B (en) Application interface display method and device and storage medium
CN113096213A (en) Image processing method and device, electronic equipment and storage medium
CN109948494B (en) Image processing method and device, electronic equipment and storage medium
CN110569777B (en) Image processing method and device, electronic device and storage medium
CN112465843A (en) Image segmentation method and device, electronic equipment and storage medium
CN108108418B (en) Picture management method, device and storage medium
CN110933488A (en) Video editing method and device
CN110989901B (en) Interactive display method and device for image positioning, electronic equipment and storage medium
CN109934240B (en) Feature updating method and device, electronic equipment and storage medium
CN111523346A (en) Image recognition method and device, electronic equipment and storage medium
CN112767288A (en) Image processing method and device, electronic equipment and storage medium
CN110989905A (en) Information processing method and device, electronic equipment and storage medium
CN112085097A (en) Image processing method and device, electronic equipment and storage medium
CN112860061A (en) Scene image display method and device, electronic equipment and storage medium
CN109783171B (en) Desktop plug-in switching method and device and storage medium
CN110989884A (en) Image positioning operation display method and device, electronic equipment and storage medium
CN112102300B (en) Counting method and device, electronic equipment and storage medium
CN112598676B (en) Image segmentation method and device, electronic equipment and storage medium
CN107730443B (en) Image processing method and device and user equipment
CN110502993B (en) Image processing method, image processing device, electronic equipment and storage medium
CN113660531A (en) Video processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20240605

Address after: Units 6-01, 6-49, 6-80, 6th Floor, No. 1900 Hongmei Road, Xuhui District, Shanghai, 200030

Applicant after: Shanghai Shangtang Shancui Medical Technology Co.,Ltd.

Country or region after: China

Address before: Room 1605a, building 3, 391 Guiping Road, Xuhui District, Shanghai

Applicant before: SHANGHAI SENSETIME INTELLIGENT TECHNOLOGY Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right