Fundus image enhancement method and system for mobile device
By analyzing the neighborhood distribution and positional relationship of each pixel value category in the fundus image, a global enhancement vector is constructed, which solves the problem of image quality reduction and detailed information loss caused by the fundus image enhancement algorithm in the prior art, and achieves a uniform and high-quality image enhancement effect.
Patent Information
- Application Number
- CN202210888252.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-07-27
AI Technical Summary
When the prior art enhances the fundus image, it is susceptible to external environments such as light sources, resulting in a decline in image quality. The existing blur enhancement algorithm will cause compression of information near low pixels and cannot effectively retain detailed information.
By analyzing the distribution information within the neighborhood range of each pixel value category, calculating the first and second contrast tendency coefficients, building a global enhancement vector, combining the positional relationship of the pixel value category, obtaining the enhancement value of each pixel value category, and achieving uniform enhancement.
It effectively improves the quality of fundus images, avoids the lack of detailed information, and ensures uniform enhancement effect and improved image quality.
Smart Images

Figure CN115205153B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ophthalmology and medical image processing technology, and in particular to a fundus image enhancement method and system for mobile devices. Background Art
[0002] In modern medicine, medical imaging technology has greatly improved doctors' diagnostic efficiency. Doctors can identify lesions by observing the medical imaging features of a patient's body. Fundus images are particularly important for diagnosing complications of diabetes and hypertension, such as diabetic retinopathy, diabetic macular edema, and retinal arteriosclerosis. Doctors can use color features in fundus images to diagnose related diseases and guide treatment.
[0003] Computer vision is widely used in medical image feature extraction. Image features can quickly identify abnormalities and assist doctors in diagnosing conditions. However, fundus images contain numerous details and are easily affected by external factors such as light sources, resulting in reduced image quality and difficulty in feature extraction. Existing technologies typically enhance fundus images using algorithms such as fuzzy enhancement. However, this results in compression of information near low-resolution pixels in the image, destroying detailed information and failing to achieve effective image enhancement. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of the present invention is to provide a fundus image enhancement method and system for mobile devices. The technical solutions adopted are as follows:
[0005] The present invention proposes a fundus image enhancement method for a mobile device, the method comprising:
[0006] Acquire a fundus image of the patient using a mobile device; obtain multiple pixel value categories based on the pixel value of each pixel point in the fundus image; and obtain a first contrast tendency coefficient between the target pixel value category and the other pixel value categories based on the number of pixels of the target pixel value category within a preset neighborhood range;
[0007] Sort the pixel value categories from small to large to obtain a pixel value category sequence; obtain a contrast tendency distance between adjacent pixel value categories in the pixel value category sequence based on the first contrast tendency coefficient between the target pixel value category and each pixel value category, wherein the contrast tendency distance constitutes an enhancement vector for the target pixel value category;
[0008] Obtaining second contrast tendency coefficients of the other pixel value categories relative to the target pixel value category, and obtaining a contrast attention weight of the target pixel value category based on all of the second contrast tendency coefficients; and obtaining a global enhancement vector based on the enhancement vector and the contrast attention weight of each pixel value category;
[0009] According to the first position of the target pixel value category in the pixel value category sequence, the corresponding second position in the global enhancement vector is obtained, and the enhancement coefficient is obtained according to the element value of the global enhancement vector and the accumulated value of the elements before the second position; according to the enhancement coefficient, the enhancement value of the target pixel value category is obtained; the enhancement value of each pixel value category is obtained to obtain an enhanced fundus image.
[0010] Furthermore, obtaining a plurality of pixel value categories according to the pixel value of each pixel point in the fundus image includes:
[0011] The maximum pixel value and the minimum pixel value in the fundus image are obtained, and the pixel value of each pixel in the fundus image is normalized according to the maximum and minimum value normalization method to obtain the grayscale transformation value of each pixel; and the pixels with the same grayscale transformation value are regarded as a class of the pixel value category.
[0012] Furthermore, obtaining a first contrast tendency coefficient between the target pixel value category and the other pixel value categories based on the number of pixel points of the target pixel value category within a preset neighborhood range includes:
[0013] Obtain the number of pixel points of the other pixel value categories within the neighborhood range for all pixel points in the target pixel value category; and use the ratio of the number of pixel points of each of the other pixel value categories to the cumulative value of the number of pixel points of the other pixel value categories as the first contrast tendency coefficient between the target pixel value category and each of the other pixel value categories.
[0014] Furthermore, obtaining the first comparison tendency coefficient between the target pixel value category and the other pixel value categories includes:
[0015] Obtain a first contrast tendency coefficient between all the pixel value categories; construct a contrast tendency coefficient matrix based on the first contrast tendency coefficient between all the pixel value categories; the number of rows and columns of the contrast tendency coefficient matrix are both the number of the pixel value categories; the element at each position in the contrast tendency coefficient matrix represents the first contrast tendency coefficient of the pixel value category corresponding to the row of the position relative to the pixel value category corresponding to the column of the position.
[0016] Furthermore, obtaining the contrast tendency distance between adjacent pixel value categories in the pixel value category sequence according to the first contrast tendency coefficient between each pixel value category and the target pixel value category includes:
[0017] The pixel value categories adjacent to the target pixel value category are used as directly associated pixel value categories, and the others are indirectly associated pixel value categories; the first contrast tendency coefficient between the target pixel value category and the directly associated pixel value category is used as the contrast tendency distance between the directly associated pixel value category and the target pixel value category;
[0018] In the pixel value sequence, extend outward from the target pixel value category as the center point, and use the indirectly associated pixel value category extended to each time as the extension point; obtain the contrast tendency distances between all the pixel value categories between the extension point and the center point as the inter-node distance; obtain the difference between the first contrast tendency coefficient of the target pixel value category relative to the extension point and the inter-node distance, and use the difference as the contrast tendency distance from the extension point to the previous pixel value category in the extension direction; when the difference is a negative number, set the corresponding contrast tendency distance to 0;
[0019] The extension process is repeated to obtain the contrast tendency distance between each adjacent pixel value category in the pixel value sequence.
[0020] Furthermore, obtaining the contrast attention weight of the target pixel value category according to all the second contrast tendency coefficients includes:
[0021] Obtain the column corresponding to the target pixel value category in the contrast tendency coefficient matrix; use the first contrast tendency coefficient of the column as the second contrast tendency coefficient, accumulate the second contrast tendency coefficients, and obtain the contrast attention weight.
[0022] Furthermore, obtaining a global enhancement vector according to the enhancement vector of each pixel value category and the contrast attention weight includes:
[0023] The enhancement vector of each pixel value category is multiplied by the corresponding contrast attention weight and then accumulated to obtain the global enhancement vector.
[0024] Furthermore, obtaining the enhancement coefficient according to the element value of the global enhancement vector and the accumulated value of the element before the second position includes:
[0025] The enhancement coefficient is a ratio of the accumulated value of the element values before the second position in the global enhancement vector to the accumulated value of all element values in the global enhancement vector.
[0026] Furthermore, obtaining the enhancement value of the target pixel value category according to the enhancement coefficient includes:
[0027] The product of a preset pixel value base and the enhancement coefficient is used as the enhancement value.
[0028] The present invention also proposes a fundus image enhancement system for a mobile device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements any one of the steps of the fundus image enhancement method for a mobile device.
[0029] The present invention has the following beneficial effects:
[0030] 1. The embodiment of the present invention analyzes the contrast tendency coefficient of the target pixel value category relative to other pixel value categories by the number of other pixel value categories within the neighborhood range of the pixel point of the target pixel value category. A preliminary analysis of the contrast relationship between different pixel value categories is achieved based on the pixel value distribution of the fundus image. Taking into account the pixel value size of the pixel value category, the contrast tendency distance is obtained according to the spatial position relationship of the target pixel value category in the pixel value category sequence, and further a global enhancement vector is obtained. The contrast enhancement relationship of each pixel value category relative to the entire fundus image is represented by the global enhancement vector. Thus, the required enhancement value is obtained according to the cumulative value of the elements before the second position of the target pixel value category in the global enhancement vector, avoiding the loss of detail information due to the pixel value category being too small. The enhancement value of each pixel value category is obtained through the positional relationship in the global enhancement vector, thereby obtaining an enhanced fundus image with a uniform enhancement effect, thereby effectively improving the fundus image quality.
[0031] 2. This embodiment of the present invention comprehensively analyzes the global enhancement vector using a first contrast tendency coefficient for the target pixel value category relative to other pixel value categories, and a second contrast tendency coefficient for other pixel value categories relative to the target pixel value category. The enhancement vector for the target pixel value category is weighted based on the contrast attention weight derived from the second contrast tendency coefficient, making the global enhancement vector more relevant and ensuring the quality and effectiveness of subsequent fundus image enhancement. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1A flow chart of a fundus image enhancement method for a mobile device provided by one embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a comparative tendency coefficient matrix provided by one embodiment of the present invention;
[0035] Figure 3 A schematic diagram of pixel value category distribution provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] To further illustrate the technical means and effectiveness of the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a fundus image enhancement method and system for a mobile device according to the present invention, including its specific implementation, structure, features, and effectiveness. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0037] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0038] The following describes in detail a fundus image enhancement method and system for a mobile device provided by the present invention with reference to the accompanying drawings.
[0039] See also Figure 1 , which shows a flow chart of a fundus image enhancement method for a mobile device provided by one embodiment of the present invention, the method comprising:
[0040] Step S1: Use a mobile device to obtain a fundus image of the patient; obtain multiple pixel value categories based on the pixel value of each pixel point in the fundus image; obtain a first contrast tendency coefficient between the target pixel value category and other pixel value categories based on the number of pixel points of other pixel value categories in a preset neighborhood range of the pixel points of the target pixel value category.
[0041] In the embodiments of the present invention, a professional physician uses a handheld indirect ophthalmoscope with an attached camera to capture fundus images of the patient's eye. The patient cooperates with the physician, and the physician adjusts the indirect ophthalmoscope parameters based on the patient's eye condition. Fundus image acquisition is a conventional technique used by medical professionals and will not be further described here. After acquisition, the fundus image is converted to a grayscale image for subsequent analysis.
[0042] It should be noted that for fundus images, the pixel values in the image are between [0, 255], which are relatively large. To facilitate data analysis and reduce data storage pressure, the maximum and minimum pixel values in the fundus image are obtained. The pixel values of each pixel in the fundus image are normalized according to the maximum and minimum value normalization method to obtain the grayscale transformation value of each pixel. Pixels with the same grayscale transformation value are regarded as a class of pixel values.
[0043] In an embodiment of the present invention, in order to more conveniently and intuitively display the pixel value distribution of the fundus image, a grayscale histogram of the fundus image is obtained. Based on the grayscale histogram, the pixel value category size in the fundus image can be quickly obtained, and a normalization operation can be quickly performed. The maximum and minimum value normalization formula includes:
[0044]
[0045] Among them, g T is the grayscale transformation value, g is the pixel value of the pixel, g max is the maximum pixel value in the fundus image, g min is the minimum pixel value in the fundus image.
[0046] In fundus images, environmental degradation primarily affects image quality through contrast. Therefore, it's necessary to analyze the distribution of pixel values within each pixel's neighborhood to reveal the contrast of local details. Specifically, a pixel of interest is identified and the distribution of all other pixel values within its neighborhood serves as a comparison reference.
[0047] Obtain the number of pixels of other pixel value categories within the neighborhood of all pixels of the target pixel value category. The ratio of the number of pixels of each other pixel value category to the cumulative number of pixels of other pixel value categories is used as the first contrast tendency coefficient between the target pixel value category and each other pixel value category. That is, the following equation is satisfied:
[0048]
[0049] in, It represents the first contrast tendency coefficient between the target pixel value category α and the Nth other pixel value category, where N is the number of pixel value categories. It should be noted that there is no first contrast tendency coefficient between the target pixel value category and the target pixel value category, that is, In the embodiment of the present invention, the neighborhood range is set to 8 neighborhoods.
[0050] It should be noted that the target pixel value category is the focus value. The first contrast tendency coefficient obtained at this time is calculated based on the target pixel value category as the focus value. When the focus value changes, multiple corresponding first contrast tendency coefficients can continue to be obtained. Therefore, by changing the focus value, the first contrast tendency coefficients between all pixel value categories can be obtained. The contrast tendency coefficient matrix is constructed based on the first contrast tendency coefficients between all the pixel value categories. Please refer to Figure 2 , which shows a schematic diagram of a contrast tendency coefficient matrix provided by an embodiment of the present invention, and the number of rows and columns of the contrast tendency coefficient matrix are both the number of pixel value categories N. Each row represents the serial number of the pixel focus value category; each column represents the serial number of the contrast value category under the corresponding focus value, that is, the serial number of other pixel value categories. That is, the element at each position in the contrast tendency coefficient matrix represents the first contrast tendency coefficient of the pixel value category corresponding to the row of the position relative to the pixel value category corresponding to the column of the position. For example, the element value of the 2nd row and 3rd column in the contrast tendency coefficient matrix is the first contrast tendency coefficient relative to the third pixel value category, with the pixel value of the 2nd pixel value category as the focus value.
[0051] Step S2: Sort the pixel value categories from small to large to obtain a pixel value category sequence; obtain the contrast tendency distance between adjacent pixel value categories in the pixel value category sequence based on the first contrast tendency coefficient between the target pixel value category and each pixel value category, and the contrast tendency distance constitutes an enhancement vector of the target pixel value category.
[0052] In the pixel value category sequence, the position of each pixel value category represents the size of the corresponding pixel value. After the grayscale transformation value is converted, the pixel value range in the fundus image becomes [0,1]. Therefore, there is a distribution of grayscale change values at different positions within this range. Please refer to Figure 3 , which shows a schematic diagram of pixel value category distribution provided by an embodiment of the present invention, Figure 3 The number of pixel value categories in is 5, that is, there are 5 pixel value categories, and the arrow indicates the increasing direction, that is, increasing from the pixel value category with the sequence number 1 and the pixel value 0 to the pixel value category with the sequence number 5 and the pixel value 1.
[0053] Depend on Figure 2 As can be seen, sequence numbers 1 and 2 are distributed relatively early in the pixel value sequence, indicating that the corresponding pixel value categories have smaller pixel values. Therefore, the sequence number position represents the size of the corresponding pixel value. To achieve image enhancement, it can be considered to change the position of the pixel value category in the pixel value sequence. Because the enhancement of a target pixel value category in the image needs to consider the positions of all other pixel value categories, the contrast tendency distance between adjacent pixel value categories in this interval can constitute the enhancement vector of the target pixel value category.
[0054] The enhancement vector represents the position information of the serial number points of the target pixel value category on all number axes after enhancement. In order to make the enhancement vector represent the contrast tendency required for the target pixel value category to be enhanced, the contrast tendency distance between adjacent pixel value categories in the pixel value category sequence is obtained according to the first contrast tendency coefficient between the target pixel value category and each pixel value category, specifically including:
[0055] The pixel value categories adjacent to the target pixel value category are considered directly associated pixel value categories, and the others are considered indirectly associated pixel value categories. The first contrast tendency coefficient between the target pixel value category and the directly associated pixel value category is used as the contrast tendency distance between the directly associated pixel value category and the target pixel value category.
[0056] In a pixel value sequence, extend outward from the target pixel value category as the center point, using the indirectly associated pixel value category reached at each extension as the extension point. Obtain the contrast tendency distances between all pixel value categories between the extension point and the center point as the inter-node distance. Obtain the difference between the first contrast tendency coefficient of the target pixel value category relative to the extension point and the inter-node distance, and use this difference as the contrast tendency distance from the extension point to the previous pixel value category in the extension direction. If the difference is negative, set the corresponding contrast tendency distance to 0.
[0057] Repeat the extension process to obtain the contrast tendency distance between each adjacent pixel value category in the pixel value sequence.
[0058] It should be noted that the contrast tendency distance is not the difference distance between pixel value categories in the pixel value sequence. The larger the contrast tendency distance is, the more important the target pixel value category is in the enhanced positional relationship.
[0059] by Figure 3 For example, taking the pixel value category of sequence number 4 as the target pixel value category, the form of its enhancement vector is:
[0060] P4=[p(1→2),p(2→3),p(3→4),p(4→5)]
[0061] Among them, P4 represents the enhancement vector of the pixel value category of sequence number 4, and p(1→2) represents the contrast tendency distance between sequence numbers 1 and 2. It should be noted that the arrow in p(1→2) has no actual directional meaning and only represents the relationship between sequence numbers 1 and 2.
[0062] Because sequence numbers 3, 5, and 4 are directly related pixel value categories, therefore:
[0063]
[0064]
[0065] The meanings of the parameters are explained in the text and will not be repeated here.
[0066] Sequence number 1 and sequence number 2 are not directly associated with sequence number 4, so the pixel value categories corresponding to sequence number 1 and sequence number 2 are indirectly associated pixel value categories. Therefore:
[0067] (1) The first extension is performed with sequence number 4 as the center. The first extension point is sequence number 2. The contrast tendency distance between all pixel value categories between sequence number 2 and sequence number 4 is obtained, that is, p(3→4) is obtained as the inter-node distance. The previous pixel value category of sequence number 2 in the extension direction is sequence number 3, so the contrast tendency distance between sequence number 2 and sequence number 3 is like If it is a negative value, then p(2→3)=0.
[0068] (2) Continue the extension process, obtain the second extension point as sequence number 1, obtain the contrast tendency distance between all pixel value categories between sequence number 1 to sequence number 4, that is, obtain p(3→4) and p(2→3) as the inter-node distance. The previous pixel value category of sequence number 1 in the extension direction is sequence number 2, then the contrast tendency distance between sequence number 1 and sequence number 2 is like If it is a negative value, then p(1→2)=0.
[0069] (3) Complete the extension process and obtain the contrast tendency distance between each adjacent pixel value category in the pixel value sequence.
[0070] Step S3: Obtain the second contrast tendency coefficients of other pixel value categories relative to the target pixel value category, and obtain the contrast attention weight of the target pixel value category based on all the second contrast tendency coefficients; obtain the global enhancement vector based on the enhancement vector and contrast attention weight of each pixel value category.
[0071] Furthermore, in order to analyze the enhancement relationship of pixel value categories in combination with the overall image, the contrast tendency relationship of other pixel value categories relative to the target pixel value category is taken into account, and the second contrast tendency coefficients of other pixel value categories relative to the target pixel value category are obtained. The contrast attention weight of the target pixel value category is obtained according to all the second contrast tendency coefficients, specifically including:
[0072] Obtain the column corresponding to the target pixel value category in the contrast tendency coefficient matrix, use the first contrast tendency coefficient of the column as the second contrast tendency coefficient, and accumulate the second contrast tendency coefficients to obtain the contrast attention weight.
[0073] The enhancement vector of the corresponding pixel value category is adjusted with the contrast attention weight to obtain a global enhancement vector, that is, the enhancement vector of each pixel value category is multiplied by the corresponding contrast attention weight and accumulated to obtain a global enhancement vector.
[0074] Step S4: Obtain the corresponding second position in the global enhancement vector according to the first position of the target pixel value category in the pixel value category sequence, and obtain the enhancement coefficient according to the element value of the global enhancement vector and the accumulated value of the elements before the second position; obtain the enhancement value of the target pixel value category according to the enhancement coefficient; obtain the enhancement value of each pixel value category, and obtain an enhanced fundus image.
[0075] The global enhancement vector combines the contrast influence relationship between different pixel value categories to obtain reasonable enhancement information. Using the global enhancement vector as a reference for fundus image enhancement can obtain an enhanced fundus image with good enhancement effect and complete information.
[0076] The global enhancement vector and the pixel value sequence have a positional correspondence. If the pixel value sequence length is N, then the length of the global enhancement vector is N-1. Therefore, the first position of the target pixel value category in the pixel value sequence corresponds to the second position of the global enhancement vector. This positional relationship not only includes the association between pixel value categories, but also the size relationship between pixel value categories.
[0077] It should be noted that the first pixel value category in the pixel value sequence, i.e. the smallest pixel value category, is not enhanced. The second pixel value category corresponds to the first element in the global enhancement vector. The other first positions are one position apart from the second position.
[0078] Each element in the global enhancement vector represents the enhancement relationship between directly associated pixel values. To prevent the loss of detail information of low pixel values in the fundus image during the enhancement process, the enhancement coefficient is obtained based on the element value of the global enhancement vector and the accumulated value of the elements before the second position. Specifically, it includes:
[0079] The ratio of the accumulated value of the element values before the second position in the global enhancement vector to the accumulated value of all element values in the global enhancement vector is used as the enhancement coefficient. The enhancement coefficient represents the pixel value size of the target pixel value category through the second position, and the contrast tendency relationship of the target pixel value category through the accumulated value of the element values before the second position. Therefore, the effective enhancement value of the target pixel value category can be obtained through the enhancement coefficient, which specifically includes:
[0080] The product of the preset pixel value base and the enhancement coefficient is used as the enhancement value. In the embodiment of the present invention, the pixel value base is set to 255.
[0081] When there are many pixel value categories with large distribution near the target pixel value category, in the global enhancement vector, the element value after the corresponding second position is larger, and the element value before the second position is smaller, that is, the enhancement coefficient is smaller, and the corresponding enhancement value is smaller, which improves the contrast at the corresponding position and avoids the lack of prominent enhancement effect caused by the smaller target pixel value category.
[0082] The enhancement coefficient corresponding to each pixel value category is used to obtain the enhancement value of each pixel value category. The enhancement value is assigned to the pixel points of the corresponding pixel value category to obtain an enhanced fundus image after contrast enhancement.
[0083] Medical staff can diagnose and analyze the patient's eye condition based on the enhanced fundus image. This embodiment of the present invention avoids complex parameter settings and numerical conversion processes, simplifies the calculation process, emphasizes position distribution relationships, and reduces data storage pressure, making it more suitable for mobile devices to process fundus images in complex environments.
[0084] In summary, the embodiment of the present invention obtains a first contrast tendency coefficient based on the distribution information of pixel points of other pixel value categories in the neighborhood range of the pixel points of each pixel value category. The enhancement vector of the target pixel value category is obtained by combining the first contrast tendency coefficient of the target pixel value category and the position of the target pixel value category in the pixel value sequence. The contrast attention weight of the target pixel value category is obtained by the second contrast tendency coefficients of other pixel value categories relative to the target pixel value category, and the global enhancement vector is further obtained by combining all pixel value categories. The enhancement value of each pixel value category is obtained by the element value of the global enhancement vector and the second position corresponding to the pixel value category, and an enhanced fundus image is obtained. The embodiment of the present invention performs targeted enhancement on each pixel value through the distribution information of the pixel value and the size of the pixel value to obtain an enhanced fundus image with high enhancement quality.
[0085] The present invention also proposes a fundus image enhancement system for a mobile device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of the above-mentioned fundus image enhancement method for a mobile device are implemented.
[0086] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0087] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A fundus image enhancement method for a mobile device, characterized in that: The method comprises: Acquire a fundus image of the patient using a mobile device; obtain multiple pixel value categories based on the pixel value of each pixel point in the fundus image; and obtain a first contrast tendency coefficient between the target pixel value category and the other pixel value categories based on the number of pixels of the target pixel value category within a preset neighborhood range; Sort the pixel value categories from small to large to obtain a pixel value category sequence; obtain a contrast tendency distance between adjacent pixel value categories in the pixel value category sequence based on the first contrast tendency coefficient between the target pixel value category and each pixel value category, wherein the contrast tendency distance constitutes an enhancement vector for the target pixel value category; Obtaining second contrast tendency coefficients of the other pixel value categories relative to the target pixel value category, and obtaining a contrast attention weight of the target pixel value category based on all of the second contrast tendency coefficients; and obtaining a global enhancement vector based on the enhancement vector and the contrast attention weight of each pixel value category; Obtaining a second position corresponding to the target pixel value category in the pixel value category sequence according to the first position of the target pixel value category, obtaining an enhancement coefficient according to the element value of the global enhancement vector and the accumulated value of the elements before the second position; obtaining an enhancement value for the target pixel value category according to the enhancement coefficient; obtaining the enhancement value for each pixel value category to obtain an enhanced fundus image; The step of obtaining a first comparison tendency coefficient between the target pixel value category and the other pixel value categories based on the number of pixel points of the target pixel value category within a preset neighborhood range includes: Obtaining the number of pixels of the other pixel value categories within the neighborhood of all pixels of the target pixel value category; taking the ratio of the number of pixels of each of the other pixel value categories to the cumulative value of the number of pixels of the other pixel value categories as a first comparison tendency coefficient between the target pixel value category and each of the other pixel value categories; Obtaining the contrast tendency distance between adjacent pixel value categories in the pixel value category sequence according to the first contrast tendency coefficient between each pixel value category and the target pixel value category includes: The pixel value categories adjacent to the target pixel value category are used as directly associated pixel value categories, and the others are indirectly associated pixel value categories; the first contrast tendency coefficient between the target pixel value category and the directly associated pixel value category is used as the contrast tendency distance between the directly associated pixel value category and the target pixel value category; In the pixel value sequence, extend outward from the target pixel value category as the center point, and use the indirectly associated pixel value category extended to each time as the extension point; obtain the contrast tendency distances between all the pixel value categories between the extension point and the center point as the inter-node distance; obtain the difference between the first contrast tendency coefficient of the target pixel value category relative to the extension point and the inter-node distance, and use the difference as the contrast tendency distance from the extension point to the previous pixel value category in the extension direction; when the difference is a negative number, set the corresponding contrast tendency distance to 0; The extension process is repeated to obtain the contrast tendency distance between each adjacent pixel value category in the pixel value sequence.
2. The fundus image enhancement method for a mobile device according to claim 1, characterized in that: The obtaining of multiple pixel value categories according to the pixel value of each pixel point in the fundus image comprises: The maximum pixel value and the minimum pixel value in the fundus image are obtained, and the pixel value of each pixel in the fundus image is normalized according to the maximum and minimum value normalization method to obtain the grayscale transformation value of each pixel; and the pixels with the same grayscale transformation value are regarded as a class of the pixel value category.
3. The fundus image enhancement method for a mobile device according to claim 1, characterized in that: The step of obtaining a first comparison tendency coefficient between the target pixel value category and the other pixel value categories includes: Obtain a first contrast tendency coefficient between all the pixel value categories; construct a contrast tendency coefficient matrix based on the first contrast tendency coefficient between all the pixel value categories; the number of rows and columns of the contrast tendency coefficient matrix are both the number of the pixel value categories; the element at each position in the contrast tendency coefficient matrix represents the first contrast tendency coefficient of the pixel value category corresponding to the row of the position relative to the pixel value category corresponding to the column of the position.
4. The fundus image enhancement method for a mobile device according to claim 3, wherein: The step of obtaining the contrast attention weight of the target pixel value category according to all the second contrast tendency coefficients includes: Obtain the column corresponding to the target pixel value category in the contrast tendency coefficient matrix; use the first contrast tendency coefficient of the column as the second contrast tendency coefficient, accumulate the second contrast tendency coefficients, and obtain the contrast attention weight.
5. The fundus image enhancement method for a mobile device according to claim 1, characterized in that: Obtaining a global enhancement vector according to the enhancement vector of each pixel value category and the contrast attention weight includes: The enhancement vector of each pixel value category is multiplied by the corresponding contrast attention weight and then accumulated to obtain the global enhancement vector.
6. The fundus image enhancement method for a mobile device according to claim 1, characterized in that: Obtaining the enhancement coefficient according to the element value of the global enhancement vector and the accumulated value of the elements before the second position includes: The enhancement coefficient is a ratio of the accumulated value of the element values before the second position in the global enhancement vector to the accumulated value of all element values in the global enhancement vector.
7. The fundus image enhancement method for a mobile device according to claim 1, characterized in that: Obtaining the enhancement value of the target pixel value category according to the enhancement coefficient includes: The product of a preset pixel value base and the enhancement coefficient is used as the enhancement value.
8. A fundus image enhancement system for a mobile device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Digital image enhancement method and system
CN104166969A
Image processing method and device, fundus image processing method and electronic equipment
CN110473176A