A method and system for expanding dynamic range of fundus images with controllable brightness and detail preservation

Through brightness-controllable bilateral filtering and segmented histogram shearing compensation technology, the background texture layer of the fundus image is separated and dynamically expanded, solving the problem of insufficient dynamic range of the fundus image, achieving brightness matching and detail maintenance, and improving image recognition. rate and operational efficiency.

CN114693550BActive Publication Date: 2024-10-08GUANGDONG UNIV OF EDUCATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210292945.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2024-10-08
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

Existing technology is difficult to effectively expand the dynamic range of fundus images, resulting in blurred image details, difficulty in distinguishing the target from the background, and affecting diagnostic results.

Method used

Through brightness-controllable bilateral filtering and segmented histogram shearing compensation technology, the brightness component of the image is separated into a background texture layer and a detail layer. The background texture layer is dynamically expanded according to the brightness of the display device, and the detail layer and chroma component are combined to generate the final Output image.

Benefits of technology

It achieves brightness matching and maintenance of detail information of the fundus image, improves the dynamic range adaptability and recognition rate of the image, reduces the impact of noise, and improves the harmony of light and dark and the computing efficiency of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114693550B_ABST
    Figure CN114693550B_ABST
Patent Text Reader

Abstract

The invention discloses a method for expanding the dynamic range of a fundus image with controllable brightness and detail preservation, comprising the following steps: obtaining a fundus image and display device brightness through a data acquisition module; extracting a brightness component and a chromaticity component from the fundus image, performing bilateral filter layer decomposition on the brightness component to obtain a brightness component background texture layer and a brightness component detail layer; performing segmented histogram shearing compensation processing on the brightness component background texture layer to obtain a histogram processing result; estimating the average brightness and standard deviation of the background texture layer for the display device brightness, and solving a corresponding mapping curve; implementing dynamic range expansion of the image brightness component background texture layer based on the mapping curve; superimposing the image brightness component background texture layer with the dynamic range expanded on the brightness component detail layer, and then fusing it with the chromaticity component to obtain a final output fundus image; the algorithm proposed by the invention has low time complexity and high computational efficiency, can meet real-time computing occasions, and improve the fundus image recognition rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the research field of image processing, and in particular to a method and system for expanding the dynamic range of a fundus image with controllable brightness and detail preservation. Background Art

[0002] With the evolution of imaging technology, people have been pursuing higher image resolution, faster sampling rate, and wider dynamic range (ratio of maximum brightness to minimum brightness) for high-quality images. The resolution and sampling rate of digital images are constantly improving, but the dynamic range, one of the indicators of high-quality images, has not improved much. The dynamic range in real scenes is very wide, from the stars in the night sky to the direct sunlight. The dynamic range of the real environment is 10 8 :1.

[0003] However, digital images are limited by the quantization bit width of the analog-to-digital converter. The acquisition system uses the control of camera exposure parameters to selectively discard brightness information that is not of interest. For example, the lens aperture value is fixed so that the scene has the same depth of field, and then the camera exposure is controlled by setting the exposure time, thereby controlling the amount of light reaching the sensor. As a result, the dynamic range of the image is greatly compressed during the mapping process. This problem is particularly evident when shooting scenes with a large dynamic range.

[0004] The eye has a terminal vascular system. Many diseases of the human body will produce corresponding pathological changes in the retina. The vascular condition is an important basis for diagnosis. Since the human eye is not suitable for long-term observation with instruments such as ophthalmoscopes, fundus cameras are mainly used in clinical practice to collect fundus retinal images (referred to as fundus images) for examination. Due to the limitations of the ADC and file recording method of the fundus camera, the fundus images taken are Figure 5 Its dynamic range is usually severely compressed, only 2 8 :1 or 2 16 :1, which is far from reflecting the changes in scene brightness, resulting in low contrast between the target image and the background, blurred image details, and difficulty in distinguishing, which affects the reading results. Therefore, improving the dynamic range of fundus images is an urgent problem to be solved.

[0005] To this end, image enhancement methods can be used to expand the dynamic range of images and thus improve image quality. The basic idea is to use a series of techniques to improve the quality and visual effects of images, highlight the features of interest in the image, obtain valuable information in the image, and convert the image into a form that is more suitable for human or machine analysis and processing, so that the processed image has a better effect on certain specific applications. This type of method is widely used in the fields of biomedicine, industrial production, public security, and aerospace.

[0006] The key to image enhancement technology is how to effectively improve the image quality, expand the image dynamic range and enhance the visual effect while better preserving the edge and detail information of the image. Among them, there are mainly two types of image enhancement methods used compared with the present invention:

[0007] 1. Histogram equalization: This method includes global histogram equalization, histogram normalization and local histogram equalization. These methods make the brightness uniformly distributed, thereby enhancing the local or global contrast of the image and expanding its dynamic range. This method is particularly effective when the contrast of the useful data of the image is quite close. YTKim proposed a brightness-preserving dual histogram equalization (BBHE) algorithm, which divides the histogram into two parts by calculating the average brightness, and then remaps them using the traditional histogram equalization algorithm. This algorithm suppresses the enhancement of noise while improving the image contrast. Abdullah-Al-Wadud M et al. proposed a dynamic histogram equalization algorithm (DHE), which effectively improves the image contrast and can expand the grayscale; however, it is not ideal for the processing of images with a histogram grayscale distribution and less distribution in the middle at both ends. As a global algorithm, its complexity is relatively high. Based on the DHE algorithm, Ibrahim H et al. proposed a brightness-preserving dynamic histogram equalization algorithm (BPDHE), which can maintain the average brightness while improving the dynamic range of the image. However, the overall brightness of underexposed photos is not significantly improved, but the contrast can still be improved. However, this type of method may increase the background noise contrast and reduce the contrast of useful signals, and may also lead to over-enhancement and detail loss.

[0008] 2. Unsharp mask: This is an image sharpening technique that has been used in the printing and publishing industry for many years. It is to subtract an unsharp (smoothed) version from the original image, that is, to subtract the blurred part of the image from the original image to obtain a clear image. The algorithm processing steps include: (1) blurring the original image; (2) subtracting the blurred image from the original image (the resulting difference image is called a template); (3) linearly adding the template to the original image. Guang Deng proposed the UM algorithm based on the ratio and Bregman difference operator, which has good image restoration and enhancement effects, but has high time complexity and poor noise suppression. Shwu-huey Yen et al. proposed to use the Canny edge operator to extract the edge part of the low-brightness image, then divide the edge into two parts, and then add the adaptive weight method combined with the Laplacian operator to enhance the edge. Then, the original image and the edge-enhanced part are superimposed using the UM idea to obtain an edge-enhanced image. This type of method can enhance the high-frequency information of the image and enhance the image contour, but it may also cause noise to be enhanced or ringing effects to appear.

[0009] In addition, the current image enhancement method has poor adaptability to the backlight of the display device, cannot be changed according to the change of the backlight of the display device, and is prone to over-enhancement. Summary of the invention

[0010] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a method and system for expanding the dynamic range of fundus images with controllable brightness and detail preservation, a method for expanding the dynamic range of fundus images with controllable brightness and detail preservation that uses a histogram model to estimate the average brightness and standard deviation of the output image. The method can effectively expand the dynamic range of the fundus image according to the brightness value of the user's display device, so that the output fundus image brightness matches the brightness value of the user's display device, while also being able to suppress noise and preserve the fundus image detail information.

[0011] The first object of the present invention is to provide a method for extending the dynamic range of fundus images with controllable brightness and detail preservation;

[0012] The second object of the present invention is to provide a brightness controllable detail preserving fundus image dynamic range expansion system

[0013] The first object of the present invention is achieved by the following technical solutions:

[0014] A method for extending the dynamic range of a fundus image with controllable brightness and detail preservation, comprising the following steps:

[0015] Acquire fundus images and display device brightness through a data acquisition module;

[0016] Extracting brightness component and chrominance component from the fundus image, performing bilateral filter layer decomposition on the brightness component to obtain a brightness component background texture layer and a brightness component detail layer;

[0017] Performing segmented histogram shearing compensation processing on the brightness component background texture layer to obtain a histogram processing result;

[0018] estimating the average brightness and standard deviation of the background texture layer for the brightness of the display device, and solving the corresponding mapping curve;

[0019] Implementing dynamic range expansion of the background texture layer of the image brightness component based on the mapping curve;

[0020] The background texture layer of the brightness component of the image with dynamic range expansion is superimposed with the detail layer of the brightness component, and then fused with the chrominance component to obtain the final output fundus image.

[0021] Further, the brightness component is preprocessed to obtain a brightness component background texture layer and a brightness component detail layer, specifically: bilateral filtering is performed on the brightness component to decompose it into a brightness component background texture layer and a brightness component detail layer; the brightness component background texture layer is a background texture layer of large-scale texture information of the brightness component, and the brightness component detail layer is a detail layer of small changes in the brightness component.

[0022] Furthermore, extracting the brightness component and the chrominance component from the fundus image is specifically:

[0023] a1) Define the input fundus image as I and the brightness value of the user display device as L d , the data of the red, green and blue color channels of the image are R, G and B respectively, then the brightness component L of I is defined w for:

[0024] L w =0.299R+0.587G+0.114B

[0025] a2) Define the bilateral filter as BF:

[0026]

[0027] Where ||pq|| is the Euclidean distance between position p and position q on the image; I p Indicates the brightness of position p on the image, I q Indicates the brightness of position q on the image; |I p -I q | represents the absolute value of the brightness difference between position p and position q on the image; and Both represent two-dimensional Gaussian kernels; W p is the normalization factor, ensuring that the sum of pixel weights is 1:

[0028]

[0029] Parameter σ s and σ r , respectively controlling the shapes of the spatial weight and amplitude weight functions: increasing the spatial weight σ s , the bilateral filter will smooth out more image details and textures, increasing the amplitude weight σ r , the bilateral filter will be similar to Gaussian filtering; and G σ (x,y) is a two-dimensional Gaussian kernel:

[0030]

[0031] Where σ is the standard deviation, x and y are the image space coordinates;

[0032] a3) Using the characteristics of the bilateral filter, the brightness component of the input image is decomposed into a background texture layer and a detail layer:

[0033] B=BF[logL]

[0034] D = log L - B

[0035] Where B is the background texture layer with large-scale texture information, D is the detail layer with small changes; BF is the bilateral filter defined in step a2), L w The brightness component defined in step a1);

[0036] a4) Restore the background texture layer and detail layer to normal images:

[0037] B = 10exp(B)

[0038] D = 10exp(D)

[0039] The separated large-scale texture background texture layer and the fine-scale detail layer image are obtained.

[0040] Further, the histogram processing is performed on the brightness component background texture layer to obtain a histogram processing result, specifically:

[0041] b1) Perform histogram statistics on the large-scale texture background texture layer image B obtained in step a4), and define the histogram as h(i):

[0042] h(i)=|{L B (x,y)L B (x,y)=i}|

[0043] Where i=0,...,L-1, |·| represents the number of elements in image B, and L-1 represents the maximum brightness value of image B;

[0044] b2) Define the mean μ of the histogram h(i) obtained in step b1):

[0045]

[0046] Where M, N are the height and width of image B respectively, and i is the brightness level;

[0047] b3) Define the standard deviation σ of the histogram h(i) obtained in step b1):

[0048]

[0049] Where M, N are the height and width of image B respectively, and i is the brightness level;

[0050] b4) Define t1 and t2 as the two segmentation points of the histogram h(i):

[0051]

[0052] in, Indicates rounding down, t1 and t2 divide the histogram h(i) into three independent histograms, which are defined as h l (i) h m (i) and h u (i)

[0053] h l (i)=h(i),0≤i<t1

[0054] h m (i)=h(i),t1≤i<t2

[0055] h u (i)=h(i),t2≤i<L

[0056] Where i is the brightness level.

[0057] Define r1, r2 and r3 to represent the proportion of each segment of the histogram in the overall histogram:

[0058]

[0059]

[0060]

[0061] Where M, N are the height and width of image B respectively, and i is the brightness level;

[0062] b5) For the first segment histogram h l (i) Perform clipping compensation and define the clipping threshold as T l :

[0063] T l =median(h l )

[0064] Among them, median(·) represents the median value, and the clipped histogram is defined as h' l (i)

[0065]

[0066] Furthermore, it also includes:

[0067] In order not to change h' l (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h l ”(i):

[0068]

[0069]

[0070] Among them, inc l (i) represents the pixel number function of each gray value compensation of the first segment histogram, which is used to improve the brightness of the dark part; res l The sum of the number of pixel values ​​clipped by the first segment of the histogram;

[0071] b6) For the second segment histogram h m (i) Perform clipping compensation and define the clipping threshold as T m :

[0072] T m =median(h m (i))

[0073] Where median(·) represents the median value; the clipped histogram is defined as h m ':

[0074]

[0075] In order not to change h' m (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" m (i)

[0076]

[0077] Among them, res m It is the sum of the number of pixel values ​​clipped by the second segment of histogram, which is the average compensation;

[0078] b7) For the third segment histogram h u (i) Perform clipping compensation and define the clipping threshold as T u :

[0079] T u =median(h u )

[0080] Among them, median(·) represents the median value, and the clipped histogram is defined as h' u (i)

[0081]

[0082] In order not to change h' u(i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" u (i)

[0083]

[0084]

[0085] Among them, inc u (i) represents the pixel number function of each gray value compensation of the third segment histogram, which is used to suppress the brightness of the bright part; res u It is the sum of the number of pixel values ​​clipped by the third segment of histogram;

[0086] b8) Define the clipped and compensated histogram h”(i):

[0087]

[0088] Furthermore, the estimating the average brightness and standard deviation of the brightness of the display device is specifically:

[0089] c1) Define the segmentation points t1 and t2 of the histogram of the large-scale texture image B of the brightness component to be mapped to the segmentation points of the output large-scale texture image B' as t1' and t2', and define the model average brightness μ of the estimated output image B' m and standard deviation σ m , the split point t1' is obtained by iteratively solving the equation;

[0090] c2) List the calculated split points t' according to the estimated model 1,k The equation f1(·) is:

[0091]

[0092] Among them, μ m,k represents the average brightness at the current k-th iteration; and σ m,k is the standard deviation of the current kth iteration; r1, r2, r3 represent the proportion of each segment of the histogram in the overall histogram; t' 1,k Indicates the first split point at the current k-th iteration;

[0093] c3) Standard deviation σ m,k The equation f2(·):

[0094]

[0095] Among them, μ m,k-1 represents the average brightness of the k-1th iteration (the previous one); σ m,k-1 represents the standard deviation of the k-1th iteration (the previous one); i represents the brightness level; t2,k 'Indicates the second split point at the current kth iteration.

[0096] c4) List the calculated split points t' according to the estimated model 2,k The equation is:

[0097] t' 2,k =t' 1,k +2σ m,k

[0098] c5) At the end of the iteration, let

[0099] t'1=t' 1,k

[0100] t'2=t' 2,k

[0101] Therefore, the segmentation points mapped to the output large-scale texture image B' are t1' and t2'.

[0102] Furthermore, it also includes:

[0103] d1) Get the average brightness L of the detail layer image D D Its maximum brightness value L maxD :

[0104] L D =mean(D)

[0105] L maxD =max(D)

[0106] Where mean(·) represents the average brightness value, and max(·) represents the maximum brightness value. Then, the average brightness μ of the output image B' of the large-scale texture background texture layer image B can be obtained. m With the maximum brightness value ω L They are:

[0107] μ m =L d -L D

[0108] ω L =255-L maxD

[0109] Among them, L d The average brightness value of the user display device;

[0110] d2) Define iteration counter k = 1, define maximum number of iterations K = 120, define preset error δ < 10 -3 , define the initial standard deviation σ m,0 =σ(obtained in step b3), the initial average brightness value of the output image B' is μm,0 =μ m , calculate t' 1,0 =f1(μ m,0 ,σ m,0 ), the iteration starts;

[0111] d3) Calculate the standard deviation σ of the output image m,k =f2(t' 1,k-1 ,σ m,k-1 );

[0112] d4) To adapt the brightness of the display device, define equation Δ:

[0113]

[0114] Among them, L' maxB Indicates the maximum brightness value of the output background texture image B'.

[0115] This formula is based on the maximum entropy. When Δ=0, μ m,k The brightness of the mapped image B' obtains the local maximum entropy. The complexity of solving this equation numerically is very large. Considering μ m,k The range is from 0 to L maxB 'discrete value, and discard the selection results of low brightness and high brightness, so define μ m,k Find the value of Δ closest to 0 in the range of 30 to 180. m,k is the result obtained by the adaptive brightness method;

[0116] d5) Update t' 1,k =f1(μ m,k ,σ m,k );

[0117] d6) If satisfied Or k>K, the iteration ends and the final segmentation point t'1=t' is output 1,k , t2'=t1'+2σ m,k ; Otherwise, let k=k+1 and go to step d3).

[0118] Furthermore, the solving of the corresponding mapping curve is specifically as follows:

[0119] e1) Define the cumulative density function cdf(·) of the histogram:

[0120]

[0121] Among them, i is the gray level.

[0122] e2) Define the mapping from the image B of the large texture background layer dynamic range [0, D-1] to the new dynamic range [0, ω L]’s output image B’’s mapping curve function T(·):

[0123]

[0124] Among them, t1 and t2 are the two segmentation points of the histogram h(i) required in b4); ω L is the maximum brightness of the output background texture image B' required by d1);

[0125] e3) Define the output image L after mapping B’ (·):

[0126] L B' (x,y)=T(L B (x,y)).

[0127] Among them, L B (x, y) represents the grayscale value of each pixel of the original background texture image B.

[0128] Furthermore, the dynamic range expanded image brightness component background texture layer is superimposed on the brightness component detail layer, and then fused with the chrominance component to obtain the final output fundus image, specifically:

[0129] f1) Define the new brightness component image after the large texture background texture layer image B' and the detail layer image D are superimposed as L w ':

[0130] L' w =L B' +L D

[0131] Among them, L B’ In step e3), the large texture basic image after the dynamic range is expanded is obtained, L D Represents a detail layer image;

[0132] f2) The brightness component image L after the dynamic range is expanded obtained in step f1) w 'After fusion with the chroma and saturation components, an extended dynamic range fundus image is obtained with brightness matching the brightness value of the user's display device and detail preserved.

[0133] Another object of the present invention is achieved by the following technical solutions:

[0134] A brightness controllable detail-preserving fundus image dynamic range extension system, comprising:

[0135] A data acquisition module, used for acquiring fundus images and displaying device brightness;

[0136] A preprocessing module extracts brightness components and chrominance components from the fundus image, performs bilateral filter layer decomposition on the brightness component, and obtains a brightness component background layer and a brightness component detail layer;

[0137] A histogram processing module performs segmented histogram shear compensation on the brightness component background layer to obtain a histogram processing result;

[0138] An estimation module estimates the average brightness and standard deviation of the background texture layer for the brightness of the display device;

[0139] A mapping curve solving module, used to solve a corresponding mapping curve, and realize dynamic range expansion of a background texture layer of an image brightness component based on the mapping curve;

[0140] The final output module superimposes the background texture layer of the brightness component of the image with dynamic range expansion with the brightness component detail layer, and then fuses them with the chrominance component to obtain the final output fundus image.

[0141] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0142] The present invention separates the large-scale texture background texture layer and the fine-change detail layer of the fundus image brightness component, and only changes the brightness of the background texture layer image to expand the dynamic range of the entire image, so that it can adapt to the user input display device brightness value while maintaining the rich detail information of the detail layer. On the basis of controllable brightness, the algorithm of the present invention adds a step of maximizing entropy to select the appropriate output brightness. This method can effectively adapt the image brightness required by the user and the ideal dynamic range, and the overall effect is harmonious in light and dark. The algorithm proposed by the present invention has low time complexity and high computational efficiency, can meet real-time computing occasions, and improve the recognition rate of fundus images. BRIEF DESCRIPTION OF THE DRAWINGS

[0143] Figure 1 This is a flow chart of a method for expanding the dynamic range of fundus images with controllable brightness and detail preservation according to the present invention;

[0144] Figure 2 This is a flowchart of the dynamic range expansion method in Embodiment 1 of the present invention;

[0145] Figure 3 This is a flow chart of the method for expanding the dynamic range of fundus images with controllable brightness and detail preservation in Embodiment 1 of the present invention;

[0146] Figure 4 This is a flow chart of the iterative process of model estimation and brightness adaptation in Embodiment 1 of the present invention;

[0147] Figure 5 is a fundus image commonly taken in Embodiment 1 of the present invention;

[0148] Figure 6 It is a large-scale texture background texture layer image after the fundus image brightness separation in Embodiment 1 of the present invention;

[0149] Figure 7 It is a fine change detail layer image after brightness separation of the fundus image in Embodiment 1 of the present invention;

[0150] Figure 8 The histogram model for estimating the average brightness and standard deviation of the texture background texture layer image in Embodiment 1 of the present invention;

[0151] Fig. 9 A mapping curve function for expanding the dynamic range of a large-scale texture background texture layer image in Embodiment 1 of the present invention;

[0152] Fig.10 It is the large-scale texture background texture layer image after the brightness is adapted to the brightness of the user display device in Embodiment 1 of the present invention;

[0153] Fig.11 The fundus image with brightness controllable details and dynamic range expansion based on the separation of background texture and detail layer in Embodiment 1 of the present invention;

[0154] Fig.12 This is a structural diagram of a brightness controllable detail-preserving fundus image dynamic range expansion system described in the present invention. DETAILED DESCRIPTION

[0155] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0156] Example 1

[0157] A brightness controllable detail preserving fundus image dynamic range expansion method, such as Figure 1 As shown, the following steps are included:

[0158] Acquire fundus images and display device brightness through a data acquisition module;

[0159] Extracting brightness component and chrominance component from the fundus image, preprocessing the brightness component to obtain a brightness component background texture layer and a brightness component detail layer;

[0160] Performing histogram processing on the brightness component background texture layer to obtain a histogram processing result;

[0161] estimating average brightness and standard deviation of the brightness of the display device, and solving a corresponding mapping curve;

[0162] Implementing dynamic range expansion of the background texture layer of the image brightness component based on the mapping curve;

[0163] Superimposing the background texture layer of the brightness component of the image with the dynamic range expansion with the detail layer of the brightness component, and then fusing them with the chrominance component to obtain a final output fundus image;

[0164] The flow chart of the dynamic range extension method is as follows: Figure 2 As shown, the flow chart of the method for expanding the dynamic range of fundus images with controllable brightness and detail preservation is as follows Figure 3 As shown; the flow chart of the iterative process of model estimation and brightness adaptation is as follows Figure 4 As shown;

[0165] The details are as follows:

[0166] a1) Define the input fundus image as I, such as Figure 5 As shown; the brightness value of the user display device is L d , the data of the red, green and blue color channels of the image are R, G and B respectively, then the brightness component L of I is defined w for:

[0167] L w =0.299R+0.587G+0.114B

[0168] a2) Define the bilateral filter as BF:

[0169]

[0170] Where ||pq|| is the Euclidean distance between position p and position q on the image; I p Indicates the brightness of position p on the image, I q Indicates the brightness of position q on the image; |I p -I q | represents the absolute value of the brightness difference between position p and position q on the image; and Both represent two-dimensional Gaussian kernels; W p is the normalization factor, ensuring that the sum of pixel weights is 1:

[0171]

[0172] Parameter σ s and σ r , respectively controlling the shapes of the spatial weight and amplitude weight functions: increasing the spatial weight σ s , the bilateral filter will smooth out more image details and textures, increasing the amplitude weight σ r , the bilateral filter will be similar to Gaussian filtering; and G σ (x,y) is a two-dimensional Gaussian kernel:

[0173]

[0174] Among them, σ is the standard deviation, and x and y are the image space coordinates.

[0175] a3) Using the characteristics of the bilateral filter, the brightness component of the input image is decomposed into a background texture layer and a detail layer:

[0176] B=BF[logL]

[0177] D = log L - B

[0178] Where B is the background texture layer with large-scale texture information, D is the detail layer with small changes; BF is the bilateral filter defined in step a2), L w is the brightness component defined in step a1).

[0179] a4) Restore the background texture layer and detail layer to normal images:

[0180] B = 10exp(B)

[0181] D = 10exp(D)

[0182] At this time, the large-scale texture background texture layer and the fine-scale detail layer image after separation can be obtained; the large-scale texture background texture layer image after separation is as follows: Figure 6 As shown, the detail layer image with small changes is as follows Figure 7 shown.

[0183] Then, the large-scale texture background texture layer needs to be brightness-adapted to the display device brightness value input by the user, and its dynamic range needs to be expanded. The flow chart of the method for expanding the dynamic range of the fundus image with controllable brightness and detail preservation is as follows: Figure 3 Starting from step b), it specifically includes:

[0184] b1) Perform histogram statistics on the large-scale texture background texture layer image B obtained in step a4), and define the histogram as h(i):

[0185] h(i)=|{L B (x,y)|L B (x,y)=i}|

[0186] Wherein, i=0,...,L-1, |·| represents the number of elements of image B, and L-1 represents the maximum brightness value of image B.

[0187] b2) Define the mean μ of the histogram h(i) obtained in step b1):

[0188]

[0189] Where M, N are the height and width of image B respectively, and i is the brightness level.

[0190] b3) Define the standard deviation σ of the histogram h(i) obtained in step b1):

[0191]

[0192] Where M, N are the height and width of image B respectively, and i is the brightness level.

[0193] b4) Define t1 and t2 as the two segmentation points of the histogram h(i):

[0194]

[0195] in, Indicates rounding down. t1 and t2 divide the histogram h(i) into three independent histograms, which are defined as h l (i) h m (i) and h u (i)

[0196] h l (i)=h(i),0≤i<t1

[0197] h m (i)=h(i),t1≤i<t2

[0198] h u (i)=h(i),t2≤i<L

[0199] Where i is the brightness level;

[0200] Define r1, r2 and r3 to represent the proportion of each segment of the histogram in the overall histogram:

[0201]

[0202]

[0203]

[0204] Where M and N are the height and width of image B respectively.

[0205] b5) For the first segment histogram h l (i) Perform clipping compensation and define the clipping threshold as T l :

[0206] T l =median(h l (i))

[0207] Where median(·) represents the median value. Define the clipped histogram as h' l(i)

[0208]

[0209] In order not to change h' l (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" l (i)

[0210]

[0211]

[0212] Among them, inc l (i) represents the pixel number function of each gray value compensation of the first segment histogram, which is used to improve the brightness of the dark part; res l It is the sum of the number of pixel values ​​clipped by the first segment of the histogram.

[0213] b6) For the second segment histogram h m (i) Perform clipping compensation and define the clipping threshold as T m :

[0214] T m =median(h m (i))

[0215] Where median(·) represents the median value. Define the clipped histogram as h' m (i)

[0216]

[0217] In order not to change h' m (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" m (i)

[0218]

[0219] Among them, res m It is the sum of the number of pixel values ​​clipped by the second segment of the histogram, which is the average compensation.

[0220] b7) For the third segment histogram h u (i) Perform clipping compensation and define the clipping threshold as T u :

[0221] T u =median(h u (i))

[0222] Where median(·) represents the median value. Define the clipped histogram as h' u (i)

[0223]

[0224] In order not to change h' u (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" u (i)

[0225]

[0226]

[0227] Among them, inc u (i) represents the pixel number function of each gray value compensation of the third segment histogram, which is used to suppress the brightness of the bright part; res u It is the sum of the number of pixel values ​​clipped by the third segment of the histogram.

[0228] b8) Define the clipped and compensated histogram h”(i):

[0229]

[0230] like Figure 8 The figure shows the histogram based on the model estimation proposed by the present invention. The step c) comprises:

[0231] c1) Define the segmentation points t1 and t2 of the histogram of the large-scale texture image B of the brightness component to be mapped to the segmentation points of the output large-scale texture image B' as t1' and t2', and define the model average brightness μ of the estimated output image B' m and standard deviation σ m , the split point t1' is obtained by iteratively solving the equation.

[0232] c2) List the calculated split points t' according to the estimated model 1,k The equation f1(·) is:

[0233]

[0234] Among them, μ m,k represents the average brightness at the current k-th iteration; and σ m,k is the standard deviation of the current kth iteration; r1, r2, r3 represent the proportion of each segment of the histogram in the overall histogram; t' 1,k Indicates the first split point at the current k-th iteration.

[0235] c3) Standard deviation σ m,k The equation f2(·):

[0236]

[0237] Among them, μ m,k-1 represents the average brightness of the k-1th iteration (the previous one); σ m,k-1 represents the standard deviation of the k-1th iteration (the previous one); i represents the brightness level; t 2,k 'Indicates the second split point at the current kth iteration.

[0238] c4) List the calculated split points t' according to the estimated model 2,k The equation is:

[0239] t| 2,k =t| 1,k +2σ m,k

[0240] c5) At the end of the iteration, let

[0241] t|1=t| 1,k

[0242] t|2=t| 2,k

[0243] Therefore, the segmentation points mapped to the output large-scale texture image B' are t1' and t2'.

[0244] The step d) comprises:

[0245] d1) Get the average brightness L of the detail layer image D D Its maximum brightness value L maxD :

[0246] L D =mean(D)

[0247] L maxD =max(D)

[0248] Among them, mean(·) represents the average brightness value, and max(·) represents the maximum brightness value. Then the average brightness μ of the output image B' of the large-scale texture background layer image B can be obtained. m With the maximum brightness value ω L They are:

[0249] μ m =L d -L D

[0250] ω L =255-L maxD

[0251] Among them, L dThe average brightness value of the user display device.

[0252] d2) Iterative calculation process is as follows Figure 4 As shown, the flow chart of the iterative process of model estimation and brightness adaptation is as follows Figure 4 As shown, the mapping curve function based on the estimation model can be solved. Define the iteration counter k = 1, define the maximum number of iterations K = 120, and define the preset error δ < 10 -3 , define the initial standard deviation σ m,0 =σ(obtained in step b3), the initial average brightness value of the output image B' is μ m,0 =μ m , calculate t' 1,0 =f1(μ m,0 ,σ m,0 ), the iteration starts.

[0253] d3) Calculate the standard deviation σ of the output image m,k =f2(t' 1,k-1 ,σ m,k-1 ).

[0254] d4) To adapt the brightness of the display device, define equation Δ:

[0255]

[0256] Among them, L' maxB Indicates the maximum brightness value of the output background texture image B'.

[0257] This formula is based on the maximum entropy. When Δ=0, μ m,k The brightness of the mapped image B' obtains the local maximum entropy. The complexity of solving this equation numerically is very large. Considering μ m,k The range is from 0 to L maxB 'discrete value, and discard the selection results of low brightness and high brightness, so define μ m,k Find the value of Δ closest to 0 in the range of 30 to 180. m,k This is the result obtained by the adaptive brightness method.

[0258] d5) Update t' 1,k =f1(μ m,k ,σ m,k ).

[0259] d6) If satisfied Or k>K, the iteration ends and the final segmentation point t'1=t' is output 1,k , t2'=t1'+2σ m,k ; Otherwise, let k=k+1 and go to step d3).

[0260] The step e) comprises:

[0261] e1) Define the cumulative density function cdf(·) of the histogram:

[0262]

[0263] e2) Define the mapping from the image B of the large texture background layer dynamic range [0, D-1] to the new dynamic range [0, ω L ]’s output image B’’s mapping curve function T(·):

[0264]

[0265] Among them, t1 and t2 are the two segmentation points of the histogram h(i) required in b4); ω L is the maximum brightness of the output background texture image B' required by d1).

[0266] The function curve is as follows Fig. 9 As shown, the mapping curve function of the dynamic range expansion of the large-scale texture background layer image is as follows Fig. 9 shown.

[0267] e3) Define the output image L after mapping B’ :

[0268] L B' (x,y)=T(L B (x,y)

[0269] Among them, L B (x, y) represents the grayscale value of each pixel of the original background texture image B.

[0270] The step f) comprises:

[0271] f1) Define the new brightness component image after the large texture background texture layer image B' and the detail layer image D are superimposed as L w ':

[0272] L' w =L B' +L D

[0273] Among them, L B’ In step e3), the large texture basic image after the dynamic range is expanded is obtained, L D Represents a detail layer image.

[0274] f2) The brightness component image L after the dynamic range is expanded obtained in step f1) w 'After fusion with the chroma and saturation components, a new image with extended dynamic range is obtained, whose brightness matches the brightness value of the user's display device and whose details are preserved.

[0275] The large-scale texture background texture layer image after brightness adaptation to the user's display device brightness is as follows Fig.10 As shown; the fundus image with brightness controllable details and dynamic range expansion based on the separation of background texture and detail layer is shown Fig.11 As shown;

[0276] Example 2

[0277] A brightness controllable detail preserving fundus image dynamic range extension system, such as Fig.12 As shown, including:

[0278] A data acquisition module, used for acquiring fundus images and displaying device brightness;

[0279] A preprocessing module extracts brightness components and chrominance components from the fundus image, performs bilateral filter layer decomposition on the brightness component, and obtains a brightness component background layer and a brightness component detail layer;

[0280] A histogram processing module performs a histogram segmentation shearing compensation process on the brightness component background layer to obtain a histogram processing result;

[0281] An estimation module estimates the average brightness and standard deviation of the background texture layer image for the brightness of the display device;

[0282] A mapping curve solving module, used to solve a corresponding mapping curve, and realize dynamic range expansion of a background texture layer of an image brightness component based on the mapping curve;

[0283] The final output module superimposes the background texture layer of the brightness component of the image with dynamic range expansion with the brightness component detail layer, and then fuses them with the chrominance component to obtain the final output fundus image.

[0284] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A method for extending the dynamic range of fundus images with controllable brightness and detail preservation. It is characterized in that The following steps are involved: Acquire fundus images and display device brightness through a data acquisition module; Extracting brightness component and chrominance component from the fundus image, performing bilateral filter layer decomposition on the brightness component to obtain a brightness component background texture layer and a brightness component detail layer; Performing segmented histogram shearing compensation processing on the brightness component background texture layer to obtain a histogram processing result; estimating the average brightness and standard deviation of the background texture layer for the brightness of the display device, and solving the corresponding mapping curve; Implementing dynamic range expansion of the background texture layer of the image brightness component based on the mapping curve; Superimposing the background texture layer of the brightness component of the image with the dynamic range expansion with the detail layer of the brightness component, and then fusing them with the chrominance component to obtain a final output fundus image; Preprocessing the brightness component to obtain a brightness component background texture layer and a brightness component detail layer, specifically: performing bilateral filtering on the brightness component to decompose it into a brightness component background texture layer and a brightness component detail layer; the brightness component background texture layer is a background texture layer of large-scale texture information of the brightness component, and the brightness component detail layer is a detail layer of small changes in the brightness component; The step of extracting the brightness component and the chrominance component from the fundus image is specifically as follows: a1) Define the input fundus image as I and the brightness value of the user display device as L d , the data of the three color channels of the image are R, G, and B respectively, then the brightness component L of I is defined w for: L w =0.299R+0.587G+0.114B a2) Define the bilateral filter as BF: Where ||pq|| is the Euclidean distance between position p and position q on the image; I p Indicates the brightness of position p on the image, I q Indicates the brightness of position q on the image; |I p -I q | represents the absolute value of the brightness difference between position p and position q on the image; and Both represent two-dimensional Gaussian kernels; W p is the normalization factor, ensuring that the sum of pixel weights is 1: Parameter σ s and σ r , respectively controlling the shapes of the spatial weight and amplitude weight functions: increasing the spatial weight σ s , the bilateral filter will smooth out more image details and textures, increasing the amplitude weight σ r , the bilateral filter will be similar to Gaussian filtering; and G σ (x,y) is a two-dimensional Gaussian kernel: Where σ is the standard deviation, x and y are the image space coordinates; a3) Using the characteristics of the bilateral filter, the brightness component of the input image is decomposed into a background texture layer and a detail layer: B=BF[logL w ] D=logL w -B Among them, B is the background texture layer with large-scale texture information, D is the detail layer with small changes; BF is the bilateral filter, L w is the brightness component; a4) Restore the background texture layer and detail layer to normal images: B = 10exp(B) D = 10exp(D) Get the separated large-scale texture background texture layer and small-change detail layer image; The histogram processing is performed on the brightness component background texture layer to obtain a histogram processing result, which is specifically: b1) Perform histogram statistics on the large-scale texture background texture layer image B obtained in step a4), and define the histogram as h(i): h(i)=|{L B (x,y)L B (x,y)=i} Where i=0,...,L-1, |·| represents the number of elements in image B, and L-1 represents the maximum brightness value of image B; b2) Define the mean μ of the histogram h(i) obtained in step b1): Where M, N are the height and width of image B respectively, and i is the brightness level; b3) Define the standard deviation σ of the histogram h(i) obtained in step b1): Where M, N are the height and width of image B respectively, and i is the brightness level; b4) Define t 1 and t 2 are the two segmentation points of the histogram h(i): in, Indicates rounding down, t 1 and t 2 The histogram h(i) is divided into three independent histograms, defined as h l (i) h m (i) and h u (i) h l (i)=h(i),0≤i<t 1 h m (i)=h(i),t 1 ≤i<t 2 h u (i)=h(i),t 2 ≤i<L Where i is the brightness level; Definition 1 , r 2 and r 3 Respectively represent the proportion of each segment of the histogram in the overall histogram: Where M and N are the height and width of image B respectively; b5) For the first segment histogram h l Perform clipping compensation and define the clipping threshold as T l : T l =median(h l (i)) Among them, median(·) represents the median value, and the histogram after clipping is defined as h l '(i): In order not to change h' l (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" l (i) Among them, inc l (i) represents the pixel number function of each gray value compensation in the first segment of the histogram, which is used to improve the brightness of the dark part; res l The sum of the number of pixel values ​​clipped by the first segment of the histogram; b6) For the second segment histogram h m Perform clipping compensation and define the clipping threshold as T m : T m =median(h m (i) Where median(·) represents the median value; the clipped histogram is defined as h m '(i): In order not to change h' m (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" m (i) Among them, res m is the sum of the number of pixel values ​​clipped by the second segment of histogram, which is the average compensation, t 1 and t 2 are the two segmentation points of the histogram h(i); b7) For the third segment histogram h u (i) Perform clipping compensation and define the clipping threshold as T u : T u =median(h u (i)) Among them, median(·) represents the median value, and the clipped histogram is defined as h' u (i) In order not to change h' u (i) The proportion in the entire histogram. The excess part needs to be compensated to the histogram. The compensated histogram is defined as h" u (i) Among them, inc u (i) represents the pixel number function of each gray value compensation of the third segment histogram, which is used to suppress the brightness of the bright part; res u It is the sum of the number of pixel values ​​clipped by the third segment of histogram; b8) Define the clipped and compensated histogram h”(i):

2. According to the method for expanding the dynamic range of fundus images with controllable brightness and detail preservation according to claim 1, It is characterized in that The estimating the average brightness and standard deviation of the brightness of the display device is specifically: c1) Define the segmentation point t of the large-scale texture image B histogram of the brightness component 1 and t 2 The segmentation point mapped to the output large-scale texture image B' is t 1 ' and t 2 ', defines the model average brightness μ of the estimated output image B' m and standard deviation σ m , the split point t is obtained by iteratively solving the equation 1 '; c2) List the calculated split points t' according to the estimated model 1,k The equation f 1 (·): Among them, μ m,k represents the average brightness at the current k-th iteration; and σ m,k is the standard deviation at the current kth iteration; r 1 ,r 2 ,r 3 Indicates the proportion of each segment of histogram in the overall histogram; t' 1,k Indicates the first split point at the current k-th iteration; c3) Standard deviation σ m,k The equation is: where μ m,k-1 represents the average brightness of the k-1th iteration; σ m,k-1 represents the standard deviation of the k-1th iteration; i represents the brightness level; t 2,k 'Indicates the second split point at the current kth iteration; c4) List the calculated split points t' according to the estimated model 2,k The equation is: t’ 2,k =t’ 1,k +2σ m,k c5) At the end of the iteration, let t’ 1 =t’ 1,k t’ 2 =t’ 2,k Thus, the segmentation point mapped to the output large-scale texture image B' is t 1 ' and t 2 '.

3. The method for extending the dynamic range of fundus images with controllable brightness and detail preservation according to claim 2, It is characterized in that Iteratively solve the new segmentation points of the output image histogram, including: d1) Get the average brightness L of the detail layer image D D Its maximum brightness value L maxD : L D =mean(D) L maxD =max(D) Where mean(·) represents the average brightness value, and max(·) represents the maximum brightness value. Then, the average brightness μ of the output image B' of the large-scale texture background texture layer image B can be obtained. m With the maximum brightness value ω L They are: μ m =L d -L D oh L =255-L maxD Among them, L d The average brightness value of the user display device; d2) Define iteration counter k = 1, define maximum number of iterations K = 120, define preset error δ < 10 -3 , define the initial standard deviation σ m,0 =σ, the initial average brightness value of the output image B' is μ m,0 =μ m , calculate t' 1,0 =f 1 (μ m,0 ,σ m,0 ), the iteration starts; d3) Calculate the standard deviation σ of the output image m,k =f2(t' 1,k-1 ,σ m,k-1 ); d4) To adapt the brightness of the display device, define equation Δ: Among them, L' maxB Represents the maximum brightness value of the output background texture image B', μ m,k-1 represents the average brightness at the current k-th iteration; σm,k is the standard deviation at the current k-th iteration; r1, r2, r3 represent the proportion of each segment histogram in the overall histogram; t'1, k represents the first segmentation point at the current k-th iteration; This formula is based on the maximum entropy. When Δ=0, μ m,k The brightness of the mapped image B' obtains the local maximum entropy. The complexity of solving this equation by numerical method is very large. Considering μ m,k The range is from 0 to L maxB 'discrete value, and discard the selection results of low brightness and high brightness, so define μ m,k Find the value of Δ closest to 0 in the range of 30 to 180; at this time, μ m,k is the result obtained by the adaptive brightness method; d5) Update t' 1,k =f 1 (μ m,k ,σ m,k ); d6) If satisfied Or k>K, the iteration ends and the final segmentation point t is output 1 '=t' 1,k , t 2 '=t 1 '+2σ m,k ; Otherwise, let k=k+1 and go to step d3).

4. The method for extending the dynamic range of fundus images with controllable brightness and detail preservation according to claim 3, It is characterized in that The solution of the corresponding mapping curve is specifically: e1) Define the cumulative density function cdf(·) of the histogram: Where i is the gray level; e2) Define the mapping from the image B of the large texture background texture layer dynamic range [0, D-1] to the new dynamic range [0, ω L ]’s output background texture image B’’s mapping curve function T(·): Among them, t 1 and t 2 are the two segmentation points of the histogram h(i); L is the maximum brightness of the output background texture image B' e3) Define the output image L after mapping B’ (·): L B' (x,y)=T(L B (x,y)), Among them, L B (x, y) represents the grayscale value of each pixel of the original background texture image B.

5. The method for extending the dynamic range of fundus images with controllable brightness and detail preservation according to claim 4, It is characterized in that The luminance component background texture layer of the image with dynamic range expansion is superimposed with the luminance component detail layer, and then fused with the chrominance component to obtain the final output fundus image, specifically: f1) Define the new brightness component image after the large texture background texture layer image B' and the detail layer image D are superimposed as L w ': L' w =L B' +L D Among them, L B’ represents the large texture base image after the dynamic range is extended, L D Represents a detail layer image; f2) The brightness component image L after the dynamic range is expanded obtained in step f1) w 'After fusion with the chroma and saturation components, an extended dynamic range fundus image is obtained with brightness matching the brightness value of the user's display device and detail preserved.

6. A brightness controllable detail-preserving fundus image dynamic range expansion system, used in the brightness controllable detail-preserving fundus image dynamic range expansion method according to any one of claims 1 to 5, It is characterized in that include: A data acquisition module, used for acquiring fundus images and displaying device brightness; A preprocessing module extracts brightness component and chrominance component from the fundus image, performs bilateral filter layer decomposition on the brightness component, and obtains a brightness component background texture layer and a brightness component detail layer; A histogram processing module performs a histogram shear compensation process on the brightness component background texture layer to obtain a histogram processing result; An estimation module estimates the average brightness and standard deviation of the background texture layer image for the brightness of the display device; A mapping curve solving module, used to solve a corresponding mapping curve, and realize dynamic range expansion of a background texture layer of an image brightness component based on the mapping curve; The final output module superimposes the background texture layer of the dynamic range expanded image brightness component with the brightness component detail layer, and then fuses them with the chrominance component to obtain the final output fundus image.