OCT image adaptive contrast enhancement method

By performing grayscale normalization on OCT images and adaptively determining the upper and lower limits of target grayscale, a Sigmoid function is constructed for adaptive contrast enhancement. This solves the problem of balancing enhancement effect and practicality in existing technologies, and achieves efficient and interpretable image enhancement.

CN121998886AActive Publication Date: 2026-05-08江苏富翰医疗产业发展有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610457691.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-09
Publication Date
2026-05-08
Estimated Expiration
2046-04-09

AI Technical Summary

Technical Problem

Existing OCT image enhancement techniques struggle to strike a good balance between enhancement effectiveness and practicality. In particular, global mapping methods have fixed parameters that are independent of image content, leading to amplification of noise in dark areas or loss of detail in bright areas. Data-driven methods rely on high-quality paired training data and have high computational complexity.

Method used

By acquiring OCT images and normalizing them to a preset grayscale range, the upper and lower limits of the target grayscale are determined based on grayscale distribution statistics. A nonlinear mapping function based on the Sigmoid function is constructed and applied pixel by pixel to the normalized image to generate an enhanced image, which adaptively distinguishes between effective signals and background noise.

Benefits of technology

It achieves adaptive contrast enhancement, effectively distinguishes effective signals from background noise, has high computational efficiency, can run in real time on the CPU, has good generalization ability and robustness, and improves the signal-to-noise ratio and contrast-to-noise ratio of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121998886A_ABST
    Figure CN121998886A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and provides an OCT image adaptive contrast enhancement method, and the method comprises the steps: obtaining an OCT image, normalizing the OCT image to a preset gray interval, and obtaining a normalized image; according to gray level distribution statistical information of the normalized image, a target gray level upper limit value used for eliminating an overexposure area in the OCT image and a target gray level lower limit value used for eliminating a background noise area in the OCT image are determined, an enhancement function based on a Sigmoid function is constructed, and a definition domain of the enhancement function is limited by the target gray level upper limit value and the target gray level lower limit value; the output value is used for representing the enhanced pixel gray scale; and acting the enhancement function on the normalized image pixel by pixel to generate an enhanced image. According to the method, while the middle gray contrast is stretched, a smooth Sigmoid curve is adopted, a definition domain is limited in an effective signal interval, dark part noise and bright part details are protected, and therefore the enhancement effect and practicability are both considered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an adaptive contrast enhancement method for OCT images. Background Technology

[0002] Optical coherence tomography (OCT) acquires tomographic images of tissues such as the retina through the principle of low-coherence optical interference. An imaging system created by OCT technology consists of a light source, an interferometer, and a detector, outputting a grayscale image reflecting the intensity of backscattering from the tissue. In clinical diagnosis, doctors expect images to clearly present the subtle structural differences between different tissue layers while suppressing background noise. This places clear demands on the adaptability and fidelity of contrast enhancement algorithms.

[0003] Some image enhancement techniques include a power-law transform-based global mapping method, which applies a uniform nonlinear transformation to the entire image using pre-defined fixed parameters; and a data-driven enhancement scheme that constructs a deep neural network and trains an end-to-end mapping model from the original image to the enhancement result using a large-scale paired dataset.

[0004] Global mapping methods, due to their fixed parameters and lack of relation to image content, struggle to distinguish between effective signals and background noise. When stretching intermediate grayscale, they can easily lead to amplification of noise in dark areas or loss of detail in bright areas. Data-driven methods rely on high-quality paired training data, and their mapping rules are implicit in the network parameters and lack explicit mathematical expression. Furthermore, the inference process is computationally intensive.

[0005] In conclusion, image enhancement technology struggles to balance enhancement effectiveness with practicality. Summary of the Invention

[0006] This application provides an OCT image adaptive contrast enhancement method to solve the problem that image enhancement technology is difficult to balance enhancement effect and practicality.

[0007] This application provides an adaptive contrast enhancement method for OCT images, including: Obtain an OCT image, normalize the OCT image to a preset grayscale range, and obtain a normalized image; Based on the grayscale distribution statistics of the normalized image, a target grayscale upper limit and a target grayscale lower limit are determined. The target grayscale upper limit is used to exclude overexposed areas in the OCT image, and the target grayscale lower limit is used to exclude background noise areas in the OCT image. An enhancement function is constructed, which is a non-linear mapping function based on the Sigmoid function. The domain of the enhancement function is defined by the upper limit and lower limit of the target gray level. The output value of the enhancement function is used to characterize the enhanced pixel gray level. The enhancement function is applied pixel-by-pixel to the normalized image to generate an enhanced image.

[0008] In some feasible embodiments, determining the target grayscale upper limit and target grayscale lower limit based on the grayscale distribution statistics of the normalized image includes: Calculate the grayscale histogram of the normalized image; The cumulative distribution function is calculated based on the gray-level histogram; When the cumulative distribution function reaches a first preset threshold, the corresponding gray value is determined as the target gray value lower limit. When the cumulative distribution function reaches the second preset threshold, the corresponding gray value is determined as the target gray upper limit value.

[0009] By using the cumulative distribution function of the gray-level histogram to determine the upper and lower limits, the enhancement interval is based entirely on the image content itself, thus achieving adaptive differentiation between effective signals and background noise.

[0010] In some feasible embodiments, the first preset threshold is 0.5, and the second preset threshold is any value between 0.99 and 0.995, to separate background noise and overexposed areas respectively, ensuring that the enhancement function only acts on the effective signal range.

[0011] In some feasible embodiments, after determining the upper limit and lower limit of the target grayscale, the method further includes: Obtain the difference between the target grayscale upper limit value and the target grayscale lower limit value; When the difference is less than a preset width threshold, the quality of the OCT image is marked as abnormal. In the abnormal state, the upper limit and lower limit of the target grayscale are replaced with a preset default range.

[0012] When the effective range is too narrow, it is replaced with a preset default range to avoid enhancement failure caused by extreme images and ensure the robustness of the algorithm.

[0013] In some feasible embodiments, after determining the upper limit and lower limit of the target grayscale, the method further includes: Obtain the maximum grayscale value of the normalized image; When the maximum grayscale value is less than the preset black threshold, the OCT image is determined to be a black image; The normalized image is output as the enhanced image.

[0014] Detecting completely black images and directly outputting the original image prevents invalid enhancement and improves the method's practicality under abnormal input conditions.

[0015] In some feasible embodiments, the construction of the enhancement function includes: Obtain the standard Sigmoid function; The function value of the standard Sigmoid function at zero is adjusted to zero to obtain the Sigmoid function with zero point set to zero. The enhancement function is obtained by normalizing the value of the zero-point-zeroed Sigmoid function at the target grayscale upper limit to a unit amplitude.

[0016] An explicit enhancement function is constructed by adjusting the zero position and normalizing the amplitude of the standard sigmoid function. This function is interpretable and computationally inexpensive, reducing the inference burden of black-box models.

[0017] In some feasible embodiments, adjusting the function value of the standard Sigmoid function at zero to zero to obtain a zero-point Sigmoid function includes: Obtain the midpoint value between the target grayscale upper limit value and the target grayscale lower limit value; Using the midpoint value as the offset of the independent variable, the independent variable of the standard Sigmoid function is subtracted from the midpoint value to obtain the Sigmoid function with the offset independent variable; The zero-point offset is obtained by taking the value of the Sigmoid function after the offset of the independent variable when the independent variable is zero, and then subtracting the zero-point offset from the Sigmoid function after the offset of the independent variable to obtain the Sigmoid function with the zero point set to zero.

[0018] By offsetting the independent variable by the midpoint of the interval and subtracting the zero offset, the enhancement function is made symmetrical and the zeros are aligned, ensuring the smoothness of the mapping and the fidelity of the structure.

[0019] In some feasible embodiments, the step of normalizing the function value of the zero-point-zeroed Sigmoid function at the target grayscale upper limit to a unit amplitude to obtain the enhancement function includes: Calculate the value of the zero-point-zeroed Sigmoid function at the upper limit of the target gray level, and use it as the amplitude normalization factor; Dividing the zero-point-zeroed Sigmoid function by the amplitude normalization factor yields an intermediate function with a range of 0-1 on a closed interval. Obtain the preset minimum and maximum output grayscale values; After summing the intermediate function with the minimum output gray value, multiplying it by the difference between the maximum output gray value and the minimum output gray value, an enhancement function with a value range of a closed interval from the minimum output gray value to the maximum output gray value is obtained.

[0020] By normalizing the amplitude and performing linear transformation, the output is mapped to a specified grayscale range, achieving a controllable enhancement of the value range, which facilitates clinical display and subsequent processing.

[0021] In some feasible embodiments, the standard Sigmoid function includes a kurtosis parameter, which controls the steepness of the enhancement function between the target grayscale lower limit and the target grayscale upper limit; the kurtosis parameter is negatively correlated with the difference between the target grayscale upper limit and the target grayscale lower limit.

[0022] By introducing a steepness parameter and making it negatively correlated with the interval width, the enhancement intensity is adaptively adjusted, thereby improving contrast while suppressing noise amplification.

[0023] In some feasible embodiments, the kurtosis parameter is determined in the following manner: Obtain the difference between the target grayscale upper limit value and the target grayscale lower limit value; Get the preset constant; The ratio of the preset constant to the difference is determined as the steepness parameter.

[0024] The steepness parameter is calculated as the ratio of a preset constant to the interval width, enabling automatic parameter determination without manual adjustment, thus enhancing practicality and consistency.

[0025] As can be seen from the above technical solutions, this application provides an adaptive contrast enhancement method for OCT images. The method acquires an OCT image, normalizes the OCT image to a preset grayscale range, obtaining a normalized image. Then, based on the grayscale distribution statistics of the normalized image, it determines a target upper grayscale limit and a target lower grayscale limit. The target upper grayscale limit is used to exclude overexposed areas in the OCT image, and the target lower grayscale limit is used to exclude background noise areas in the OCT image. An enhancement function is constructed, which is a non-linear mapping function based on the Sigmoid function. The domain of the enhancement function is defined by the target upper grayscale limit and the target lower grayscale limit, and the output value of the enhancement function is used to characterize the enhanced pixel grayscale. The enhancement function is applied pixel-by-pixel to the normalized image to generate an enhanced image. This method stretches the intermediate grayscale contrast while using a smooth Sigmoid curve with its domain limited to the effective signal range, reasonably protecting both dark noise and bright details, thus balancing enhancement effect and practicality. Attached Figure Description

[0026] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 The image after histogram equalization processing; Figure 2 A schematic flowchart illustrating the OCT image adaptive contrast enhancement method provided in this application embodiment; Figure 3 A flowchart illustrating the process after determining the upper and lower limits of the target grayscale, as provided in this application embodiment; Figure 4 A comparison image of the OCT image and the enhanced image of the first scene provided in the embodiments of this application; Figure 5 A comparison image of the overlaid image and the overlaid enhanced image of the first scene provided in the embodiments of this application; Figure 6 A comparison image of a denoised image and a denoised enhanced image of a first scene provided in an embodiment of this application; Figure 7 A comparison diagram of the OCT image and the enhanced image of the second scene provided in the embodiments of this application; Figure 8 A comparison image of the overlaid image and the overlaid enhanced image of the second scene provided in the embodiments of this application; Figure 9 A comparison image of a denoised image and a denoised enhanced image of a second scene provided in an embodiment of this application; Figure 10 A comparison diagram of the OCT image and the enhanced image of the third scene provided in the embodiments of this application; Figure 11 A comparison image of the overlay image and the overlay enhancement image of the third scene provided in the embodiments of this application; Figure 12 A comparison image of the denoised image and the denoised enhanced image of the third scene provided in the embodiments of this application. Detailed Implementation

[0028] The embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following examples do not represent all embodiments consistent with this application.

[0029] The process of image contrast enhancement involves a variety of methods, such as the global mapping method based on power-law transformation. Specifically, Gamma correction uses a preset function model with fixed shape parameters to perform a uniform nonlinear transformation on each pixel of the entire image, which is independent of the pixel's spatial location.

[0030] Taking Gamma correction as an example, first, the original OCT image is acquired, and then, according to the preset fixed... The value is obtained by performing the same exponentiation operation on each pixel in the image. The entire transformation process is a point operation and does not involve the analysis or judgment of the image content.

[0031] because The values ​​are preset, and regardless of whether the input image is bright or dark, or whether the contrast is high or low, all images are processed by the same mapping rules. The calculation process is simple, involving only exponential calculations. Therefore, it has extremely high execution efficiency and can complete the processing of the entire image in a very short time.

[0032] However, the following problems exist: First, the enhancement strategy is completely disconnected from the image content. Due to the use of a global function with fixed parameters, it is unable to distinguish between effective tissue signals and background noise in the image, nor can it cope with differences in image grayscale distribution caused by different imaging depths, different tissue types, or different devices.

[0033] For example, a setting for a normal brightness retinal image. When processing images of deep choroidal tissue with severe signal attenuation, this value may not effectively improve the visibility of weak contrast areas, or it may even excessively amplify noise.

[0034] Second, the power-law function shape lacks fine control when stretching the overall contrast. It often leads to a significant amplification of noise in the dark areas or a loss of saturation in the bright areas while increasing the contrast in the midtone areas.

[0035] Third, it cannot achieve a good balance between enhancing contrast and maintaining structural authenticity. Its enhancement effect heavily depends on prior experience in setting parameters, resulting in poor robustness and failing to meet the complex and ever-changing actual enhancement needs in clinical practice.

[0036] Contrast enhancement can also be performed based on data-driven enhancement schemes, such as deep neural networks, which utilize a complex deep neural network model trained on a large amount of data as an end-to-end mapping function from low-quality images to high-quality images.

[0037] The process comprises two phases: offline training and online inference. During training, a dataset with a large amount of paired data is constructed. Each dataset includes an original OCT image and a corresponding high-quality reference image. The reference images need to be manually labeled or obtained through other high-precision equipment, making their construction extremely costly. The original image is then input into a deep neural network. The network performs operations such as multi-layer convolution, non-linear activation, upsampling, and downsampling to output an enhanced image. This output is compared with the reference image, and a loss function is calculated. The network then uses a backpropagation algorithm to adjust millions or even more weight parameters layer by layer. After hundreds of thousands of iterations, the network gradually learns the mapping relationship from the original image to the enhanced image. This mapping relationship is set within the network's weight parameters and does not have an explicit mathematical expression. During inference, the OCT image to be processed is input into the trained network. After forward propagation, the network directly outputs the enhanced image.

[0038] This method has the following problems: First, it is highly dependent on large-scale, high-quality paired training data, and obtaining an ideal enhancement reference standard for OCT images is difficult and costly in clinical practice.

[0039] Second, deep learning models are black box models, and their internal decision-making logic is uninterpretable. The way to adjust contrast and suppress noise during the enhancement process lacks clear physical or visual meaning, making it difficult for clinicians to understand and trust the results. It also hinders the debugging and improvement of enhancement failure cases.

[0040] Third, such models have high computational complexity and long inference time, requiring dedicated hardware acceleration such as graphics processing units (GPUs) to achieve real-time performance, which increases the cost and difficulty of system integration and deployment.

[0041] Fourth, the model performance is strongly correlated with the distribution of training data and has a weak generalization ability. When applied to images acquired by OCT devices from different manufacturers or of different models, or to new pathological types, the enhancement effect may decrease significantly, or even introduce unpredictable artifacts.

[0042] Some solutions are based on histogram equalization, which indirectly controls the contrast enhancement level through a flatness factor and relies on weighted histograms and histogram equalization to generate implicit mapping curves. Figure 1 The image is after histogram equalization processing. As you can see, the foreground is not prominent and there is a lot of noise.

[0043] In conclusion, none of the above methods can achieve a good balance between enhanced effectiveness and practicality.

[0044] To address the aforementioned issues, some embodiments of this application provide an adaptive contrast enhancement method for OCT images. This method acquires and normalizes OCT images, eliminating dimensional differences between different devices. Based on the grayscale distribution statistics of the normalized image, it adaptively determines the upper and lower limits of the target grayscale. The lower limit of the target grayscale is used to exclude background noise areas, and the upper limit of the target grayscale is used to exclude overexposed areas. This method overcomes the shortcomings of global mapping methods, which have fixed parameters and are unrelated to image content. It makes the enhancement range completely dependent on the statistical characteristics of the image itself, thereby effectively distinguishing effective signals from background noise.

[0045] An explicit nonlinear mapping function based on the Sigmoid function is constructed, and its domain is limited to the upper and lower limits of the target grayscale. This explicit mathematical expression avoids the black-box problem of mapping rules being implicitly embedded in network parameters, as is common in deep learning methods, making the enhancement process interpretable and debuggable. The enhancement function is then applied pixel-by-pixel to the normalized image to generate the enhanced image. This pixel-by-pixel operation is a pixel-level point operation with a computational complexity of only O(N), requiring no large-scale matrix operations or GPU acceleration. The inference process has low computational cost and can run in real-time on a CPU.

[0046] like Figure 2 As shown, the procedure includes the following steps S100-S400.

[0047] S100: Acquire the OCT image, normalize the OCT image to a preset grayscale range, and obtain the normalized image.

[0048] Among them, the OCT image is the original OCT image, which is acquired by the OCT device. Its size can be H×W pixels. The original grayscale value is an integer type, and the value range depends on the quantization bit depth of the device, such as 8 bits, 12 bits or 16 bits.

[0049] To eliminate the dimensional differences caused by different acquisition devices, the acquired OCT images are normalized to a preset grayscale range. In this embodiment, the preset grayscale range is a closed range of 0-1.

[0050] In some embodiments, the normalization process is as follows: First, the data type of the original OCT image is converted to floating-point type, and then the minimum and maximum gray values ​​of the image are obtained. The normalization formula is as follows: ; in, It is a very small constant to prevent division by zero. Let x be the pixel gray value at position x in the normalized image, and its value ranges from [0,1]. This represents the pixel grayscale value at position x in the OCT image. The minimum grayscale value in the OCT image. This represents the maximum grayscale value in the OCT image.

[0051] Specifically, to prevent division by zero errors, a preset minimum constant is obtained. The grayscale value range is calculated based on the minimum and maximum grayscale values, and this range is summed with the minimum constant to obtain the normalized denominator. The difference between the grayscale value of each pixel in the OCT image and the minimum grayscale value is divided by this normalized denominator to obtain the normalized image. After the above operations, the grayscale value of each pixel in the normalized image falls within the [0,1] interval, and the dimensional differences are eliminated.

[0052] It should be noted that those skilled in the art may also use other normalization methods, such as mapping to [0,255], but the [0,1] interval is beneficial for the simplicity of mathematical operations.

[0053] S200: Determine the upper limit and lower limit of the target gray level based on the gray level distribution statistics of the normalized image.

[0054] The normalized image is the same as the OCT image, still including the background noise region, the effective tissue signal region, and the overexposed region. The background noise region corresponds to the part with lower gray values, located on the left side of the histogram. It is mainly composed of system noise, speckle noise, or background signals from non-tissue regions and does not contain effective anatomical structural information.

[0055] The effective tissue signal area corresponds to the part with moderate gray value, located in the middle area of ​​the histogram. These pixels reflect the backscattering intensity of the actual retinal tissues (such as the nerve fiber layer, photoreceptor layer, choroid, etc.) and contain the key structural information required for diagnosis.

[0056] Overexposed areas correspond to the parts with higher gray values ​​and are located on the right side of the histogram. These pixels are usually caused by specular reflection, sensor saturation, or highly reflective interfaces (such as the posterior vitreous membrane and retinal pigment epithelium). The pixel values ​​are close to saturation and do not contain resolvable tissue details.

[0057] After obtaining the normalized image, two key thresholds are adaptively determined based on the gray-level distribution statistics of the image. The target gray-level lower limit is used to exclude background noise areas in the OCT image, and the target gray-level upper limit is used to exclude overexposed areas in the OCT image. This allows the enhancement strategy to rely entirely on the image content itself, avoiding the blindness of fixed parameter methods.

[0058] In some embodiments, a grayscale histogram of a normalized image is calculated; a cumulative distribution function is calculated based on the grayscale histogram; when the cumulative distribution function reaches a first preset threshold, the corresponding grayscale value is determined as the target lower grayscale limit; when the cumulative distribution function reaches a second preset threshold, the corresponding grayscale value is determined as the target upper grayscale limit.

[0059] A grayscale histogram is used to count the number of pixels at each gray level in an image. Based on this histogram, a cumulative distribution function is calculated. The cumulative distribution function describes the cumulative proportion of pixels from the lowest gray level to the current gray level. The cumulative distribution function is shown in the following formula: ; in, Let i be the probability of gray level i. It is a grayscale index.

[0060] When the cumulative distribution function reaches the first preset threshold, the corresponding gray value is determined as the target gray value lower limit.

[0061] In this embodiment, the first preset threshold is 0.5. That is, when the cumulative distribution function value first reaches or exceeds 0.5, the gray value corresponding to that moment is taken as the target gray value lower limit (denoted as a). The basis for selecting the first preset threshold is that in a typical OCT image, background noise usually occupies 30%-50% of the area on the left side of the histogram. Taking the median of 0.5 can robustly separate the noise area from the effective tissue signal area. 'a' can exclude background noise below this value to ensure that subsequent enhancement operations only apply to pixels containing real tissue information.

[0062] In this embodiment, the second preset threshold is any value between 0.99 and 0.995. For example, when the cumulative distribution function value first reaches or exceeds 0.99, the gray value corresponding to that moment is taken as the target gray upper limit (denoted as b). The basis for selecting this threshold is that the top 1% of extremely bright pixels in the OCT image are often caused by specular reflection or sensor saturation, do not contain useful information, and will stretch the effective gray range. b is used to exclude a very small number of overexposed points or extremely high light noise, ensuring that the effective signal mainly falls within the interval [a, b].

[0063] By using the percentile method based on the cumulative distribution function, the enhancement interval can be adaptively determined. For input images with different brightness and contrast, the determined values ​​of a and b will change accordingly, thereby matching the enhancement strategy with the content of the original OCT image.

[0064] In actual clinical applications, OCT images may exhibit extreme anomalies. Therefore, this embodiment introduces two anomaly handling mechanisms after determining the upper and lower limits of the target grayscale.

[0065] like Figure 3As shown, the first set of anomaly handling mechanisms addresses the situation where the effective grayscale range is too narrow. In some embodiments, the difference between the target grayscale upper limit and the target grayscale lower limit is obtained. When the difference is less than a preset width threshold, the quality of the OCT image is marked as abnormal. In the abnormal state, the target grayscale upper limit and the target grayscale lower limit are replaced with a preset default range.

[0066] For example, ba is calculated, and it is determined whether the difference is less than a preset width threshold. In this embodiment, the preset width threshold is 0.01. When the difference is less than 0.01, the effective range is considered too narrow, and reliable contrast enhancement cannot be performed. At this time, the upper and lower limits of the target grayscale are replaced with a preset default range. The default range is preset based on the statistical results of a large number of normal OCT images, for example, it can be set to [0.1, 0.9]. After the replacement is completed, the enhancement function construction step is executed. Through this mechanism, even if the quality of the input image is extremely abnormal, a reasonable enhancement result can still be output.

[0067] like Figure 3 As shown, the second set of anomaly handling mechanisms is for the case where the image is almost completely black. In some embodiments, the maximum gray value of the normalized image is obtained; when the maximum gray value is less than the preset black threshold, the OCT image is determined to be a completely black image; and the normalized image is output as an enhanced image.

[0068] For example, in this embodiment, the preset threshold for total black is 0.1. When the maximum grayscale value is less than 0.1, the OCT image is determined to be a total black image. At this time, no enhancement operation is performed, and the normalized image is directly output as the enhanced image. Since there are no effective tissue signals in a total black image, any enhancement operation cannot extract useful information and may instead amplify noise or produce artifacts. Therefore, directly returning the original image is the most reasonable processing method.

[0069] It should be noted that there is no strict order between the two exception handling steps mentioned above, and those skilled in the art can adjust their execution order according to actual needs.

[0070] S300: Construct the enhancement function, which is a non-linear mapping function based on the Sigmoid function.

[0071] After determining the upper and lower limits of the target grayscale and handling abnormal situations, an enhancement function is constructed. The enhancement function is a non-linear mapping function based on the Sigmoid function. Its domain is defined by the upper limit of the target grayscale value b and the lower limit of the target grayscale value a. Its output value is used to characterize the enhanced pixel grayscale.

[0072] The construction of the enhancement function consists of three stages: obtaining the standard Sigmoid function, zero-point adjustment, amplitude normalization, and target range adjustment. In some embodiments, the standard Sigmoid function is obtained; the function value of the standard Sigmoid function at zero point is adjusted to zero to obtain a zero-point-normalized Sigmoid function; the function value of the zero-point-normalized Sigmoid function at the target grayscale upper limit is normalized to unit amplitude to obtain the enhancement function. These three stages are explained below.

[0073] In the stage of obtaining the standard Sigmoid function, the standard Sigmoid function... The mathematical expression for it is as follows: ; in, The translation parameter represents the center point of the Sigmoid function. This is the steepness parameter.

[0074] The function is monotonically increasing, smooth (with continuous derivatives of any order), and has a range of (0,1), making it well-suited for contrast enhancement.

[0075] In some embodiments, the standard Sigmoid function includes a steepness parameter, denoted in this embodiment as . Its function is to control the steepness of the curve. The smaller the value, the faster the curve rises and the more obvious the contrast enhancement, but noise may also be amplified. The larger the slope, the smoother the curve and the gentler the enhancement. This slope parameter is negatively correlated with the difference between the upper and lower limits of the target grayscale value.

[0076] Regarding steepness parameters In some embodiments, the adaptive determination involves obtaining the difference between the upper limit of the target grayscale value and the lower limit of the target grayscale value; obtaining a preset constant; and determining the ratio of the preset constant to the difference as the kurtosis parameter.

[0077] Specifically, first, obtain the difference between the target grayscale upper limit value b and the midpoint c, i.e., calculate (bc). This difference is equal to half the difference between the target grayscale upper limit value and the target grayscale lower limit value, i.e., (bc) = (ba) / 2. Then, obtain a preset constant k, for example, k = 10. The ratio of (bc) to k is determined as the kurtosis parameter, i.e. .

[0078] This setting ensures that the enhancement function changes smoothly within the interval [c, b]. When (bc) is large, The corresponding value is relatively large, resulting in a smoother enhancement curve and avoiding excessive amplification of noise; when (bc) is small, The corresponding curve is smaller, resulting in a steeper curve and a more pronounced stretch of contrast.

[0079] This adaptive design enables the application to automatically adjust the enhancement intensity based on the image's own grayscale distribution without manual intervention. The preset constant k can be adjusted according to actual application requirements; for example, for images with high noise levels, the value of k can be appropriately reduced. Increasing the value of k results in a gentler enhancement; for images with sufficient signal but low contrast, the k value can be appropriately increased to... The reduction makes the enhancement more obvious.

[0080] During the zero-point adjustment phase, the standard Sigmoid function has a value of S(0) = 1 / 2 when the independent variable is zero. To ensure that the enhanced function outputs zero at the midpoint of the effective grayscale range, the following operations are required. In some embodiments, the midpoint value between the target upper grayscale limit and the target lower grayscale limit is obtained; using the midpoint value as the independent variable offset, the independent variable of the standard Sigmoid function is subtracted from the midpoint value to obtain the Sigmoid function with the independent variable offset; the function value of the Sigmoid function with the independent variable offset when the independent variable is zero is obtained as the zero-point offset, and the zero-point offset is subtracted from the Sigmoid function with the independent variable offset to obtain the Sigmoid function with the zero point set to zero.

[0081] Specifically, using the midpoint c as the offset of the independent variable, the standard Sigmoid function's independent variable is subtracted from c and then divided by the kurtosis parameter. ,get Subtract S(0) = 1 / 2 from the function, that is... It is written as the following formula: .

[0082] At this point, when x=c, The boundary condition that the output is zero at the midpoint of the interval is satisfied.

[0083] In the amplitude normalization and target range adjustment stages, in some embodiments, the function value of the zero-point-zeroed Sigmoid function at the target grayscale upper limit is calculated as the amplitude normalization factor; the zero-point-zeroed Sigmoid function is divided by the amplitude normalization factor to obtain an intermediate function with a value range of a closed interval from 0 to 1; a preset minimum output grayscale value and a preset maximum output grayscale value are obtained; the intermediate function and the minimum output grayscale value are summed and multiplied by the difference between the maximum and minimum output grayscale values ​​to obtain an enhancement function with a value range of a closed interval from the minimum to the maximum output grayscale value.

[0084] Specifically, calculate the value of the Sigmoid function at the target grayscale upper limit x=h, i.e., see the following formula: .

[0085] Since h > c, therefore (hc) / σ > 0, and 1 / (1+e^{-(hc) / σ}) > 1 / 2, hence If it is a positive number, Divide by This yields an intermediate function whose range is a closed interval from 0 to 1. ,at this time, The following boundary conditions must be met: when x = c, When x = h, After the above operations, the effective grayscale range [c,h] is mapped to the range [0,1].

[0086] Finally, the target range is adjusted. In clinical applications, it is necessary to map the enhanced grayscale values ​​to a specific output grayscale range. In this embodiment, the minimum output grayscale value is set to 1, and the maximum output grayscale value is set to r, where r can be set according to the bit depth of the display device. For example, for an 8-bit grayscale image, r = 255. Therefore, the intermediate function... Perform the following linear transformation: ; Will Substituting the expression, we obtain the complete form of the enhancement function, as shown in the following formula: ; The enhancement function satisfies the following mathematical property: Boundary condition verification: When x=c, 1 / (1+e) 0 ) - 1 / 2 = 0, the numerator is zero, therefore: ; When x = h, the numerator is the same as 1 / (1+e^{-(hc) / σ})-1 / 2 in the denominator. Since the numerator and denominator are equal, therefore: .

[0087] Monotonicity verification: Let ,but: ; Taking the derivative of f(x) gives the following equation: ; because And r-1>0, S(t0)-S(0)>0, σ>0, therefore df / dx>0, the function is strictly monotonically increasing.

[0088] Smoothness verification: Since the Sigmoid function and its derivatives are continuous, after linear transformation and composition operation, f(x) still has continuous derivatives of any order, and the enhanced image will not show step artifacts.

[0089] Center stretching characteristics: Near the midpoint x=c of the effective grayscale range, the derivative of the enhancement function is larger, which can preferentially enhance the tissue details in the medium grayscale area.

[0090] S400: The enhancement function is applied pixel-by-pixel to the normalized image to generate the enhanced image.

[0091] After constructing the enhancement function and adaptively determining the kurtosis parameter, the enhancement function is applied pixel by pixel to the normalized image to generate the enhanced image.

[0092] Specifically, for each pixel in the normalized image, the gray value x of that pixel is obtained. Since the gray value range of the normalized image is in the interval [0,1], the domain of the enhancement function in this application is [a,b].

[0093] To handle pixels with gray values ​​less than a or greater than b, this embodiment adopts a segmented mapping strategy. For pixels with gray values ​​less than a that belong to the background noise region, they are mapped to the minimum output gray value, i.e., 1. For pixels with gray values ​​greater than b that belong to the overexposed region, they are mapped to the maximum output gray value, i.e., r. For pixels with gray values ​​in the interval [a, b], the output gray value is calculated according to the enhancement function f(x).

[0094] Since the enhancement function f(x) is monotonically increasing and satisfies f(a)=1 and f(b)=r after boundary adjustment, the above segmented mapping strategy can ensure that the gray-level order of the entire image remains unchanged, while effectively suppressing the interference of noise and overexposed areas.

[0095] After applying the enhancement function to all pixels, a new image is obtained, namely the enhanced image. The enhanced image has the following characteristics: the contrast of the effective organized area is significantly improved, and the mid-grayscale details are clearer; the background noise area is compressed to the low grayscale range, so it will not interfere with the observation; the overexposed area is limited to the high grayscale range, so as not to produce saturation artifacts; the entire enhancement process only involves pixel-level function calculations, with a computational complexity of O(N), where N is the total number of pixels, so it can run in real time on a central processing unit (CPU).

[0096] In summary, the OCT image adaptive contrast enhancement method provided in this embodiment achieves interpretable and adaptive contrast enhancement through steps such as adaptively determining the effective grayscale range, constructing an improved Sigmoid enhancement function, and pixel-by-pixel mapping. It requires no training data, has high computational efficiency, can run in real time on a CPU, and has good generalization ability and robustness.

[0097] The processing efficiency and enhancement effect of this application are illustrated by the following data: First, processing a single OCT image with a size of 920 pixels × 920 pixels takes approximately 0.04 seconds; Second, to evaluate the robustness of the algorithm, three sets of OCT images with medium, strong, and weak signal intensities were selected for testing, and the quantization results are shown in Table 1 below: Table 1 Quantification Results

[0098] As shown in Table 1, after processing by the method of this application, the signal-to-noise ratio of the image is improved by an average of 105.20% (mean), with a standard deviation of 23.12%. This indicates that the improvement effect fluctuates to some extent among different images, but the minimum improvement is 56.84%, the maximum improvement is 149.04%, and the median improvement is 102.23%.

[0099] The image's noise level was improved by an average of 111.25% (mean), with a standard deviation of 33.82%. The minimum improvement was 41.04%, the maximum improvement was 165.31%, and the median improvement was 120.94%.

[0100] The average signal-to-noise ratio (SNR) of the OCT images was 2.2733 with a standard deviation of 0.8128. The average SNR of the processed images was 4.7581 with a standard deviation of 2.0396. This shows that the SNR of the enhanced images was significantly improved.

[0101] In summary, after applying this application, the signal-to-noise ratio and contrast-to-noise ratio of OCT images are significantly improved, and the signal-to-noise ratio of the enhanced images is significantly better than that of OCT images.

[0102] Combination Figures 4-12 The following is an explanation of the effect comparison diagram of this application.

[0103] See Figure 4 , Figure 4 In the image, 'a' represents the original OCT image. Figure 4 In Figure b, the enhanced image obtained after applying the method of this application to the OCT image is shown. It can be seen that after processing, the overall layers of the enhanced image are more distinct and the boundaries of the tissue layers are clearer.

[0104] See Figure 5 , Figure 5 In the image, 'a' represents the overlay image. Figure 5 In Figure b, the enhanced image is obtained after applying the method of this application to the superimposed image. It can be seen that the average brightness of the image is adjusted and the internal contrast of the structure is improved after processing.

[0105] See Figure 6 , Figure 6 In the image, 'a' represents the denoised image. Figure 6 In Figure b, the enhanced image is obtained after applying the method of this application to the denoised image. It can be seen that the texture of the effectively organized image is more prominent after processing.

[0106] Figures 7-9 For comparison in another scenario, Figure 7 a, Figure 8 a, Figure 9 In the image, 'a' represents the original image, the overlaid image, and the denoised image, respectively. Figure 7 b, Figure 8 b, Figure 9 b represents the respective enhanced images. In these comparisons, the processed images all exhibit adaptability, and images with different brightness features are all enhanced.

[0107] Figures 10-12 For comparison in another scenario, Figure 10 a, Figure 11 a, Figure 12 In the image, 'a' represents the original image, the overlaid image, and the denoised image, respectively. Figure 10 b, Figure 11 b, Figure 12 b represents the enhanced image. In the processed image, the contrast of the main areas of interest is improved, the details of the extremely dark and extremely bright areas are preserved, and no artifacts caused by over-enhancement are observed.

[0108] The comparison images above show that this application can adapt to different images, effectively improve the visibility of the main structure, and the processing is stable, achieving a balance between enhancement effect and practicality.

[0109] Similar parts between the embodiments provided in this application can be referred to mutually. The specific implementation methods provided above are only a few examples under the overall concept of this application and do not constitute a limitation on the scope of protection of this application. For those skilled in the art, any other implementation methods extended from the solution of this application without creative effort shall fall within the scope of protection of this application.

Claims

1. An adaptive contrast enhancement method for OCT images, characterized in that, include: Obtain an OCT image, normalize the OCT image to a preset grayscale range, and obtain a normalized image; Based on the grayscale distribution statistics of the normalized image, a target grayscale upper limit and a target grayscale lower limit are determined. The target grayscale upper limit is used to exclude overexposed areas in the OCT image, and the target grayscale lower limit is used to exclude background noise areas in the OCT image. An enhancement function is constructed, which is a non-linear mapping function based on the Sigmoid function. The domain of the enhancement function is defined by the upper limit and lower limit of the target gray level. The output value of the enhancement function is used to characterize the enhanced pixel gray level. The enhancement function is applied pixel-by-pixel to the normalized image to generate an enhanced image.

2. The OCT image adaptive contrast enhancement method according to claim 1, characterized in that, The step of determining the upper and lower limits of the target grayscale based on the grayscale distribution statistics of the normalized image includes: Calculate the grayscale histogram of the normalized image; The cumulative distribution function is calculated based on the gray-level histogram; When the cumulative distribution function reaches a first preset threshold, the corresponding gray value is determined as the target gray value lower limit. When the cumulative distribution function reaches the second preset threshold, the corresponding gray value is determined as the target gray upper limit value.

3. The OCT image adaptive contrast enhancement method according to claim 2, characterized in that, The first preset threshold is 0.5, and the second preset threshold is any value between 0.99 and 0.

995.

4. The OCT image adaptive contrast enhancement method according to claim 1, characterized in that, After determining the upper and lower limits of the target grayscale, the method further includes: Obtain the difference between the target grayscale upper limit value and the target grayscale lower limit value; When the difference is less than a preset width threshold, the quality of the OCT image is marked as abnormal. In the abnormal state, the target grayscale upper limit and target grayscale lower limit are replaced with a preset default range.

5. The OCT image adaptive contrast enhancement method according to claim 1, characterized in that, After determining the upper and lower limits of the target grayscale, the method further includes: Obtain the maximum grayscale value of the normalized image; When the maximum grayscale value is less than the preset black threshold, the OCT image is determined to be a black image; The normalized image is output as the enhanced image.

6. The OCT image adaptive contrast enhancement method according to claim 1, characterized in that, The construction of the enhancement function includes: Obtain the standard Sigmoid function; The function value of the standard Sigmoid function at zero is adjusted to zero to obtain the Sigmoid function with zero point set to zero. The enhancement function is obtained by normalizing the value of the zero-point-zeroed Sigmoid function at the target grayscale upper limit to a unit amplitude.

7. The OCT image adaptive contrast enhancement method according to claim 6, characterized in that, The step of adjusting the function value of the standard Sigmoid function at zero to zero, to obtain a zero-point Sigmoid function, includes: Obtain the midpoint value between the target grayscale upper limit value and the target grayscale lower limit value; Using the midpoint value as the offset of the independent variable, the independent variable of the standard Sigmoid function is subtracted from the midpoint value to obtain the Sigmoid function with the offset independent variable; The zero-point offset is obtained by taking the value of the Sigmoid function after the offset of the independent variable when the independent variable is zero, and then subtracting the zero-point offset from the Sigmoid function after the offset of the independent variable to obtain the Sigmoid function with the zero point set to zero.

8. The OCT image adaptive contrast enhancement method according to claim 6, characterized in that, The step of normalizing the Sigmoid function value at the target grayscale upper limit to a unit amplitude to obtain the enhancement function includes: Calculate the value of the zero-point-zeroed Sigmoid function at the upper limit of the target gray level, and use it as the amplitude normalization factor; Dividing the zero-point-zeroed Sigmoid function by the amplitude normalization factor yields an intermediate function with a range of 0-1 on a closed interval. Obtain the preset minimum and maximum output grayscale values; After summing the intermediate function with the minimum output gray value, multiplying it by the difference between the maximum output gray value and the minimum output gray value, an enhancement function with a value range of a closed interval from the minimum output gray value to the maximum output gray value is obtained.

9. The OCT image adaptive contrast enhancement method according to claim 6, characterized in that, The standard Sigmoid function includes a kurtosis parameter, which controls the steepness of the enhancement function between the target grayscale lower limit and the target grayscale upper limit; the kurtosis parameter is negatively correlated with the difference between the target grayscale upper limit and the target grayscale lower limit.

10. The OCT image adaptive contrast enhancement method according to claim 9, characterized in that, The steepness parameter is determined in the following way: Obtain the difference between the target grayscale upper limit value and the target grayscale lower limit value; Get the preset constant; The ratio of the preset constant to the difference is determined as the steepness parameter.

Citation Information

Patent Citations

  • Light-weight distributed optical fiber temperature measurement method, system and equipment for heavy-current vertical shaft and storage medium

    CN120352044A

  • Self-adaptive nonlinear image enhancement method and system for low-illumination scene of mobile terminal

    CN120807338A

  • Complex scene traffic sign detection method and system based on dynamic frequency band focusing and double-domain attention screening

    CN121074845A

  • Image processing method and apparatus, electronic device, and storage medium

    WO2024198594A1