Disclosure of Invention
The technical problem to be solved by the invention is to provide a fundus image blood vessel segmentation method which is high in operation speed and high in segmentation precision.
The technical scheme adopted by the invention for solving the technical problems is as follows: a fundus image blood vessel segmentation method is characterized by comprising the following steps:
selecting N fundus images and real blood vessel segmentation images of each fundus image to form a training image set, and recording the training image set as { I }i,org,Mi,orgI is more than or equal to 1 and less than or equal to N }; wherein N is more than or equal to 1, I is more than or equal to 1 and less than or equal to N, Ii,orgRepresents { Ii,org,Mi,orgI < i > 1 < i < N >, (M)i,orgRepresents { Ii,org,Mi,orgI < 1 > I < N } of the ith fundus image, Ii,orgAnd Mi,orgAll width of (A) and all height of (B) are W and H;
step ②, for { Ii,org,Mi,orgI is more than or equal to 1 and less than or equal to N, and each fundus image and each real blood vessel segmentation image are subjected to non-overlapping subblock division processing; then, performing combined dictionary training operation on the set formed by all the sub-blocks in the N fundus images and the set formed by all the sub-blocks in the N real blood vessel segmentation images by adopting a K-SVD (singular value decomposition) method to construct and obtain { I }i,org,Mi,orgThe expression dictionary and the segmentation dictionary with |1 ≦ i ≦ N ≦ are correspondingly recorded as DRAnd DS(ii) a Wherein D isRAnd DSThe dimensions of (A) are all 64 multiplied by K, and K represents the number of the set dictionary atoms;
recording an eyeground image to be subjected to blood vessel segmentation as { I (x, y) }, wherein (x, y) represents the coordinate position of a pixel point in the { I (x, y) }, x is more than or equal to 1 and less than or equal to W ', y is more than or equal to 1 and less than or equal to H', W 'represents the width of the { I (x, y) }, H' represents the height of the { I (x, y) }, and I (x, y) represents the pixel value of the pixel point with the coordinate position of (x, y) in the { I (x, y) };
step ④, divide { I (x, y) }into
Sub-blocks with size of 8 × 8 and not overlapped with each other; then, the set of all sub-blocks in { I (x, y) } is recorded as { x }
t',testL 1 is less than or equal to t 'is less than or equal to M'; wherein, the symbol
In order to round the sign of the operation down,
1≤t'≤M',x
t',testrepresents a column vector consisting of pixel values of all pixel points in the t' th sub-block in { I (x, y) }, x
t',testFor describing the t' th sub-block, x, in { I (x, y) }
t',testHas a dimension of 64 × 1;
step ⑤, obtaining D according to the structure
ROptimized reconstruction { x
t',test1 | < t '< M' } sparse coefficient matrix of each sub-block, will { x ≦ M }
t',testThe sparse coefficient matrix of the t ' sub-block in |1 ≦ t ' ≦ M ' } is recorded as a
t',test,a
t',testBy solving for min (| | a)
t',test||
0) Get min (| | a)
t',test||
0) Satisfies the conditions
Wherein, a
t',testHas dimension of Kx 1, min () is a minimum function, the symbol "| | | | luminance
0"is a 0-norm symbol of matrix, symbol" | | | | | | luminance
2"is the 2-norm sign of the matrix, T
0Is an error coefficient;
step D obtained according to the structureSEstimating a preliminary blood vessel segmentation image of { I (x, y) }, and recording the preliminary blood vessel segmentation image as { Q (x, y) }, and recording a column vector consisting of pixel values of all pixel points in an area with a size of 8 x 8 corresponding to the t' th sub-block in { I (x, y) } in { Q (x, y) }asyt',test,yt',test=DSat',test(ii) a Then calculate the binary mask image of { Q (x, y) }, which is marked as { Q1(x, y) }; wherein, Q (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { Q (x, y) }, yt',testHas dimension of 64X 1, Q1(x, y) represents { Q1The coordinate position in (x, y) is the pixel value of the pixel point of (x, y);
step (c), adopting morphological operation to make enhancement treatment on { I (x, y) } so as to obtain enhanced image of { I (x, y) }, and marking it as { Q (Q) }2(x, y) }; wherein Q is2(x, y) represents { Q2The coordinate position in (x, y) is the pixel value of the pixel point of (x, y);
step ⑧ according to the { Q
1(x, y) } and { Q
2(x, y) }, calculating a final blood vessel segmentation image of { I (x, y) } and recording the final blood vessel segmentation image as
Will be provided with
The pixel value of the pixel point with the middle coordinate position (x, y) is recorded as
wherein the symbol "∪" denotes and operates a symbol.
the concrete process of step ② is as follows:
step 2-1 will { I
i,org,M
i,orgDividing each fundus image and each real blood vessel segmentation image in |1 ≦ i ≦ N }
Sub-blocks with size of 8 × 8 and not overlapped with each other; then will { I
i,org,M
i,orgThe set of subblocks in all fundus images |1 ≦ i ≦ N } is denoted as { x
tL 1 is less than or equal to t is less than or equal to M, and the { I } is
i,org,M
i,orgThe set formed by sub-blocks in all real blood vessel segmentation images in the I1 is less than or equal to the I is less than or equal to the N is recorded as { y ≦ N }
tL 1 is not less than t is not less than M; wherein, the symbol
In order to round the sign of the operation down,
1≤t≤M,x
tis represented by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the t-th sub-block in all fundus images
tFor describing { I
i,org,M
i,orgI is not less than 1 but not more than NWith the t-th sub-block, x, in the fundus image
tHas a dimension of 64X 1, y
tIs represented by { I
i,org,M
i,orgI is not less than 1 and not more than N), and y is a column vector formed by pixel values of all pixel points in the t-th sub-block in all real blood vessel segmentation images
tFor describing { I
i,org,M
i,orgI is not less than 1 and not more than N, y is not less than N
tHas a dimension of 64 × 1;
step 2, solving by adopting a K-SVD method
Satisfies the conditions
The structure is obtained as { I
i,org,M
i,orgRepresentation dictionary D with I1 ≦ i ≦ N ≦
RAnd a segmentation dictionary D
S(ii) a Wherein min () is a minimum function with the symbol "| | | | non-woven phosphor
2"is a 2-norm symbol of the matrix, X ═ X
1…x
t…x
M],Y=[y
1…y
t…y
M]The term "[ 2 ]]"is a vector representing a symbol, and the dimensions of X and Y are 64 XM, X
1Is { x
t1 st column vector, x, |1 ≦ t ≦ M }
1Also denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the 1 st sub-block in all fundus images
1For describing { I
i,org,M
i,org1 st subblock, x in all fundus images |1 ≦ i ≦ N }
tIs { x
tT-th column vector in |1 ≦ t ≦ M |, x
MIs { x
tM-th column vector, x, in |1 ≦ t ≦ M |
MAlso denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the Mth sub-block in all fundus images
MFor describing { I
i,org,M
i,orgMth among all fundus images |1 ≦ i ≦ N }Sub-block, y
1Is { y
t1 st column vector, y, |1 ≦ t ≦ M }
1Also denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N) in all real blood vessel segmentation images, and y is a column vector formed by pixel values of all pixel points in the 1 st sub-block in all real blood vessel segmentation images
1For describing { I
i,org,M
i,orgI is not less than 1 and not more than N, y is not less than 1 sub-block in all real blood vessel segmentation images
tIs { y
tT-th column vector in |1 ≦ t ≦ M |, y
MIs { y
tM-th column vector in |1 ≦ t ≦ M ≦ y
MAlso denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and y is the column vector formed by the pixel values of all pixel points in the Mth sub-block in all real blood vessel segmentation images
MFor describing { I
i,org,M
i,orgI ≦ N ≦ 1 ≦ M subblock in all real vessel segmentation images, a representing the sparse matrix, a ═ a ≦ N ≦ M subblock in all real vessel segmentation images
1…a
t…a
M]Dimension of A is KxM, a
1Is the 1 st column vector in A, a
tIs the t-th column vector in A, a
MIs the Mth column vector in A, a
1、a
tAnd a
MThe dimension of (a) is Kx 1, the symbol | | | | | non-conducting phosphor
0"is the 0-norm sign of the matrix, τ is the error coefficient.
in the step of sixthly, the step of,
T
1is a binary threshold value.
the specific process of the step ⑦ is as follows:
⑦ _1, adopting morphological operation to perform enhancement processing on the { I (x, y) } to obtain enhancement values of each pixel point in the { I (x, y) } in different scales and different directions, and marking the enhancement values of the pixel points with the coordinate positions (x, y) in the { I (x, y) } in the scales of sigma and the directions of theta as I
θ,σ(x,y),I
θ,σ(x,y)=B
θ,σ(x,y)-T
θ,σ(x,y),
Wherein, the symbol
Representing morphological dilation operation symbols
Representing a morphological erosion operation symbol, S
θ,σRepresenting a linear structuring element with a direction theta and a dimension sigma,
and (c) step (c 2) of combining enhancement values of each pixel point in the { I (x, y) } in different scales and different directions to obtain an enhancement value of each pixel point in the { I (x, y) }, and recording the enhancement value of the pixel point with the coordinate position (x, y) in the { I (x, y) }asQ'
2(x,y),
Then, an enhanced image { Q } of { I (x, y) } is acquired
2(x, y) }, will { Q
2The pixel value of the pixel point with the coordinate position (x, y) in (x, y) is marked as Q
2(x,y),Q
2(x,y)=Q'
2(x, y) wherein the symbol ". sup.u" denotes and operates on a symbol.
Compared with the prior art, the invention has the advantages that:
1) the method obtains the representation dictionary and the segmentation dictionary of the fundus image through dictionary training, thereby establishing a relation model between the fundus image and the blood vessel segmentation image, and the preliminary blood vessel segmentation image of the fundus image to be subjected to blood vessel segmentation can be predicted and obtained only through simple operation in a test stage.
2) The method obtains the enhanced image of the fundus image to be subjected to the blood vessel segmentation through morphological operation, and obtains the final blood vessel segmentation image through fusing the enhanced image with the binary mask image of the preliminary blood vessel segmentation image of the fundus image to be subjected to the blood vessel segmentation, wherein the obtained final blood vessel segmentation image and the real blood vessel segmentation image keep higher consistency and the segmentation precision is high.
Detailed Description
The invention is described in further detail below with reference to the accompanying examples.
The general implementation block diagram of the blood vessel segmentation method for the fundus image provided by the invention is shown in fig. 1, and the method comprises the following steps:
selecting N fundus images and real blood vessel segmentation images of each fundus image to form a training image set, and recording the training image set as { I }i,org,Mi,orgI is more than or equal to 1 and less than or equal to N }; where N is equal to or greater than 1, the number of fundus images to be selected in the implementation should be appropriate, and if the value of N is large, the accuracy of the dictionary table obtained through training is higher, but the computational complexity is higher, so in this embodiment, N is equal to 10, I is equal to or greater than 1 and equal to or less than N, and I is equal to or greater than Ii,orgRepresents { Ii,org,Mi,orgI < i > 1 < i < N >, (M)i,orgRepresents { Ii,org,Mi,orgI < 1 > I < N } of the ith fundus image, Ii,orgAnd Mi,orgAre all W wide and are all H high, where the symbol "{ }" is a set representing a symbol.
step ②, for { Ii,org,Mi,orgI is more than or equal to 1 and less than or equal to N, and each fundus image and each real blood vessel segmentation image are subjected to non-overlapping subblock division processing; then, performing combined dictionary training operation on the set formed by all the sub-blocks in the N fundus images and the set formed by all the sub-blocks in the N real blood vessel segmentation images by adopting a K-SVD (singular value decomposition) method to construct and obtain { I }i,org,Mi,orgThe expression dictionary and the segmentation dictionary with |1 ≦ i ≦ N ≦ are correspondingly recorded as DRAnd DS(ii) a Wherein D isRAnd DSThe number of dimensions of (a) is 64 × K, K represents the number of dictionary atoms to be set, and in this embodiment, K is 128.
in this embodiment, the specific process of step ② is:
step 2-1 will { I
i,org,M
i,orgDividing each fundus image and each real blood vessel segmentation image in |1 ≦ i ≦ N }
Sub-blocks with size of 8 × 8 and not overlapped with each other; then will { I
i,org,M
i,orgThe set of subblocks in all fundus images |1 ≦ i ≦ N } is denoted as { x
tL 1 is less than or equal to t is less than or equal to M, and the { I } is
i,org,M
i,orgThe set formed by sub-blocks in all real blood vessel segmentation images in the I1 is less than or equal to the I is less than or equal to the N is recorded as { y ≦ N }
tL 1 is not less than t is not less than M; wherein, the symbol
In order to round the sign of the operation down,
1≤t≤M,x
tis represented by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the t-th sub-block in all fundus images
tFor describing { I
i,org,M
i,orgI is not less than 1 and not more than N, x
tHas a dimension of 64X 1, y
tIs represented by { I
i,org,M
i,orgI is not less than 1 and not more than N), and y is a column vector formed by pixel values of all pixel points in the t-th sub-block in all real blood vessel segmentation images
tFor describing { I
i,org,M
i,orgI is not less than 1 and not more than N, y is not less than N
tHas dimension of 64 x 1.
step 2, solving by adopting a K-SVD method
Satisfies the conditions
The structure is obtained as { I
i,org,M
i,orgRepresentation dictionary D with I1 ≦ i ≦ N ≦
RAnd a segmentation dictionary D
S(ii) a Wherein min () is a minimum function with the symbol "| | | | non-woven phosphor
2"is a 2-norm symbol of the matrix, X ═ X
1…x
t…x
M],Y=[y
1…y
t…y
M]The term "[ 2 ]]"is a vector representing a symbol, and the dimensions of X and Y are 64 XM, X
1Is { x
t1 st column vector, x, |1 ≦ t ≦ M }
1Also denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the 1 st sub-block in all fundus images
1For describing { I
i,org,M
i,org1 st subblock, x in all fundus images |1 ≦ i ≦ N }
tIs { x
tT-th column vector in |1 ≦ t ≦ M |, x
MIs { x
tM-th column vector, x, in |1 ≦ t ≦ M |
MAlso denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and x is a column vector composed of pixel values of all pixel points in the Mth sub-block in all fundus images
MFor describing { I
i,org,M
i,orgI is not less than 1 and not more than N } sub-block M in all fundus images, y
1Is { y
t1 st column vector, y, |1 ≦ t ≦ M }
1Also denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N) in all real blood vessel segmentation images, and y is a column vector formed by pixel values of all pixel points in the 1 st sub-block in all real blood vessel segmentation images
1For describing { I
i,org,M
i,orgI is not less than 1 and not more than N, y is not less than 1 sub-block in all real blood vessel segmentation images
tIs { y
tT-th column vector in |1 ≦ t ≦ M |, y
MIs { y
tM-th column vector in |1 ≦ t ≦ M ≦ y
MAlso denoted by { I
i,org,M
i,orgI is not less than 1 and not more than N), and y is the column vector formed by the pixel values of all pixel points in the Mth sub-block in all real blood vessel segmentation images
MFor describing { I
i,org,M
i,orgI is not less than 1 and not more than N, the Mth sub-block in all the real blood vessel segmentation images,a represents a sparse matrix, and A ═ a
1…a
t…a
M]Dimension of A is KxM, a
1Is the 1 st column vector in A, a
tIs the t-th column vector in A, a
MIs the Mth column vector in A, a
1、a
tAnd a
MThe dimension of (a) is Kx 1, the symbol | | | | | non-conducting phosphor
0"is a sign of 0-norm of the matrix, τ is an error coefficient, and τ is 10 in this embodiment.
recording an eyeground image to be subjected to blood vessel segmentation as { I (x, y) }, wherein (x, y) represents the coordinate position of a pixel point in the { I (x, y) }, x is more than or equal to 1 and less than or equal to W ', y is more than or equal to 1 and less than or equal to H', W 'represents the width of the { I (x, y) }, H' represents the height of the { I (x, y) }, the value of W 'and the value of W can be the same or different, the value of H' and the value of H can be the same or different, and I (x, y) represents the pixel value of the pixel point of which the coordinate position is (x, y) in the { I (x, y) }.
step ④, divide { I (x, y) }into
Sub-blocks with size of 8 × 8 and not overlapped with each other; then, the set of all sub-blocks in { I (x, y) } is recorded as { x }
t',testL 1 is less than or equal to t 'is less than or equal to M'; wherein, the symbol
In order to round the sign of the operation down,
1≤t'≤M',x
t',testrepresents a column vector consisting of pixel values of all pixel points in the t' th sub-block in { I (x, y) }, x
t',testFor describing the t' th sub-block, x, in { I (x, y) }
t',testHas dimension of 64 x 1.
step ⑤, obtaining D according to the structure
ROptimized reconstruction { x
t',test1 | < t '< M' } sparse coefficient matrix of each sub-block, will { x ≦ M }
t',testThe sparse coefficient matrix of the t ' sub-block in |1 ≦ t ' ≦ M ' } is recorded as a
t',test,a
t',testBy solving for min (| | a)
t',test||
0) Get min (| | a)
t',test||
0) Satisfies the conditions
Wherein, a
t',testHas dimension of Kx 1, min () is a minimum function, the symbol "| | | | luminance
0"is a 0-norm symbol of matrix, symbol" | | | | | | luminance
2"is the 2-norm sign of the matrix, T
0For error coefficient, take T in this example
0=6。
step D obtained according to the structureSEstimating a preliminary blood vessel segmentation image of { I (x, y) }, and recording the preliminary blood vessel segmentation image as { Q (x, y) }, and recording a column vector consisting of pixel values of all pixel points in an area with a size of 8 x 8 corresponding to the t' th sub-block in { I (x, y) } in { Q (x, y) }asyt',test,yt',test=DSat',test(ii) a Then calculate the binary mask image of { Q (x, y) }, which is marked as { Q1(x, y) }; wherein, Q (x, y) represents the pixel value of the pixel point with the coordinate position (x, y) in { Q (x, y) }, yt',testHas dimension of 64X 1, Q1(x, y) represents { Q1And the coordinate position in the (x, y) is the pixel value of the pixel point of (x, y).
in the specific example, in the step (sixty),
T
1for binarization of threshold, take T in this example
1=25。
step (c), adopting morphological operation to make enhancement treatment on { I (x, y) } so as to obtain enhanced image of { I (x, y) }, and marking it as { Q (Q) }2(x, y) }; wherein Q is2(x, y) represents { Q2And the coordinate position in the (x, y) is the pixel value of the pixel point of (x, y).
in this embodiment, the specific process of step (c) is as follows:
⑦ _1, adopting morphological operation to perform enhancement processing on the { I (x, y) } to obtain enhancement values of each pixel point in the { I (x, y) } in different scales and different directions, and marking the enhancement values of the pixel points with the coordinate positions (x, y) in the { I (x, y) } in the scales of sigma and the directions of theta as I
θ,σ(x,y),I
θ,σ(x,y)=B
θ,σ(x,y)-T
θ,σ(x,y),
Wherein, the symbol
Representing morphological dilation operation symbols
Representing a morphological erosion operation symbol, S
θ,σRepresenting a linear structuring element with a direction theta and a dimension sigma,
and (c) step (c 2) of combining enhancement values of each pixel point in the { I (x, y) } in different scales and different directions to obtain an enhancement value of each pixel point in the { I (x, y) }, and recording the enhancement value of the pixel point with the coordinate position (x, y) in the { I (x, y) }asQ'
2(x,y),
Then, an enhanced image { Q } of { I (x, y) } is acquired
2(x, y) }, will { Q
2The pixel value of the pixel point with the coordinate position (x, y) in (x, y) is marked as Q
2(x,y),Q
2(x,y)=Q'
2(x, y) wherein the symbol ". sup.u" denotes and operates on a symbol.
step ⑧ according to the { Q
1(x, y) } and { Q
2(x, y) }, calculating a final blood vessel segmentation image of { I (x, y) } and recording the final blood vessel segmentation image as
Will be provided with
The pixel value of the pixel point with the middle coordinate position (x, y) is recorded as
wherein the symbol "∪" denotes and operates a symbol.
To further illustrate the feasibility and effectiveness of the method of the present invention, the method of the present invention was tested.
In this embodiment, the method of the present invention is adopted to test three fundus image databases, namely, DRIVE, STARE, and HRF, where the DRIVE fundus image database includes 40 color fundus images and corresponding expert hand-painted blood vessel label images, the STARE fundus image database includes 20 color fundus images and corresponding expert hand-painted blood vessel label images, and the HRF fundus image database includes 45 color fundus images and corresponding expert hand-painted blood vessel label images. 3 common indexes for evaluating the classification quality, namely Sensitivity, Specificity and Accuracy (Accuracy), are utilized, and if the Sensitivity, Specificity and Accuracy are closer to 100%, the better the correlation between the blood vessel segmentation result of the method and the real blood vessel segmentation result is. Table 1 shows the correlation between the blood vessel segmentation result obtained by the method of the present invention and the real blood vessel segmentation result, and it can be seen from table 1 that the correlation between the blood vessel segmentation result of the fundus image obtained by the method of the present invention and the real blood vessel segmentation result is high enough to illustrate the effectiveness of the method of the present invention.
TABLE 1 correlation between vessel segmentation results obtained using the method of the present invention and real vessel segmentation results
Index (I)
|
DRIVE eyeBase image database
|
STARE fundus image database
|
HRF fundus image database
|
Sensitivity of the reaction
|
0.710
|
0.679
|
0.712
|
Specificity of
|
0.982
|
0.972
|
0.974
|
Accuracy of
|
0.958
|
0.951
|
0.954 |