Method and device for processing eye fundus image, and computer readable storage medium
By performing specific processing of fundus images, including image enhancement and mask matrix operation, the problem of diagnosis delays in patients with retinal detachment in non-professional medical environments is solved, and fast and accurate retinal detachment judgments and preoperative guidance are achieved, reducing vision Risk of damage.
Patent Information
- Application Number
- CN202310923121.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2024-12-20
AI Technical Summary
Due to the lack of professional medical resources and uneven distribution, it is difficult for patients with retinal detachment to get accurate assessment of preoperative guidance and vision prognosis, especially in community hospitals or general hospitals with lower levels. Accurate interpretation of fundus images requires professional training and long-term Time experience leads to delayed diagnosis and treatment of retinal detachment, causing visual damage.
Provide a method for processing fundus images, by extracting the area of interest from the fundus images, obtaining the center line and color information of the target line, performing image enhancement processing and mask matrix operations, clearing the optic disk, blood vessels and background areas, expanding and graying Degree projection determines whether the image is a retinal detachment image, and marks the disengagement position and its impact on the field of view.
It improves the accuracy of automatic judgment of retinal detachment images, reduces the dependence on the experience of professional ophthalmologists, and can quickly and accurately evaluate retinal detachment in non-professional medical environments, promoting early diagnosis and treatment.
Smart Images

Figure CN119169068A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for processing fundus images, and a computer-readable storage medium. Background Art
[0002] Retinal detachment refers to the separation of the neuroepithelial layer and the pigment epithelium layer of the retina. There is a potential gap between the two layers. The fluid retained in the gap after the two separate is called subretinal fluid. The detached part of the retina cannot perceive light stimulation, resulting in incomplete or complete loss of the image seen by the eye.
[0003] Due to the lack and uneven distribution of professional medical resources, the possibility of implementing routine health screening for large-scale populations is low. This may cause delays in diagnosis and treatment for most patients, causing retinal detachment to cause serious damage to patients' vision, especially when retinal detachment progresses to invade the macula, the visual prognosis is relatively poor, causing significant losses to individuals, families, and society. In addition, with regard to preoperative guidance and visual prognosis of retinal detachment, the professionalism of fundus doctors in community hospitals or lower-level general hospitals and physical examination centers is not strong, and they are unable to provide correct guidance to patients with retinal detachment. Although wide-area fundus images can observe almost the entire circumference of the retina, accurate interpretation of fundus images also requires ophthalmologists to undergo professional training and accumulate a long period of experience. Summary of the invention
[0004] The embodiments described herein provide a method, an apparatus, and a computer-readable storage medium storing a computer program for processing a fundus image.
[0005] According to the first aspect of the present disclosure, a method for processing fundus images is provided. The method includes: extracting a region of interest from the fundus image to obtain a first image of the region of interest; obtaining a first mask matrix for identifying the center line of a target line in the first image, wherein the color, contrast, and line width of the target line meet preset conditions; removing the region corresponding to the optic disc and blood vessels and the background region in the first image from the first mask matrix to obtain a second mask matrix, wherein the pixel value of each pixel in the background region is lower than a first threshold; dilating the region corresponding to the center line in the second mask matrix to obtain a third mask matrix; removing the region corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix; and indicating whether the fundus image is a retinal detachment image according to the fourth mask matrix.
[0006] In some embodiments of the present disclosure, obtaining a first mask matrix for identifying a center line of a target line in a first image includes: performing image enhancement processing on the first image to highlight a lesion area (lesion) to obtain a second image, wherein a pixel value of each pixel in the lesion area falls within a first threshold range, and a difference between a pixel value of an edge pixel in the lesion area and a pixel value of an adjacent pixel of the edge pixel is greater than a second threshold, and the edge pixel is located outside the lesion area; extracting the center line of the target line in the second image; and obtaining a first mask matrix for identifying the center line in the second image, wherein elements of the first mask matrix correspond to pixels of the second image, elements in the first mask matrix corresponding to the center line are first elements, and other elements in the first mask matrix are second elements.
[0007] In some embodiments of the present disclosure, extracting the center line of the target line in the second image includes: performing color channel separation on the second image; and extracting the center line of the target line from the separated one or more designated channels.
[0008] In some embodiments of the present disclosure, indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix includes: determining the number of first elements in the fourth mask matrix; and in response to the number of first elements in the fourth mask matrix being greater than a threshold number, indicating that the probability that the fundus image is a retinal detachment image is greater than a first probability threshold.
[0009] In some embodiments of the present disclosure, indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix includes: dilating an area corresponding to a center line in the fourth mask matrix to obtain a fifth mask matrix; extracting blood vessels in a target area corresponding to a first element in the fifth mask matrix in the second image; determining whether the blood vessels in the target area are clear; and in response to the blood vessels in the target area being unclear, indicating that the probability that the fundus image is a retinal detachment image is greater than a second probability threshold.
[0010] In some embodiments of the present disclosure, indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix includes: dilating an area corresponding to a center line in the fourth mask matrix to obtain a fifth mask matrix; performing grayscale projection in a target area in the second image corresponding to a first element in the fifth mask matrix; determining whether there is a grayscale value whose grayscale proportion is greater than a proportion threshold; and in response to the presence of a grayscale value whose grayscale proportion is greater than the proportion threshold, indicating that the probability that the fundus image is a retinal detachment image is greater than a third probability threshold.
[0011] In some embodiments of the present disclosure, indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix includes: dilating an area corresponding to a center line in the fourth mask matrix to obtain a fifth mask matrix; extracting blood vessels in a target area corresponding to a first element in the fifth mask matrix in the second image; determining whether the blood vessels in the target area are clear; performing grayscale projection in the target area; determining whether there are grayscale values whose grayscale proportion is greater than a proportion threshold; and in response to the blood vessels in the target area being unclear and there being grayscale values whose grayscale proportion is greater than the proportion threshold, indicating that the probability that the fundus image is a retinal detachment image is greater than a fourth probability threshold.
[0012] In some embodiments of the present disclosure, the method further includes: calculating the clarity of the fundus image; and in response to the clarity being less than a clarity threshold, indicating that the probability that the fundus image is a retinal detachment image increases.
[0013] In some embodiments of the present disclosure, the method further includes: marking the retinal detachment position in the fundus image according to a fourth mask matrix; and indicating the influence of the retinal detachment position on the visual field.
[0014] In some embodiments of the present disclosure, the color of the target line is grayish white, the contrast of the target line is greater than a contrast threshold, and the line width of the target line is less than a width threshold.
[0015] In some embodiments of the present disclosure, the contrast threshold is 10%.
[0016] In some embodiments of the present disclosure, the width threshold is 100 pixels.
[0017] In a further embodiment of the present disclosure, the width threshold is 50 pixels.
[0018] In a further embodiment of the present disclosure, the width threshold is 20 pixels.
[0019] In some embodiments of the present disclosure, clearing the areas corresponding to the optic disc, blood vessels and background areas in the first image from the first mask matrix to obtain the second mask matrix includes: obtaining a sixth mask matrix for identifying the optic disc, blood vessels and background areas in the first image, the elements of the sixth mask matrix corresponding to the pixels of the first image, the elements in the sixth mask matrix corresponding to the optic disc, blood vessels and background areas are first elements, and the other elements in the sixth mask matrix are second elements; and modifying the first element in the first mask matrix corresponding to the first element in the sixth mask matrix into the second element to obtain the second mask matrix.
[0020] In some embodiments of the present disclosure, clearing the area corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix includes: obtaining a seventh mask matrix for identifying the specified color in the first image, the elements of the seventh mask matrix corresponding to the pixels of the first image, the elements in the seventh mask matrix corresponding to the specified color are first elements, and the other elements in the seventh mask matrix are second elements; and modifying the first element in the third mask matrix corresponding to the first element in the seventh mask matrix into the second element to obtain the fourth mask matrix.
[0021] In some embodiments of the present disclosure, the designated color is a color other than yellow-green.
[0022] In some embodiments of the present disclosure, the radius of dilation of the area corresponding to the center line in the second mask matrix is 10 pixels.
[0023] In some embodiments of the present disclosure, the radius of dilation of the area corresponding to the center line in the fourth mask matrix is 300 pixels.
[0024] According to a second aspect of the present disclosure, a device for processing fundus images is provided. The device includes at least one processor; and at least one memory storing a computer program. When the computer program is executed by at least one processor, the device: extracts a region of interest from the fundus image to obtain a first image of the region of interest; obtains a first mask matrix for identifying the center line of a target line in the first image, and the color, contrast and line width of the target line meet preset conditions; removes the area corresponding to the optic disc and blood vessels and the background area in the first image from the first mask matrix to obtain a second mask matrix, and the pixel value of each pixel in the background area is lower than a first threshold; dilates the area corresponding to the center line in the second mask matrix to obtain a third mask matrix; removes the area corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix; and indicates whether the fundus image is a retinal detachment image according to the fourth mask matrix.
[0025] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device causes the device to obtain a first mask matrix for identifying the center line of a target line in a first image by performing the following operations: performing image enhancement processing on the first image to highlight the lesion area (lesion) to obtain a second image, wherein the pixel value of each pixel in the lesion area falls within a first threshold range, and the difference between the pixel value of an edge pixel in the lesion area and the pixel value of an adjacent pixel of the edge pixel is greater than a second threshold, and the edge pixel is located outside the lesion area; extracting the center line of the target line in the second image; and obtaining a first mask matrix for identifying the center line in the second image, wherein the elements of the first mask matrix correspond to the pixels of the second image, the elements in the first mask matrix corresponding to the center line are first elements, and the other elements in the first mask matrix are second elements.
[0026] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device causes the device to extract the center line of the target line in the second image by performing the following operations: performing color channel separation on the second image; and extracting the center line of the target line from one or more separated specified channels.
[0027] In some embodiments of the present disclosure, the computer program, when executed by at least one processor, causes the device to indicate whether the fundus image is a retinal detachment image according to a fourth mask matrix by performing the following operations: determining the number of first elements in the fourth mask matrix; and in response to the number of first elements in the fourth mask matrix being greater than a threshold number, indicating that the probability of the fundus image being a retinal detachment image is greater than a first probability threshold.
[0028] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device indicates whether the fundus image is a retinal detachment image according to the fourth mask matrix by the following operations: dilating the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix; extracting blood vessels in the target area corresponding to the first element in the fifth mask matrix in the second image; determining whether the blood vessels in the target area are clear; and in response to the blood vessels in the target area being unclear, indicating that the probability of the fundus image being a retinal detachment image is greater than a second probability threshold.
[0029] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device indicates whether the fundus image is a retinal detachment image according to the fourth mask matrix by the following operations: dilating the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix; performing grayscale projection in the target area corresponding to the first element in the fifth mask matrix in the second image; determining whether there is a grayscale value whose grayscale proportion is greater than a proportion threshold; and in response to the presence of a grayscale value whose grayscale proportion is greater than the proportion threshold, indicating that the probability of the fundus image being a retinal detachment image is greater than a third probability threshold.
[0030] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device indicates whether the fundus image is a retinal detachment image according to the fourth mask matrix by the following operations: dilating the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix; extracting blood vessels in the target area corresponding to the first element in the fifth mask matrix in the second image; determining whether the blood vessels in the target area are clear; performing grayscale projection in the target area; determining whether there are grayscale values whose grayscale proportion is greater than a proportion threshold; and in response to the blood vessels in the target area being unclear and there are grayscale values whose grayscale proportion is greater than the proportion threshold, indicating that the probability of the fundus image being a retinal detachment image is greater than a fourth probability threshold.
[0031] In some embodiments of the present disclosure, the computer program, when executed by at least one processor, causes the apparatus to further: calculate clarity of the fundus image; and in response to the clarity being less than a clarity threshold, indicate an increased probability that the fundus image is a retinal detachment image.
[0032] In some embodiments of the present disclosure, the computer program, when executed by at least one processor, causes the apparatus to further: mark the retinal detachment position in the fundus image according to the fourth mask matrix; and indicate the impact of the retinal detachment position on the visual field.
[0033] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device clears the areas corresponding to the optic disc, blood vessels, and background areas in the first image from the first mask matrix by performing the following operations to obtain a second mask matrix: obtaining a sixth mask matrix for identifying the optic disc, blood vessels, and background areas in the first image, the elements of the sixth mask matrix corresponding to the pixels of the first image, the elements in the sixth mask matrix corresponding to the optic disc, blood vessels, and background areas are first elements, and the other elements in the sixth mask matrix are second elements; and modifying the first element in the first mask matrix corresponding to the first element in the sixth mask matrix into the second element to obtain the second mask matrix.
[0034] In some embodiments of the present disclosure, when the computer program is executed by at least one processor, the device causes the device to clear the area corresponding to the specified color in the first image from the third mask matrix through the following operations to obtain a fourth mask matrix: obtain a seventh mask matrix for identifying the specified color in the first image, the elements of the seventh mask matrix correspond to the pixels of the first image, the elements in the seventh mask matrix corresponding to the specified color are first elements, and the other elements in the seventh mask matrix are second elements; and modify the first element in the third mask matrix corresponding to the first element in the seventh mask matrix to the second element to obtain the fourth mask matrix.
[0035] According to a third aspect of the present disclosure, a computer-readable storage medium storing a computer program is provided, wherein the computer program implements the steps of the method according to the first aspect of the present disclosure when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0037] Figure 1 is an exemplary flow chart of a method for processing a fundus image according to an embodiment of the present disclosure;
[0038] Figure 2 is an exemplary fundus image in the setting of retinal detachment;
[0039] Figure 3 is Figure 1 An exemplary flow chart of a process of indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix in the illustrated embodiment;
[0040] Figure 4 is Figure 1 Another exemplary flow chart of the process of indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix in the illustrated embodiment;
[0041] Figure 5 is Figure 1 Another exemplary flow chart of a process of indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix in the illustrated embodiment;
[0042] Figure 6 is Figure 1 Still another exemplary flow chart of a process of indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix in the illustrated embodiment; and
[0043] Figure 7is a schematic block diagram of an apparatus for processing a fundus image according to an embodiment of the present disclosure.
[0044] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0046] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meanings in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. In addition, terms such as "first" and "second" are only used to distinguish one component (or a portion of a component) from another component (or another portion of a component).
[0047] Figure 1 An exemplary flow chart of a method 100 for processing a fundus image according to an embodiment of the present disclosure is shown. The method 100 for processing a fundus image according to an embodiment of the present disclosure can be used to indicate whether the fundus image is a retinal detachment image. Retinal detachment can also be referred to as retinal detachment, which is mainly manifested as vitreous opacity, and gray-white bulge-like changes will appear in the detachment area. Retinal detachment refers to the separation of the neuroepithelium from the pigment epithelium, mainly due to degeneration of the retina and vitreous. Eyes with retinal detachment are generally not congested, and are manifested as varying degrees of vitreous opacity. The range of detachment can range from localized to complete detachment. The retina in the detached area loses transparency, is slightly grayish white, bulges, and has an undulating surface. The retinal blood vessels become tortuous, and retinal holes can be found around most blood vessels. Since the detached area loses transparency, the choroid area under the retina cannot be seen clearly, so the background area of the detached area is blurred, but the blood vessels can be seen. In this context, the background area is determined by the pixel value of the pixel point (also referred to as "pixel") in the fundus image. The pixel value of each pixel in the background area is lower than the first threshold. The first threshold can be an empirical value.
[0048] In an embodiment of the present disclosure, the fundus image may include: a fundus color photograph acquired by a fundus camera, an optical coherence tomography (OCT) image, and a fluorescein fundus angiography (FFA) image, wherein the fundus color photograph may include a true color image, a pseudo-color fundus image, and a laser confocal fundus image. This article uses the fundus color photograph as an example for description, but those skilled in the art should understand that the method 100 for processing a fundus image according to an embodiment of the present disclosure is applicable to any fundus image. Figure 2 An example of a retinal detachment image is shown. Figure 2 In the example, the fundus image is taken at a 45° field of view. However, the embodiments of the present disclosure do not limit the shooting angle, and the embodiments of the present disclosure are applicable to fundus images at any angle, such as a fundus image with a 60° field of view, and a wide-angle image (200°).
[0049] exist Figure 1 In the method 100, at block S102, a region of interest is extracted from the fundus image to obtain a first image of the region of interest. The first image is an image including the region of interest. The region of interest is at least a portion of the fundus image, which can be obtained from the fundus image by cropping. In one example, the region of interest can be Figure 2 The circular area shown. The region of interest includes the basic structures of the fundus: for example, blood vessels (arteries and veins), optic disc, optic cup, macula, etc.
[0050] At frame S104, a first mask matrix for identifying the center line of the target line in the first image is obtained. The color, contrast and line width of the target line meet the preset conditions. In some embodiments of the present disclosure, the preset conditions may include: the color of the target line is grayish white, the contrast of the target line is greater than the contrast threshold, and the line width of the target line is less than the width threshold. In some embodiments of the present disclosure, the line_gauss algorithm can be used to extract the target line. In one example, the contrast threshold is 10%. In one example, the width threshold is 100 pixels. In a further example, the width threshold is 50 pixels. In a further example, the width threshold is 20 pixels. The specific value of the width threshold can be set according to the resolution of the fundus image.
[0051] In some embodiments of the present disclosure, in the process of acquiring the first mask matrix, the first image may be subjected to image enhancement processing (for example, histogram equalization) to highlight the lesion area, thereby obtaining a second image. The pixel value of each pixel in the lesion area belongs to the first threshold range, and the difference between the pixel value of the edge pixel of the lesion area and the pixel value of the adjacent pixel of the edge pixel is greater than the second threshold. In this article, the edge pixel refers to the pixel located on the outline of the lesion area. The adjacent pixel of the edge pixel refers to the pixel point within one pixel interval from the edge pixel, and the pixel point is located outside the lesion area. It should be noted that the difference between the pixel value of the edge pixel and any adjacent pixel is greater than the second threshold. The first threshold range and the second threshold can be empirical values. In some embodiments of the present disclosure, the lesion area is, for example, grayish white and is raised relative to its surrounding area. Therefore, such lesion areas can generally be referred to as grayish white ridges. Figure 2 FIG. 2 exemplarily shows a portion of gray-white protrusions 21 whose line width is less than the width threshold and a portion of gray-white protrusions 22 whose line width is greater than the width threshold.
[0052] After performing image enhancement processing (for example, histogram equalization), the center line of the target line is extracted from the second image. In some embodiments of the present disclosure, the second image may be first separated by color channels. The second image may be separated in one of the following ways: for example, RGB color channel, CMY / CMYK color space, HSV channel, HLS channel, Lab color space, LUV color space. Then, the center line of the target line is extracted from one or more separated specified channels. In the example where the second image is separated into three RGB color channels, the specified channel may be the green channel (G channel). The method of extracting the center line of a line from an image in the prior art may be used to extract the center line of the target line, which will not be described in detail herein. Figure 2 In the example shown in FIG. 2 , the target line is a gray-white protrusion 21 that meets the preset conditions.
[0053] After extracting the center line of the target line from the second image, obtain a first mask matrix for identifying the center line of the target line in the second image. The elements of the first mask matrix correspond to the pixels of the second image. For example, in the case where the second image includes 1080×1920 pixels, the first mask matrix can be a 1080×1920 matrix. The element corresponding to the center line of the target line in the first mask matrix is the first element. The other elements in the first mask matrix are the second elements. In one example, the value of the first element can be True or 1, and the value of the second element can be False or 0. In another example, the value of the first element can be False or 0, and the value of the second element can be True or 1.
[0054] At block S106, the regions corresponding to the optic disc, blood vessels, and background regions in the first image are removed from the first mask matrix to obtain a second mask matrix. In some embodiments of the present disclosure, a sixth mask matrix for identifying the optic disc, blood vessels, and background regions in the first image may be obtained. The elements of the sixth mask matrix correspond to the pixels of the first image. For example, in the case where the first image includes 1080×1920 pixels, the sixth mask matrix may be a 1080×1920 matrix. The elements corresponding to the optic disc, blood vessels, and background regions in the sixth mask matrix are first elements. The other elements in the sixth mask matrix are second elements. Then, the first element in the first mask matrix corresponding to the first element in the sixth mask matrix is modified to the second element to obtain the second mask matrix. In one example, the sixth mask matrix may be traversed, and when it is determined that the element at a certain position of the sixth mask matrix is the first element, the element at the position in the first mask matrix is modified to the second element. In this way, the first mask matrix may be modified to the second mask matrix. In the second mask matrix, elements in the region corresponding to the optic disc and blood vessels and the background region in the first image are all second elements.
[0055] At block S108, the area corresponding to the center line in the second mask matrix is expanded to obtain a third mask matrix. In some embodiments of the present disclosure, the radius of the expansion of the area corresponding to the center line in the second mask matrix is 10 pixels. The radius value can also be adjusted according to the resolution of the fundus image. The image expansion method in the prior art can be used to expand the area corresponding to the center line in the second mask matrix, which is not described in detail herein.
[0056] At block S110, the area corresponding to the specified color in the first image is cleared from the third mask matrix to obtain a fourth mask matrix. In some embodiments of the present disclosure, the specified color is a color other than yellow-green. That is, the fourth mask matrix retains the elements corresponding to the yellow-green color in the third mask matrix.
[0057] In some embodiments of the present disclosure, a seventh mask matrix for identifying a specified color in a first image may be obtained. The elements of the seventh mask matrix correspond to the pixels of the first image. In the case where the first image includes 1080×1920 pixels, the seventh mask matrix may be a 1080×1920 matrix. The element corresponding to the specified color in the seventh mask matrix is the first element. The other elements in the seventh mask matrix are the second elements. Then, the first element corresponding to the first element in the seventh mask matrix in the third mask matrix is modified to the second element to obtain a fourth mask matrix. In one example, the seventh mask matrix may be traversed, and when it is determined that the element at a certain position of the seventh mask matrix is the first element, the element at the position in the third mask matrix is modified to the second element. In this way, the third mask matrix may be modified to a fourth mask matrix. In the fourth mask matrix, the elements in the area corresponding to the specified color are all second elements.
[0058] At block S112 , whether the fundus image is a retinal detachment image is indicated according to the fourth mask matrix. Figures 3 to 6 An exemplary flowchart of a process of indicating whether a fundus image is a retinal detachment image according to a fourth mask matrix is shown.
[0059] exist Figure 3 In the example, at box S302, the number of first elements in the fourth mask matrix is determined. At box S304, it is determined whether the number of first elements in the fourth mask matrix is greater than a threshold number. If it is determined that the number of first elements in the fourth mask matrix is greater than the threshold number ("yes" at box S304), the probability of indicating that the fundus image is a retinal detachment image is greater than the first probability threshold at box S306. The manner of indicating that the probability of the fundus image being a retinal detachment image is greater than the first probability threshold includes: directly displaying "the probability that the fundus image is a retinal detachment image is greater than the first probability threshold". If it is determined that the number of first elements in the fourth mask matrix is less than or equal to the threshold number ("no" at box S304), the probability of indicating that the fundus image is a retinal detachment image is less than the first probability threshold at box S308. In some embodiments of the present disclosure, the threshold number may be 0. The first probability threshold may be an empirical value.
[0060] exist Figure 3 In the example, whether the retina is detached is preliminarily determined by judging whether there is a lesion area (eg, a grayish-white raised area) in the yellow-green area of the fundus image.
[0061] The embodiments of the present disclosure also provide a method for more precisely determining whether the retina is detached.
[0062] exist Figure 4In the example of, at box S402, the area corresponding to the center line in the fourth mask matrix is expanded to obtain the fifth mask matrix. Since the area corresponding to the center line has been expanded once at box S108, the expansion of the area corresponding to the center line in the fourth mask matrix can refer to the expansion of the area where the first element in the fourth mask matrix is located. In some embodiments of the present disclosure, the radius of the expansion of the area corresponding to the center line in the fourth mask matrix is 300 pixels. The radius value can also be adjusted according to the resolution of the fundus image. The image expansion method in the prior art can be used to expand the area corresponding to the center line in the fourth mask matrix, which is not repeated herein.
[0063] In block S404, blood vessels are extracted in the target area corresponding to the first element in the fifth mask matrix in the second image. The operation in block S404 can be performed using a method for extracting blood vessels from fundus images in the prior art, which will not be described in detail herein.
[0064] At box S406, determine whether the blood vessels in the target area are clear. If the blood vessels in the target area are not clear ("No" at box S406), then at box S408, indicate that the probability of the fundus image being a retinal detachment image is greater than the second probability threshold. The manner in which the probability of indicating that the fundus image is a retinal detachment image is greater than the second probability threshold includes: directly displaying "the probability that the fundus image is a retinal detachment image is greater than the second probability threshold". If the blood vessels in the target area are clear ("Yes" at box S406), then at box S410, indicate that the probability of the fundus image being a retinal detachment image is less than the second probability threshold. The operation at box S406 can be performed using the method of determining whether an image is clear in the prior art, which is not described in detail herein. In some embodiments of the present disclosure, the second probability threshold is greater than the first probability threshold. The second probability threshold may be an empirical value.
[0065] exist Figure 5 In the example of FIG. 5 , in block S502 , the area corresponding to the center line in the fourth mask matrix is expanded to obtain a fifth mask matrix. The operation in block S502 is the same as the operation in block S402 , and will not be described in detail herein.
[0066] At block S504, grayscale projection is performed in the target area corresponding to the first element in the fifth mask matrix in the second image. Grayscale projection can be used to count the grayscale proportion of each grayscale value in all grayscale values.
[0067] At box S506, determine whether there is a grayscale value whose grayscale proportion is greater than the proportion threshold. In some embodiments of the present disclosure, the proportion threshold is, for example, 50%. If it is determined that there is a grayscale value whose grayscale proportion is greater than the proportion threshold ("Yes" at box S506), then at box S508, indicate that the probability of the fundus image being a retinal detachment image is greater than the third probability threshold. The manner in which the probability of indicating that the fundus image is a retinal detachment image is greater than the third probability threshold includes: directly displaying "the probability that the fundus image is a retinal detachment image is greater than the third probability threshold". If it is determined that there is no grayscale value whose grayscale proportion is greater than the proportion threshold ("No" at box S506), then at box S510, indicate that the probability of the fundus image being a retinal detachment image is less than the third probability threshold. In some embodiments of the present disclosure, the third probability threshold is greater than the first probability threshold. The third probability threshold may be greater than the second probability threshold, may be equal to the second probability threshold, or may be less than the second probability threshold. The third probability threshold may be an empirical value.
[0068] Figure 4 and Figure 5 The method shown in Figure 3 Further judging whether the retina is detached based on the method shown can improve the accuracy of the judgment.
[0069] In some embodiments of the present disclosure, Figure 4 and Figure 5 The manner shown indicates whether the fundus image is a retinal detachment image to further improve the accuracy of the judgment. Figure 6 An exemplary flow chart of the process is shown in FIG. Figure 6 In the example of FIG. 5 , in block S602 , the area corresponding to the center line in the fourth mask matrix is expanded to obtain a fifth mask matrix. The operation in block S602 is the same as the operation in block S402 , and will not be described in detail herein.
[0070] At block S604, blood vessels are extracted in the target region corresponding to the first element in the fifth mask matrix in the second image. The operation at block S604 is the same as the operation at block S404, and will not be described in detail herein.
[0071] At block S608, it is determined whether the blood vessels in the target area are clear. The operation at block S608 is the same as the operation at block S406, and will not be described in detail herein.
[0072] At block S606, grayscale projection is performed in the target area. The operation at block S606 is the same as the operation at block S504, and will not be described in detail herein.
[0073] In block S610, it is determined whether there is a gray value whose gray value ratio is greater than the ratio threshold. The operation in block S610 is the same as the operation in block S506, and will not be described in detail herein.
[0074] The operation performed at block S604 may be performed in parallel with the operation performed at block S606, or may be performed sequentially. The operation performed at block S604 may be performed in parallel with the operation performed at block S610, or may be performed sequentially. Similarly, the operation performed at block S608 may be performed in parallel with the operation performed at block S606, or may be performed sequentially. The operation performed at block S608 may be performed in parallel with the operation performed at block S610, or may be performed sequentially.
[0075] If the blood vessels in the target area are not clear and there is a gray value whose gray value ratio is greater than the ratio threshold ("No" at box S608 and "Yes" at box S610), the probability of indicating that the fundus image is a retinal detachment image is greater than the fourth probability threshold at box S612. If the blood vessels in the target area are clear or there is no gray value whose gray value ratio is greater than the ratio threshold ("Yes" at box S608 or "No" at box S610), the probability of indicating that the fundus image is a retinal detachment image is less than the fourth probability threshold at box S614. In some embodiments of the present disclosure, the fourth probability threshold is greater than the first probability threshold, the second probability threshold, and the third probability threshold. The fourth probability threshold may be an empirical value.
[0076] In a further embodiment of the present disclosure, the method 100 for processing a fundus image according to an embodiment of the present disclosure also calculates the clarity of the fundus image. The clarity of the fundus image can be calculated using the method of calculating image clarity in the prior art, which will not be described in detail herein. If the clarity is less than the clarity threshold, the probability that the fundus image is a retinal detachment image increases. For example, if the probability that the fundus image is a retinal detachment image is greater than the fourth probability threshold at box S612, and the clarity of the fundus image is less than the clarity threshold, then the user is ultimately displayed with "the probability that the fundus image is a retinal detachment image is greater than the fourth probability threshold + Δ". Assuming that the fourth probability threshold is 90% and Δ is 5%, the user is ultimately displayed with "the probability that the fundus image is a retinal detachment image is greater than 95%".
[0077] In a further embodiment of the present disclosure, the method 100 for processing fundus images according to the embodiment of the present disclosure further marks the retinal detachment position (retinal detachment lesion position) in the fundus image according to the fourth mask matrix to instruct doctors and patients to focus on the retinal detachment lesion. Figure 3 When using the example of to determine whether the retina is detached, the position in the fundus image corresponding to the first element in the fourth mask matrix can be directly marked as the retinal detachment position. Figure 4When using the example of retinal detachment to determine whether the retina is detached, the position of the unclear blood vessels in the fundus image corresponding to the target area can be marked as the retinal detachment position. Figure 5 When using the example of retinal detachment, the position corresponding to the target gray value (the gray value with a gray value ratio greater than the gray value ratio threshold) in the fundus image can be marked as the retinal detachment position. Figure 6 When judging whether the retina is detached, the corresponding Figure 4 and Figure 5 The intersection of the annotated retinal detachment locations is annotated as the retinal detachment location.
[0078] The method 100 for processing fundus images according to an embodiment of the present disclosure also indicates the influence of the retinal detachment position on the visual field. For example, if the retinal detachment position is located at the lower left of the eye, it indicates that the visual field at the upper right will be affected. If the retinal detachment position is located at the lower right of the eye, it indicates that the visual field at the upper left will be affected. The closer the retinal detachment lesion position is to the center of the macula, the greater the degree of influence on the visual acuity and the visual field.
[0079] Figure 7 FIG. 7 is a schematic block diagram of an apparatus 700 for processing a fundus image according to an embodiment of the present disclosure. Figure 7 As shown, the device 700 may include a processor 710 and a memory 720 storing a computer program. When the computer program is executed by the processor 710, the device 700 may perform the following operations: Figure 1 The steps of the method 100 shown. In one example, the device 700 may be a computer device or a cloud computing node. The device 700 may extract a region of interest from a fundus image to obtain a first image of the region of interest. The device 700 may obtain a first mask matrix for identifying the center line of a target line in the first image. The color, contrast, and line width of the target line meet preset conditions. The device 700 may remove the area corresponding to the optic disc and blood vessels and the background area in the first image from the first mask matrix to obtain a second mask matrix. The device 700 may dilate the area corresponding to the center line in the second mask matrix to obtain a third mask matrix. The device 700 may remove the area corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix. The device 700 may indicate whether the fundus image is a retinal detachment image based on the fourth mask matrix.
[0080] In some embodiments of the present disclosure, the device 700 may perform image enhancement processing on the first image to highlight the lesion area, thereby obtaining a second image. The device 700 may extract the center line of the target line in the second image. The device 700 may obtain a first mask matrix for identifying the center line in the second image. The elements of the first mask matrix correspond to the pixels of the second image. The element corresponding to the center line in the first mask matrix is the first element. The other elements in the first mask matrix are the second elements.
[0081] In some embodiments of the present disclosure, the device 700 may perform color channel separation on the second image and extract the center line of the target line from the separated one or more designated channels.
[0082] In some embodiments of the present disclosure, the device 700 may determine the number of first elements in the fourth mask matrix. In response to the number of first elements in the fourth mask matrix being greater than a threshold number, the device 700 may indicate that the probability that the fundus image is a retinal detachment image is greater than a first probability threshold.
[0083] In some embodiments of the present disclosure, the device 700 may dilate the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix. The device 700 may extract blood vessels in the target area corresponding to the first element in the fifth mask matrix in the second image. The device 700 may determine whether the blood vessels in the target area are clear. In response to the blood vessels in the target area being unclear, the device 700 may indicate that the probability that the fundus image is a retinal detachment image is greater than a second probability threshold.
[0084] In some embodiments of the present disclosure, the device 700 may dilate the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix. The device 700 may perform grayscale projection in the target area corresponding to the first element in the fifth mask matrix in the second image. The device 700 may determine whether there is a grayscale value whose grayscale proportion is greater than a proportion threshold. In response to the presence of a grayscale value whose grayscale proportion is greater than the proportion threshold, the device 700 may indicate that the probability that the fundus image is a retinal detachment image is greater than a third probability threshold.
[0085] In some embodiments of the present disclosure, the device 700 may dilate the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix. The device 700 may extract blood vessels in the target area corresponding to the first element in the fifth mask matrix in the second image. The device 700 may determine whether the blood vessels in the target area are clear. The device 700 may perform grayscale projection in the target area. The device 700 may determine whether there is a grayscale value whose grayscale ratio is greater than a ratio threshold. In response to the blood vessels in the target area being unclear and the grayscale value whose grayscale ratio is greater than the ratio threshold, the device 700 may indicate that the probability that the fundus image is a retinal detachment image is greater than a fourth probability threshold.
[0086] In some embodiments of the present disclosure, the device 700 may calculate the clarity of the fundus image. In response to the clarity being less than a clarity threshold, the device 700 may indicate that the probability that the fundus image is a retinal detachment image has increased.
[0087] In some embodiments of the present disclosure, the device 700 may mark the retinal detachment position in the fundus image according to the fourth mask matrix. The device 700 may indicate the influence of the retinal detachment position on the visual field.
[0088] In some embodiments of the present disclosure, the device 700 may obtain a sixth mask matrix for identifying the optic disc, blood vessels, and background area in the first image. The elements of the sixth mask matrix correspond to the pixels of the first image. The elements corresponding to the optic disc, blood vessels, and background area in the sixth mask matrix are first elements. The other elements in the sixth mask matrix are second elements. The device 700 may modify the first element in the first mask matrix corresponding to the first element in the sixth mask matrix into the second element to obtain the second mask matrix.
[0089] In some embodiments of the present disclosure, the device 700 may obtain a seventh mask matrix for identifying a specified color in the first image. The elements of the seventh mask matrix correspond to pixels of the first image. The element corresponding to the specified color in the seventh mask matrix is a first element. The other elements in the seventh mask matrix are second elements. The device 700 may modify the first element in the third mask matrix corresponding to the first element in the seventh mask matrix into the second element to obtain a fourth mask matrix.
[0090] In an embodiment of the present disclosure, the processor 710 may be, for example, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a processor based on a multi-core processor architecture, etc. The memory 720 may be any type of memory implemented using data storage technology, including but not limited to random access memory, read-only memory, semiconductor-based memory, flash memory, disk storage, etc.
[0091] In addition, in the embodiments of the present disclosure, the apparatus 700 may also include an input device 730, such as a keyboard, a mouse, etc., for inputting the fundus image. In addition, the apparatus 700 may also include an output device 740, such as a display, etc., for outputting an indication of whether the fundus image is a retinal detachment image, a retinal detachment position, and an indication of the effect of the retinal detachment position on the visual field.
[0092] In other embodiments of the present disclosure, a computer-readable storage medium storing a computer program is further provided, wherein the computer program can achieve the following when executed by a processor: Figure 1 and Figures 3 to 6 The steps of the method are shown.
[0093] In summary, the method and device for processing fundus images according to the embodiments of the present disclosure can utilize visual computing technology (obtaining the characteristics of fundus images based on the bionic mechanism of human vision) to indicate whether the fundus image is a retinal detachment image, laying the foundation for the subsequent refined and quantitative analysis of fundus abnormalities, facilitating the quantitative evaluation of fundus characteristics, improving the accuracy of fundus abnormality judgment, and providing a scientific basis for subsequent retinal detachment judgment.
[0094] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device and method according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, a program segment or an instruction, and a part of the module, a program segment or an instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0095] Unless the context clearly indicates otherwise, the singular form of the words used herein and in the appended claims includes the plural and vice versa. Thus, when referring to the singular, the plural form of the corresponding term is generally included. Similarly, the words "comprise" and "include" are to be interpreted as inclusive rather than exclusive. Likewise, the terms "include" and "or" should be interpreted as inclusive unless such interpretation is expressly prohibited herein. Where the term "example" is used herein, particularly when it is located after a group of terms, the "example" is merely exemplary and illustrative and should not be considered exclusive or comprehensive.
[0096] Further aspects and scopes of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for purposes of illustration only and are not intended to limit the scope of the present application.
[0097] Several embodiments of the present disclosure are described in detail above, but it is obvious that those skilled in the art can make various modifications and variations to the embodiments of the present disclosure without departing from the spirit and scope of the present disclosure. The protection scope of the present disclosure is defined by the attached claims.
Claims
1. A method for processing fundus images, include: Extracting a region of interest from the fundus image to obtain a first image of the region of interest; Acquire a first mask matrix for identifying a center line of a target line in the first image, wherein the color, contrast and line width of the target line meet preset conditions; clearing the regions corresponding to the optic disc and blood vessels and the background region in the first image from the first mask matrix to obtain a second mask matrix; dilating the area corresponding to the center line in the second mask matrix to obtain a third mask matrix; clearing the area corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix; as well as Whether the fundus image is a retinal detachment image is indicated according to the fourth mask matrix.
2. The method according to claim 1, in, Acquiring a first mask matrix for identifying a center line of a target line in the first image includes: Performing image enhancement processing on the first image to highlight the lesion area, thereby obtaining a second image; Extracting the center line of the target line in the second image; and A first mask matrix for identifying the center line in the second image is obtained, wherein elements of the first mask matrix correspond to pixels of the second image, elements in the first mask matrix corresponding to the center line are first elements, and other elements in the first mask matrix are second elements.
3. The method according to claim 2, in, Indicating whether the fundus image is a retinal detachment image according to the fourth mask matrix includes: determining the number of the first elements in the fourth mask matrix; and In response to the number of the first elements in the fourth mask matrix being greater than a threshold number, indicating that the probability that the fundus image is a retinal detachment image is greater than a first probability threshold; or Indicating whether the fundus image is a retinal detachment image according to the fourth mask matrix includes: dilating a region in the fourth mask matrix corresponding to the center line to obtain a fifth mask matrix; extracting a blood vessel in a target area corresponding to the first element in the fifth mask matrix in the second image; determining whether blood vessels in the target area are clear; and In response to unclear blood vessels in the target area, indicating that the probability of the fundus image being a retinal detachment image is greater than a second probability threshold; or Indicating whether the fundus image is a retinal detachment image according to the fourth mask matrix includes: dilating a region in the fourth mask matrix corresponding to the center line to obtain a fifth mask matrix; performing grayscale projection in a target area in the second image corresponding to the first element in the fifth mask matrix; Determine whether there is a grayscale value whose grayscale proportion is greater than a proportion threshold; and In response to the presence of a grayscale value having a grayscale proportion greater than the proportion threshold, it is indicated that the probability that the fundus image is a retinal detachment image is greater than a third probability threshold.
4. The method according to claim 2, in, Indicating whether the fundus image is a retinal detachment image according to the fourth mask matrix includes: dilating the area corresponding to the center line in the fourth mask matrix to obtain a fifth mask matrix; extracting a blood vessel in a target area corresponding to the first element in the fifth mask matrix in the second image; determining whether blood vessels in the target area are clear; Performing grayscale projection within the target area; Determine whether there is a grayscale value whose grayscale proportion is greater than a proportion threshold; and In response to the fact that the blood vessels in the target area are unclear and there is a grayscale value whose grayscale proportion is greater than the proportion threshold, it is indicated that the probability that the fundus image is a retinal detachment image is greater than a fourth probability threshold.
5. The method according to claim 3 or 4, further comprising: include: Calculating the clarity of the fundus image; as well as In response to the clarity being less than a clarity threshold, it is indicated that the probability of the fundus image being a retinal detachment image increases.
6. The method according to any one of claims 1 to 4, further comprising: include: marking a retinal detachment position in the fundus image according to the fourth mask matrix; as well as Indicate the effect of the location of retinal detachment on the visual field.
7. The method according to any one of claims 2 to 4, in, Clearing the area corresponding to the optic disc and blood vessels and the background area in the first image from the first mask matrix to obtain a second mask matrix comprises: Acquire a sixth mask matrix for identifying the optic disc, the blood vessels, and the background area in the first image, wherein elements of the sixth mask matrix correspond to pixels of the first image, elements in the sixth mask matrix corresponding to the optic disc, the blood vessels, and the background area are the first elements, and other elements in the sixth mask matrix are the second elements; and The first element in the first mask matrix corresponding to the first element in the sixth mask matrix is modified into the second element to obtain the second mask matrix.
8. The method according to any one of claims 2 to 4, in, Clearing the area corresponding to the specified color in the first image from the third mask matrix to obtain a fourth mask matrix includes: Obtaining a seventh mask matrix for identifying the designated color in the first image, wherein elements of the seventh mask matrix correspond to pixels of the first image, elements in the seventh mask matrix corresponding to the designated color are the first elements, and other elements in the seventh mask matrix are the second elements; and The first element in the third mask matrix corresponding to the first element in the seventh mask matrix is modified into the second element to obtain the fourth mask matrix.
9. A device for processing fundus images, include: at least one processor; as well as at least one memory storing a computer program; Wherein, when the computer program is executed by the at least one processor, the device is caused to perform the steps of the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, in, The computer program implements the steps of the method according to any one of claims 1 to 8 when executed by a processor.
