CN116862793A - Image restoration method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN116862793A
CN116862793A CN202310813072.7A CN202310813072A CN116862793A CN 116862793 A CN116862793 A CN 116862793A CN 202310813072 A CN202310813072 A CN 202310813072A CN 116862793 A CN116862793 A CN 116862793A
Authority
CN
China
Prior art keywords
processed
tree structure
determining
image
pixel point
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
CN202310813072.7A
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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202310813072.7A priority Critical patent/CN116862793A/en
Publication of CN116862793A publication Critical patent/CN116862793A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses an image restoration method, an image restoration device, electronic equipment and a storage medium. The image restoration method comprises the steps of obtaining an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed; determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights; and repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image. Based on the technical scheme of the embodiment of the invention, the high efficiency and accuracy of image restoration can be improved.

Description

Image restoration method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image restoration method, an image restoration device, an electronic device, and a storage medium.
Background
Based on the tree topology structure in the image, the analysis of the image is a common image data analysis means, and at present, the extraction of the tree structure is generally carried out by using a semantic segmentation model. However, the existing semantic segmentation model cannot guarantee the integrity of the extracted tree structure, that is, the extracted tree structure usually has the condition that part of nodes are disconnected, so that post-processing is required to be performed on the extracted tree structure to repair the node connection disconnection position of the tree structure, thereby guaranteeing the integrity of the tree structure.
The existing tree topology restoration method is a manual restoration method, specifically, the positions of node connection disconnection are identified and manually restored by manually comparing an original image with a tree topology structure extracted by using a semantic segmentation model, but manual restoration is long in time consumption, and restoration results depend on subjective judgment of a restoration person and require a certain experience. Therefore, the situation of the tree structure restoration error in the image usually occurs, and in summary, the efficiency and accuracy of the image restoration in the prior art are poor.
Disclosure of Invention
The invention provides an image restoration method, an image restoration device, electronic equipment and a storage medium, which are used for solving the technical problems of poor image restoration efficiency and accuracy.
According to an aspect of the present invention, there is provided an image restoration method, wherein the method includes:
acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed;
determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights;
and repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image.
According to another aspect of the present invention, there is provided an image restoration apparatus, wherein the apparatus includes:
the communication component determining module is used for acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed;
the matrix determining module is used for determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights;
And the image restoration module is used for restoring the tree structure to be processed according to the weight connection matrix to obtain a restored tree structure so as to obtain a restored image.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image restoration method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the image restoration method according to any of the embodiments of the present invention.
According to the technical scheme, the to-be-processed tree structure corresponding to the target object in the to-be-processed image is extracted by acquiring the to-be-processed image, and the to-be-processed communication component corresponding to the to-be-processed tree structure is determined; determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights; and repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image. And the image restoration is carried out based on the extracted connected components, so that the high efficiency of the image restoration is improved, the tree structure restoration is carried out based on the determined weight connection matrix, the image restoration is carried out, and the accuracy of the image restoration is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an image restoration method according to a first embodiment of the present invention;
FIG. 2a is a scene graph of a fundus image provided in accordance with an embodiment of the present invention;
fig. 2b is a scene graph of an arterial vessel structure in a fundus image according to an embodiment of the present invention;
FIG. 2c is a schematic representation of a repaired arterial vessel structure provided in accordance with an embodiment of the present invention;
FIG. 3a is a scene graph in a CT image of a lung provided in accordance with an embodiment of the invention;
FIG. 3b is a scene graph of pulmonary artery structure in a CT image of a lung, according to an embodiment of the present invention;
FIG. 3c is a schematic representation of a pulmonary artery structure to be repaired, provided in accordance with an embodiment of the present invention;
FIG. 3d is a scene graph of a repaired pulmonary artery structure provided in accordance with embodiments of the invention;
FIG. 4 is a flowchart of an image restoration method according to a second embodiment of the present invention;
FIG. 5 is a scene graph of determining reference connection weights provided in accordance with an embodiment of the invention;
FIG. 6 is an overall flow chart of an image restoration method provided in accordance with an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an image restoration device according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device implementing an image restoration method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of an image restoration method according to an embodiment of the present invention, where the method may be applied to a spanning tree restoration, and the method may be performed by an image restoration device, where the image restoration device may be implemented in hardware and/or software, and the image restoration device may be configured in computer software. As shown in fig. 1, the method includes:
S110, acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed.
Wherein the image to be processed can be understood as an image to be repaired. Alternatively, the image to be processed may be an image including a tree structure. In the embodiment of the present invention, the image to be processed may be preset according to the scene requirement, which is not specifically limited herein. For example, in a medical scenario, the image to be processed may be a fundus image of a vascular structure of an artery (see fig. 2 a) or a lung CT image including a pulmonary artery structure (see fig. 3 a).
The target object may be understood as an object having a tree structure in the image to be processed. Alternatively, in the case where the image to be processed is a fundus image, the target object may be an arterial blood vessel. In case the image to be processed is a lung CT image, the target object may be a pulmonary artery.
The tree structure to be processed can be understood as a tree structure corresponding to the target object in the image to be processed. Alternatively, in the case where the image to be processed is a fundus image, the tree structure to be processed may be an arterial vessel structure. In case the image to be processed is a lung CT image, the tree structure to be processed may be a pulmonary artery structure (refer to fig. 2b and 3 b).
The connected component to be processed may be understood as at least one connected domain corresponding to the tree structure to be processed (refer to fig. 2b and 3 c).
Optionally, the extracting a tree structure to be processed corresponding to the target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed, includes:
bone extraction is carried out on the target object in the image to be processed through an LEE algorithm, and the tree structure to be processed is obtained;
and traversing and marking each connected component in the tree structure to be processed to obtain the connected component to be processed corresponding to the tree structure to be processed.
Optionally, traversing the whole tree structure to be processed through a depth-first search algorithm, and marking each connected component in the tree structure to be processed to obtain the connected component to be processed corresponding to the tree structure to be processed.
In the embodiment of the invention, the skeleton extraction is performed on the image to be processed through the Lee algorithm, and a skeletonized fine line structure can be constructed in the image to be processed based on the edge information of the image to be processed, so that the tree structure to be processed is obtained, the high efficiency of skeleton extraction is improved, redundant information can be reduced under the condition of keeping the tree structure to be processed, and the accuracy of the extracted tree structure to be processed is ensured.
And S120, determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights.
The candidate connection weight can be understood as a connection weight between every two adjacent connected components to be processed. The weight connection matrix may be understood as a matrix corresponding to the tree structure to be processed, which is formed based on candidate connection weights between every two adjacent connected components to be processed.
S130, repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image.
The repair tree structure may be understood as a tree structure obtained after repairing the tree structure to be processed according to the weight connection matrix (refer to fig. 2c and fig. 3 d).
The repair image may be understood as an image corresponding to the repair tree structure.
Optionally, repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure, so as to obtain a repaired image, including:
Taking the smallest candidate connection weight in the weight connection matrix as a target connection weight;
and connecting the two to-be-processed connected components corresponding to the target connection weight to obtain a repair tree structure so as to obtain a repair image corresponding to the repair tree structure.
Wherein the target connection weight may be understood as the smallest candidate connection weight in the weighted connection matrix.
Optionally, after the obtaining the repair image corresponding to the repair tree structure, the method further includes:
determining the number of the to-be-processed connected components of the repair tree structure corresponding to the repair image, and under the condition that the number is more than one, returning to execute the operation of determining the candidate connection weights between every two adjacent to-be-processed connected components, determining a weight connection matrix corresponding to the to-be-processed tree structure based on the candidate connection weights, and repairing the to-be-processed tree structure according to the weight connection matrix to obtain a repair tree structure so as to obtain a repair image;
and taking the current repair image as a target image until the number of the communication components to be processed of the repair tree structure corresponding to the repair image is one.
The target image can understand the repair image corresponding to the repair tree structure comprising one communication component to be processed.
According to the technical scheme, the to-be-processed tree structure corresponding to the target object in the to-be-processed image is extracted by acquiring the to-be-processed image, and the to-be-processed communication component corresponding to the to-be-processed tree structure is determined; determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights; and repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image. And the image restoration is carried out based on the extracted connected components, so that the high efficiency of the image restoration is improved, the tree structure restoration is carried out based on the determined weight connection matrix, the image restoration is carried out, and the accuracy of the image restoration is improved.
Example two
Fig. 4 is a flowchart of an image restoration method according to a second embodiment of the present invention, where the method is performed by refining the candidate connection weights between each two adjacent connected components to be processed according to the above embodiment. As shown in fig. 4, the method includes:
S210, acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed.
S220, determining the number of the communication components to be processed, and in the case that the number is more than one.
S230, determining the current two adjacent connected components to be processed as a first connected component and a second connected component, determining the pixel point in the first connected component as a first pixel point, and determining the pixel point in the second connected component as a second pixel point.
The first connected component and the second connected component are the current two adjacent connected components to be processed. The first pixel point is a pixel point in the first connected component. The second pixel point is a pixel point in the second connected component. It is understood that the first connected component may include a plurality of the first pixel points, and the second connected component may include a plurality of the second pixel points.
S240, determining a first point dominant direction of the first pixel point and a second point dominant direction of the second pixel point aiming at the current first pixel point and the current second pixel point, and determining a reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction.
The first point dominant direction may be understood as a point dominant direction of the first pixel point.
The second dot dominant direction may be understood as a dot dominant direction of the second pixel dot.
The reference connection weight may be understood as a connection weight between the first pixel point and the second pixel point.
Optionally, the determining the first point dominant direction of the first pixel point and the second point dominant direction of the second pixel point includes:
acquiring a first coordinate of the first pixel point and a second coordinate of the second pixel point;
and determining the first point dominant direction and the second point dominant direction based on the first coordinate and the second coordinate, wherein the first coordinate and the second coordinate are multidimensional coordinates with the same dimension.
The first coordinate may be understood as a coordinate of the first pixel point. In the embodiment of the present invention, the dimension of the first coordinate may be set according to the scene requirement, which is not specifically limited herein. The first coordinate may be (x 1 ,x 2 ) Or (x) 1 ,x 2 ,…,x n ) Etc.
The second coordinate may be understood as the current coordinate of the second pixel point. In the embodiment of the present invention, the dimension of the second coordinate may be set according to the scene requirement, which is not specifically limited herein. The second coordinate may be (y 1 ,y 2 ) Or (y) 1 ,y 2 ,…,y n ) Etc.
Optionally, the determining the first point dominant direction and the second point dominant direction based on the first coordinate and the second coordinate includes:
determining the first point dominant direction and the second point dominant direction based on:
d 1 =(y 1 -x 1 ,y 2 -x 2 ,…,y n -x n )
d 2 =(x 1 -y 1 ,x 2 -y 2 ,…,x n -y n )
wherein d 1 Represents the dominant direction of the first point, d 2 Representing the dominant direction of the second point, x 1 Representing one-dimensional coordinates, x of the current first pixel point 2 Representing the two-dimensional coordinates, x, of the current first pixel point n Representing the n-dimensional coordinates, y, of the current first pixel point 1 Representing one-dimensional coordinates, y, of the current second pixel point 2 Representing the two-dimensional coordinates, y, of the current second pixel point n Representing the n-dimensional coordinates of the current second pixel point.
Optionally, the determining the reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction includes:
determining candidate paths of the first pixel point and the second pixel point, and determining Euclidean distance according to the candidate paths;
determining a first included angle between the first point dominant direction and the second point dominant direction, a second included angle between the first point dominant direction and the candidate path, and a third included angle between the first point dominant direction and the second point dominant direction;
And determining the reference connection weight according to the Euclidean distance, the first included angle, the second included angle and the third included angle.
The candidate path may be understood as a straight line path between the first pixel point and the second pixel point. The euclidean distance may be understood as a distance corresponding to the candidate path. The first angle may be understood as the angle between the first point dominant direction and the second point dominant direction. The second angle may be understood as the angle between the dominant direction of the first point and the candidate path. The third angle may be understood as the angle between the first point dominant direction and the second point dominant direction. Referring to FIG. 5, where L represents a candidate path, α represents a first angle, θ 1 Represents a second included angle, theta 2 Representing a third included angle.
S250, determining a plurality of reference connection weights between each first pixel point and each second pixel point, and determining the smallest reference connection weight in the plurality of reference connection weights as the candidate connection weight between the current two adjacent communication components to be processed.
Optionally, for each first pixel point and each second pixel point, determining the reference connection weight according to the euclidean distance, the first included angle, the second included angle and the third included angle, and determining the smallest reference connection weight among the plurality of reference connection weights as the candidate connection weight between the current two adjacent to-be-processed communication components, where a specific calculation mode is as follows:
w ij =min{||L|| 2 (sin(α)+sin(θ 1 )+sin(θ 2 )+1)}
Wherein w is ij Representing the weight of the candidate connection, L 2 Represents Euclidean distance, alpha represents a first included angle theta 1 Represents a second included angle, theta 2 Representing a third included angle.
And S260, determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weight.
Optionally, in the case that the number of the to-be-processed connected components of the to-be-processed image is n, the weight connection matrix corresponding to the to-be-processed tree structure may be an n-dimensional adjacency matrix:
wherein W represents a weight connection matrix, W 11 Representing candidate connection weights, w, between a first connected component and a first second connected component n1 Representing candidate connection weights, w, between a first connected component and an nth second connected component nn Representing candidate connection weights between the nth first connected component and the nth second connected component.
S270, repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image.
According to the technical scheme, the current two adjacent connected components to be processed are determined to be the first connected component and the second connected component, the pixel point in the first connected component is determined to be the first pixel point, and the pixel point in the second connected component is determined to be the second pixel point; determining a first point dominant direction of the first pixel point and a second point dominant direction of the second pixel point aiming at the current first pixel point and the current second pixel point, and determining a reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction; and determining a plurality of reference connection weights between each first pixel point and each second pixel point, and determining the smallest reference connection weight in the plurality of reference connection weights as the candidate connection weight between the current two adjacent communication components to be processed. And determining candidate connection weights based on the point dominant direction, so that the accuracy of the determined candidate connection weights between every two adjacent communication components to be processed is improved, and the accuracy of the weight connection matrix corresponding to the tree structure to be processed, which is obtained based on the candidate connection weights, is further ensured.
Fig. 6 is an overall flowchart of an image restoration method according to an embodiment of the present invention. As shown in fig. 6, the overall flow of the image restoration method may be:
1. extracting a tree structure to be processed. And performing skeleton extraction on the image to be processed by using a Lee algorithm to obtain a tree structure to be processed. In the invention, the Lee algorithm is used for extracting bones of the image to be processed, and a skeletonized fine line structure can be constructed in the image to be processed based on the edge information of the image to be processed, so as to obtain a tree structure to be processed. The method can efficiently extract the important structure in the image to be processed to obtain the tree structure to be processed, reduce redundant information and ensure the accuracy of the extracted tree structure to be processed.
2. The connected component to be processed is marked. And traversing and marking each connected component in the tree structure to be processed through a depth-first search algorithm to obtain the connected component to be processed corresponding to the tree structure to be processed.
3. The point dominant direction is calculated. It will be appreciated that tree structures are typically formed by growth and branching processes, and that structures are subject to biological and physical constraints, and that the degree of curvature is typically smooth. Therefore, the method introduces the leading direction of the points, is used for repairing the tree structure to be processed, and improves the correctness of tree structure repair and image repair.
4. Candidate connection weights are calculated. And determining candidate connection weights between every two adjacent communication components to be processed according to the Euclidean distance, the first included angle, the second included angle and the third included angle.
5. And repairing the tree structure to be processed. If the number of the connected components to be processed of the image to be processed is n, the candidate connection weights among different connected components to be processed can form an n-dimensional adjacency matrix W; connecting two to-be-processed connected components corresponding to the smallest candidate connection weight in the W by using a Bresenham algorithm to obtain a repair image; updating the adjacency matrix W for the repair image; until the restored image comprises a communication component to be processed, obtaining a target image.
The invention introduces the tree structure of the target object, and converts the breakpoint repairing problem of the tree structure to be processed in the image to be processed into the connection problem of the connected components to be processed. By analyzing and utilizing the relation among all the communication components to be processed, the disconnection part of the tree structure to be processed is effectively connected, and the image restoration is realized.
According to the characteristic that the tree structure to be processed has certain extensibility in the current direction, the coordinates of the pixel points are introduced, the point dominant direction is determined, and the point dominant direction is used as a measurement index for connecting the communication components to be processed, so that the accuracy and the stability of image restoration are improved.
The invention is suitable for two-dimensional, three-dimensional and multidimensional images to be processed, and has wider applicability.
Example III
Fig. 7 is a schematic structural diagram of an image restoration device according to a third embodiment of the present invention. As shown in fig. 7, the apparatus includes: a connected component determination module 310, a matrix determination module 320, and an image restoration module 330; wherein,,
the connected component determining module 310 is configured to obtain an image to be processed, extract a tree structure to be processed corresponding to a target object in the image to be processed, and determine a connected component to be processed corresponding to the tree structure to be processed; a matrix determining module 320, configured to determine the number of the to-be-processed connected components, and in case that the number is more than one, determine candidate connection weights between every two adjacent to the to-be-processed connected components, and determine a weight connection matrix corresponding to the to-be-processed tree structure based on the candidate connection weights; and the image restoration module 330 is configured to restore the tree structure to be processed according to the weight connection matrix, so as to obtain a restored tree structure, so as to obtain a restored image.
According to the technical scheme, the to-be-processed tree structure corresponding to the target object in the to-be-processed image is extracted by acquiring the to-be-processed image, and the to-be-processed communication component corresponding to the to-be-processed tree structure is determined; determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights; and repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image. And the image restoration is carried out based on the extracted connected components, so that the high efficiency of the image restoration is improved, the tree structure restoration is carried out based on the determined weight connection matrix, the image restoration is carried out, and the accuracy of the image restoration is improved.
Optionally, the matrix determining module 320 includes: the pixel point determining unit, the pixel point processing unit and the candidate connection weight determining unit; wherein,,
the pixel point determining unit is used for determining the current two adjacent connected components to be processed as a first connected component and a second connected component, determining the pixel point in the first connected component as a first pixel point and determining the pixel point in the second connected component as a second pixel point;
the pixel point processing unit is used for determining a first point dominant direction of the first pixel point and a second point dominant direction of the second pixel point aiming at the current first pixel point and the current second pixel point, and determining a reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction;
the candidate connection weight determining unit is configured to determine a plurality of reference connection weights between each first pixel point and each second pixel point, and determine the smallest reference connection weight among the plurality of reference connection weights as the candidate connection weight between the current two adjacent to-be-processed connected components.
Optionally, the pixel point processing unit is configured to:
acquiring a first coordinate of the first pixel point and a second coordinate of the second pixel point;
and determining the first point dominant direction and the second point dominant direction based on the first coordinate and the second coordinate, wherein the first coordinate and the second coordinate are multidimensional coordinates with the same dimension.
Optionally, the pixel point processing unit is configured to:
determining candidate paths of the first pixel point and the second pixel point, and determining Euclidean distance according to the candidate paths;
determining a first included angle between the first point dominant direction and the second point dominant direction, a second included angle between the first point dominant direction and the candidate path, and a third included angle between the first point dominant direction and the second point dominant direction;
and determining the reference connection weight according to the Euclidean distance, the first included angle, the second included angle and the third included angle.
Optionally, the image restoration module 330 includes: connecting a weight processing unit and an image restoration unit; wherein,,
the connection weight processing unit is used for taking the smallest candidate connection weight in the weight connection matrix as a target connection weight;
The image restoration unit is used for connecting the two to-be-processed connected components corresponding to the target connection weight to obtain a restoration tree structure so as to obtain a restoration image corresponding to the restoration tree structure.
Optionally, the image restoration module 330 further includes a loop restoration unit and a target image determination unit; wherein,,
the cyclic restoration unit is configured to determine, after the restoration image corresponding to the restoration tree structure is obtained, a number of the to-be-processed connected components of the restoration tree structure corresponding to the restoration image, and if the number is more than one, return to perform an operation of determining candidate connection weights between every two adjacent to-be-processed connected components, determining a weight connection matrix corresponding to the to-be-processed tree structure based on the candidate connection weights, and restoring the to-be-processed tree structure according to the weight connection matrix to obtain a restoration tree structure so as to obtain a restored image;
the target image determining unit is configured to take the current repair image as a target image until the number of to-be-processed connected components of the repair tree structure corresponding to the repair image is one.
Optionally, the connected component determining module 310 is configured to:
bone extraction is carried out on the target object in the image to be processed through an LEE algorithm, and the tree structure to be processed is obtained;
and traversing and marking each connected component in the tree structure to be processed to obtain the connected component to be processed corresponding to the tree structure to be processed.
The image restoration device provided by the embodiment of the invention can execute the image restoration method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 8 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 8, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the image restoration method.
In some embodiments, the image restoration method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the image restoration method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the image restoration method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An image restoration method, comprising:
acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed;
determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights;
And repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure so as to obtain a repaired image.
2. The method of claim 1, wherein said determining candidate connection weights between each two adjacent connected components to be processed comprises:
determining the current two adjacent connected components to be processed as a first connected component and a second connected component, determining a pixel point in the first connected component as a first pixel point, and determining a pixel point in the second connected component as a second pixel point;
determining a first point dominant direction of the first pixel point and a second point dominant direction of the second pixel point aiming at the current first pixel point and the current second pixel point, and determining a reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction;
and determining a plurality of reference connection weights between each first pixel point and each second pixel point, and determining the smallest reference connection weight in the plurality of reference connection weights as the candidate connection weight between the current two adjacent communication components to be processed.
3. The method of claim 2, wherein the determining a first point dominant direction of the first pixel point and a second point dominant direction of the second pixel point comprises:
acquiring a first coordinate of the first pixel point and a second coordinate of the second pixel point;
and determining the first point dominant direction and the second point dominant direction based on the first coordinate and the second coordinate, wherein the first coordinate and the second coordinate are multidimensional coordinates with the same dimension.
4. The method of claim 2, wherein the determining the reference connection weight between the first pixel point and the second pixel point based on the first point dominant direction and the second point dominant direction comprises:
determining candidate paths of the first pixel point and the second pixel point, and determining Euclidean distance according to the candidate paths;
determining a first included angle between the first point dominant direction and the second point dominant direction, a second included angle between the first point dominant direction and the candidate path, and a third included angle between the first point dominant direction and the second point dominant direction;
And determining the reference connection weight according to the Euclidean distance, the first included angle, the second included angle and the third included angle.
5. The method according to claim 1, wherein the repairing the tree structure to be processed according to the weight connection matrix to obtain a repaired tree structure, to obtain a repaired image, includes:
taking the smallest candidate connection weight in the weight connection matrix as a target connection weight;
and connecting the two to-be-processed connected components corresponding to the target connection weight to obtain a repair tree structure so as to obtain a repair image corresponding to the repair tree structure.
6. The method according to claim 5, further comprising, after the obtaining the repair image corresponding to the repair tree structure:
determining the number of the to-be-processed connected components of the repair tree structure corresponding to the repair image, and under the condition that the number is more than one, returning to execute the operation of determining the candidate connection weights between every two adjacent to-be-processed connected components, determining a weight connection matrix corresponding to the to-be-processed tree structure based on the candidate connection weights, and repairing the to-be-processed tree structure according to the weight connection matrix to obtain a repair tree structure so as to obtain a repair image;
And taking the current repair image as a target image until the number of the communication components to be processed of the repair tree structure corresponding to the repair image is one.
7. The method according to claim 1, wherein the extracting the to-be-processed tree structure corresponding to the target object in the to-be-processed image and determining the to-be-processed connected component corresponding to the to-be-processed tree structure include:
bone extraction is carried out on the target object in the image to be processed through an LEE algorithm, and the tree structure to be processed is obtained;
and traversing and marking each connected component in the tree structure to be processed to obtain the connected component to be processed corresponding to the tree structure to be processed.
8. An image restoration device, comprising:
the communication component determining module is used for acquiring an image to be processed, extracting a tree structure to be processed corresponding to a target object in the image to be processed, and determining a communication component to be processed corresponding to the tree structure to be processed;
the matrix determining module is used for determining the number of the communication components to be processed, and determining candidate connection weights between every two adjacent communication components to be processed under the condition that the number is more than one, and determining a weight connection matrix corresponding to the tree structure to be processed based on the candidate connection weights;
And the image restoration module is used for restoring the tree structure to be processed according to the weight connection matrix to obtain a restored tree structure so as to obtain a restored image.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the image restoration method of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the image restoration method of any one of claims 1-7.
CN202310813072.7A 2023-07-04 2023-07-04 Image restoration method and device, electronic equipment and storage medium Pending CN116862793A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310813072.7A CN116862793A (en) 2023-07-04 2023-07-04 Image restoration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310813072.7A CN116862793A (en) 2023-07-04 2023-07-04 Image restoration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116862793A true CN116862793A (en) 2023-10-10

Family

ID=88221053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310813072.7A Pending CN116862793A (en) 2023-07-04 2023-07-04 Image restoration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116862793A (en)

Similar Documents

Publication Publication Date Title
CN113657289B (en) Training method and device of threshold estimation model and electronic equipment
CN113362314B (en) Medical image recognition method, recognition model training method and device
CN113205041B (en) Structured information extraction method, device, equipment and storage medium
CN114463856B (en) Method, device, equipment and medium for training attitude estimation model and attitude estimation
CN113780098A (en) Character recognition method, character recognition device, electronic equipment and storage medium
CN114511743B (en) Detection model training, target detection method, device, equipment, medium and product
CN113971728B (en) Image recognition method, training method, device, equipment and medium for model
CN117373070B (en) Method and device for labeling blood vessel segments, electronic equipment and storage medium
CN113435257B (en) Method, device, equipment and storage medium for identifying form image
CN116862793A (en) Image restoration method and device, electronic equipment and storage medium
CN115665783A (en) Abnormal index tracing method and device, electronic equipment and storage medium
CN114937149A (en) Image processing method, image processing device, electronic equipment and storage medium
CN117746069B (en) Graph searching model training method and graph searching method
CN114494818B (en) Image processing method, model training method, related device and electronic equipment
CN115690143B (en) Image segmentation method, device, electronic equipment and storage medium
CN113360688B (en) Method, device and system for constructing information base
CN113408592B (en) Feature point matching method, device, electronic equipment and computer readable storage medium
CN117496055A (en) Vascular reconstruction method, vascular reconstruction device, electronic equipment and storage medium
CN114694138B (en) Road surface detection method, device and equipment applied to intelligent driving
CN114972242B (en) Training method and device for myocardial bridge detection model and electronic equipment
CN116994038A (en) Adjustment method and device of blood vessel classification model, electronic equipment and storage medium
CN116245853A (en) Fractional flow reserve determination method, fractional flow reserve determination device, electronic equipment and storage medium
CN117522912A (en) Blood vessel naming method, blood vessel naming device, electronic equipment and storage medium
CN116052188A (en) Form detection method, form detection device, electronic equipment and storage medium
CN115880494A (en) Blood vessel image segmentation method, device, electronic device 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