Method for enhancing low-contrast image edge detection effect

By decomposing the image into an illumination layer and a reflection layer and performing total variational regularization and adaptive sharpening, the problem of poor edge detection in low-contrast images is solved, and the accuracy and consistency of edge detection are improved.

CN121391908APending Publication Date: 2026-01-23TIANJIN UNIV OF TECH & EDUCATION (TEACHER DEV CENT OF CHINA VOCATIONAL TRAINING & GUIDANCE)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511402800.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Edge detection is poor for low-contrast images, and existing algorithms cause edge breakage and difficulty in information extraction, affecting the accuracy of computer vision systems.

Method used

After noise removal using a bilateral filtering algorithm, the image is decomposed into an illumination layer and a reflection layer. The illumination layer is processed by total variational regularization and combined with the Proximal gradient method to adaptively sharpen the reflection layer. After merging, Canny edge detection is performed.

Benefits of technology

It effectively suppresses noise, enhances image contrast, improves the accuracy and consistency of edge detection, reduces false detections and false negatives, and provides a reliable image data foundation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121391908A_ABST
    Figure CN121391908A_ABST
Patent Text Reader

Abstract

The invention discloses a method for enhancing an edge detection effect of a low-contrast image. The method comprises the following steps of: 1, filtering noise and ripples in the low-contrast image by using a bilateral filtering algorithm, reducing interference and simplifying calculation; step 2, Gaussian filtering is carried out on the image I (x, y) after noise and ripple filtering in the step 1, an estimated illumination layer L (x, y) is obtained, and a reflection layer R (x, y) is inversely solved; 3, associating the total variation regularization mathematical model with a Proximal gradient method for the estimated illumination layer u to be recovered in the step 2, and calculating gradient delta g (u) of a smooth item g (u); for the non-smooth item h (u), iterating the intermediate variable v for k times by applying a Proximal operator to obtain an illumination layer u with the edge of the reserved image; carrying out self-adaptive high-lift sharpening on the reflecting layer to obtain a sharpened and strengthened image Is (x, y); 4, combining and outputting the illumination layer and the reflection layer in the step 3; step 5, carrying out graying processing on the merged image; and step 6, carrying out edge detection on the image after graying processing to obtain an edge result.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image enhancement algorithm and edge detection algorithm optimization, in particular to a method for enhancing the edge detection effect of low-contrast images. BACKGROUND

[0002] In the field of automatic equipment design and development, computer vision is widely used in image recognition, object recognition, automatic control and other aspects. Through industrial cameras, computer vision can collect control information from smart device displays, vehicle-mounted system displays and industrial system displays, and can realize automatic clicking, operation and control of equipment. Edges are regions with the most significant changes in gray, color or brightness in an image, usually corresponding to the contours or significant structural features of objects. Accurate edge detection can help computer vision systems accurately extract information, recognize objects and locate targets, and achieve automatic control and operation. In engineering practice, low-contrast images have small differences in tone or brightness between foreground and background, resulting in unclear details and making edge detection difficult. After being enhanced by traditional CLAHE, Retinex, high-lifting and Laplace algorithms, low-contrast images still have many missing edges, which affects the extraction of information data. SUMMARY

[0003] The present application aims to solve the technical defects in the prior art and provide a method for enhancing the edge detection effect of low-contrast images.

[0004] The technical solution adopted by the present application to achieve the above-mentioned purpose is as follows:

[0005] A method for enhancing the edge detection effect of low-contrast images, comprising the following steps:

[0006] Step 1: Image filtering: using a bilateral filtering algorithm to filter out noise and ripples in a low-contrast image, reducing interference and simplifying calculations;

[0007] Step 2: Image layering: performing Gaussian filtering on the image I(x,y) filtered of noise and ripples in step 1 to obtain an estimated illumination layer L(x,y), and calculating a reflection layer R(x,y) based on the value of the estimated illumination layer L(x,y);

[0008] Step 3: Layer enhancement: for the estimated illumination layer u to be restored in step 2, a total variation regularization mathematical model and a Proximal gradient method are associated, and the fidelity term of the total variation regularization As the smooth term g(u) of the Proximal Gradient Method, the regularized total variation term λTV(u) is taken as the non-smooth term h(u) of the Proximal Gradient Method;

[0009] For the smooth term g(u), the gradient ∇g(u) of the smooth term g(u) is calculated;

[0010] For the non-smooth term h(u), an intermediate variable v is set, and the intermediate variable v is iterated by using the iterative formula to obtain an updated intermediate variable v k , and v k is taken as the variable in the Proximal operator, combined with the iterative formula x k+1 = prox ηh (x k -η▽g(x k )) of the Proximal Gradient Method, the Proximal operator is applied to the intermediate variable v for k times to obtain the estimated illumination layer u of the reserved image edge after total variation regularization processing, and the total variation regularization mathematical model

[0011] In the reflection layer, adaptive high-lift sharpening is performed, the gradient ∇I(x,y) of the local features of the image is calculated, the gain factor a(x,y) is dynamically adjusted according to the gradient ∇I(x,y) of the local features of the image, and the sharpened image I s (x,y) is obtained.

[0012] Step 4, layer merging: merging the illumination layer and the reflection layer processed in step 3 to output;

[0013] Step 5, grayscale processing: performing grayscale processing on the image merged in step 4;

[0014] Step 6, edge detection: using the Canny edge detection operator to perform edge detection on the image processed in step 5 to obtain an edge result.

[0015] In the above technical solution, the relationship between the illumination layer L(x,y) and the reflection layer R(x,y) of the image I(x,y) in step 2 is represented as:

[0016] I(x,y) = R(x,y)·L(x,y)

[0017] In the formula, L(x,y) is the illumination layer of the image I(x,y), and R(x,y) is the reflection layer of the image I(x,y).

[0018] In the above technical solution, the calculation formula of the estimated illumination layer L(x,y) in step 2 is as follows:

[0019] L(x, y) = G(x, y) * I(x, y)

[0020] In the formula, G(x, y) is a Gaussian kernel, * is a convolution operation, and I(x, y) is an original image.

[0021] The calculation formula of the reflection layer R(x, y) is as follows:

[0022]

[0023] In the formula, I(x, y) is an original image, and L(x, y) is an estimated illumination layer.

[0024] In the above technical solution, the calculation formula of the Gaussian kernel G(x, y) is as follows:

[0025]

[0026] In the formula, x and y are coordinates of pixels, and sigma is a standard deviation for controlling the Gaussian kernel.

[0027] In the above technical solution, the calculation formula of the sharpened image R s (x, y) in step 3 is as follows:

[0028] R s (x, y) = R(x, y) + a(x, y) · (R(x, y) - R b (x, y))

[0029] In the formula, R(x, y) is a two-dimensional function of an image, a(x, y) is a gain factor, and R b (x, y) is a blurred image obtained by smoothing the image using a Gaussian filter.

[0030] In the above technical solution, the calculation formula of the gain factor a(x, y) is as follows:

[0031] a(x, y) = 1 + c · ▽R(x, y)

[0032] In the formula, ▽R(x, y) is a gradient of a local feature, and c is a constant for controlling adaptive intensity.

[0033] In the above technical solution, according to an actual application scenario, the optimized edge image generated in step 6 is converted into a corresponding format.

[0034] Another aspect of the present application is an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for enhancing the edge detection effect of a low-contrast image.

[0035] Another aspect of the present application, a computer readable storage medium characterized in that, storing computer executable instructions, the instructions when executed to implement the method for enhancing low-contrast image edge detection effect.

[0036] Another aspect of the present application, a computer program product, the computer program product includes computer executable instructions, the instructions when executed to implement the method for enhancing low-contrast image edge detection effect.

[0037] Compared with the prior art, the beneficial effects of the present application are:

[0038] In the image enhancement process, the image is divided into an illumination layer and a reflection layer, total variation regularization processing is performed on the illumination layer to effectively suppress noise and obtain a uniform background brightness; adaptive high-lift sharpening enhancement is applied to the reflection layer to dynamically enhance the texture structure and detail features of the foreground target according to the characteristics of the local region of the image; the overall contrast of the output enhanced image is improved by merging the illumination layer and the reflection layer. In the subsequent edge detection process, the interference of the Canny operator with noise and artifacts is reduced, the accuracy of the detected edge is improved, and false detection is effectively reduced; the contrast between the foreground and the background of the low-contrast image is enhanced, the originally weak and blurred edge is highlighted, the Canny operator can effectively detect the real image edge, reduce the missed detection, and ensure the coherence and integrity of the overall edge of the image, providing a more reliable data basis for subsequent image segmentation, target recognition and measurement tasks. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 The flow chart of the method for enhancing low-contrast image edge detection effect of the present application is shown.

[0040] Figure 2 The low-contrast sample is shown.

[0041] Figure 3 The image enhancement effect display diagram of the present application is shown.

[0042] Figure 4 The edge detection effect diagram of the image enhanced by the present application is shown. DETAILED DESCRIPTION

[0043] The present application will be further described in detail below in conjunction with specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0044] Embodiment 1

[0045] Reference Figure 1 A method for enhancing low-contrast image edge detection effect, comprising the following steps:

[0046] Step 1, image filtering: filter out noise and ripples in low-contrast images (reference Figure 2 ), reduce interference, and simplify calculations; use Python language, PyCharm integrated development environment, and call OpenCV library.

[0047] This embodiment uses bilateral filtering to filter out noise from images. Bilateral filtering is a filtering method that combines spatial distance and pixel intensity difference, aiming to maintain image edge details while reducing noise. Bilateral filtering calculates the spatial distance and gray difference between each pixel and its surrounding pixels, and uses weighted average to smooth the image. Bilateral filtering not only considers spatial neighborhood, but also adjusts the weight according to the similarity of pixel intensity, effectively reducing noise while maintaining image edge information, suitable for image processing tasks that remove noise and protect edges.

[0048] Step 2, image layering: by performing logarithmic change on the image filtered in step 1, simplifying the image synthesis method, using Gaussian filtering to process the image and estimate the illumination layer, using logarithmic operation to obtain the reflection layer, and processing the original image into an illumination layer and a reflection layer.

[0049] Specifically as follows:

[0050] Let the input original image be a two-dimensional function I(x, y), where x and y are pixel coordinates. The image I(x, y) can be decomposed into an illumination layer L(x, y) and a reflection layer R(x, y), satisfying the following relationship.

[0051] I(x, y) = R(x, y) * L(x, y)

[0052] Perform Gaussian filtering on the image I(x, y) to obtain the estimated illumination layer L(x, y), whose calculation formula is as follows:

[0053] L(x, y) = G(x, y) * I(x, y)

[0054] In the formula, G(x, y) is the Gaussian kernel, and * is the convolution operation.

[0055] The calculation formula of the Gaussian kernel G(x, y) is:

[0056]

[0057] In the formula, x and y are pixel coordinates, and σ is the standard deviation that controls the Gaussian kernel, determining the degree of smoothing.

[0058] Use the decomposition formula to calculate the reflection layer R(x, y), whose calculation formula is as follows:

[0059]

[0060] In the formula, I(x, y) is the original image, and L(x, y) is the estimated illumination layer.

[0061] Step 3, image enhancement: The illumination layer obtained in step 2 is subjected to total variation regularization processing, and a proximal gradient method is used to solve the total variation regularization to preserve important details in the image.

[0062] The reflection layer is subjected to adaptive high-lift sharpening, and the sharpening degree is adaptively adjusted according to the local characteristics of the image to enhance the details of the image, while avoiding noise amplification caused by excessive sharpening, thereby ensuring high-quality output of the image. The effect diagram after image enhancement is as shown in Figure 3

[0063] Total variation regularization smoothes the illumination layer (i.e., the low-frequency part) without excessively smoothing the edges of the image, making the estimation of the illumination layer more natural, avoiding excessive smoothing and edge blurring of the illumination layer, and being able to better preserve the main structure and brightness distribution of the image, thereby ensuring natural presentation of the image details.

[0064] Specifically, the core idea of total variation regularization is to smooth the image and preserve the edges by minimizing the total variation of the image.

[0065] In flat areas, the gradient of the image is small, and the application of total variation regularization makes these areas smoother. In edge areas, the gradient of the image is large, and total variation regularization will try to preserve this gradient information as much as possible to avoid edge blurring.

[0066] Total variation is the integral of the gradient amplitude of an image, which is used to measure the amount of change in the image. For a two-dimensional image▽u(x, y), its total variation TV(u) is defined as shown in the following formula.

[0067] TV(u)=∫ Ω |▽u(x,y)|dxdy

[0068] In the formula, Ω is the definition domain of the image, i.e., the pixel coordinate space of the image;▽u(x, y) is the gradient of the image; |▽u(x, y)| is the amplitude of the gradient; and x and y are the coordinates of the pixels.

[0069] In the discrete case, the total variation TV(u) can be approximated as shown in the following formula:

[0070]

[0071] In the formula, u i+1,j , u i,j , and u i,j+1 respectively represent the values of the image to be restored at pixel points (i+1, j), (i, j), and (i, j+1). ​

[0072] The total variation regularization mathematical model can be expressed in the form of the following formula.

[0073]

[0074] In the formula, f is an estimated illumination layer; u is an estimated illumination layer processed by total variation regularization, that is, an image to be recovered; is a data fidelity term, used to measure the difference between the image to be recovered u and the observed noisy image f, TV(u) is a total variation term, used to preserve the edge information of the illumination layer; λ is a regularization parameter, used to balance the data fidelity term and the total variation term TV(u).

[0075] The data fidelity term is calculated according to the following formula:

[0076]

[0077] In the formula, u i,j and f i,j respectively represent the values of the restored image and the noisy image at the pixel point (i, j).

[0078] The Proximal gradient method is an algorithm for solving the following form of optimization problem:

[0079]

[0080] The iteration formula of the Proximal gradient method is shown in the following formula:

[0081] x k+1 = prox ηh (x k - η▽g(x k ))

[0082] In the formula, x k , x k+1 are the solutions obtained after the kth iteration and the (k+1)th iteration respectively, g(x) is a smooth function;▽g(x) is the gradient of the smooth function; h(x) is a non-smooth function; η is a step size; prox ηh (.) is the Proximal operator of the non-smooth function h(x).

[0083] The Proximal gradient method solving process of the total variation regularization problem is as follows:

[0084] The total variation regularization is associated with the Proximal gradient method solving to obtain the smooth term g(u) and the non-smooth term h(u), and the association details are shown in the following formula:

[0085]

[0086] h(u) = λTV(u)

[0087] Initialization, set initial threshold u 0 = f, set step size η and regularization parameter λ;

[0088] Iterative update, for each iteration update k = 0, 1, 2, …, the following steps are performed:

[0089] Smooth term processing, gradient descent step is applied, gradient of smooth term g(u) is calculated, as shown in the following formula.

[0090] ▽g(u k ) = u k -f

[0091] In the formula, u is the image to be recovered, k is the number of iteration updates, and f is the observed noise image.

[0092] Non-smooth term processing, the non-smooth term is processed by using the iteration formula, the update intermediate variable is v, the intermediate variable v is iterated to obtain the update intermediate variable v k , let v k = u k - η▽g(u k ) = u k - η(u k -f) indicates the variable in the above Proximal operator.

[0093] Substitute v k into the iteration formula, apply the Proximal operator to calculate the non-smooth term h(u) = λTV(u), as shown in the following formula:

[0094] u k+1 = prox ηλTV (v k )

[0095] As can be seen from the above formula, the estimated illumination layer u obtained by total variation regularization processing is obtained by iterating the intermediate variable v k times through the Proximal operator prox ηλTV , that is, u is the next iteration of v.

[0096] Therefore, the total variation regularization mathematical model is to define the relationship between the estimated illumination layer u obtained by total variation regularization processing and the intermediate variable v, rather than to define the relationship between u and the observed noise image f, and the Proximal operator is defined as the form of the total variation regularization mathematical model, that is, the construction of the total variation regularization mathematical model is completed:

[0097]

[0098] where u is the image to be recovered, is the data fidelity term, which reflects the error between the original image and the denoised image, ensuring that the denoised image output is close to the input image, ηλTV(u) is the total variation regularization term, which controls the smoothness of the image, suppresses noise in the image and preserves the edges of the image, η is the step size, and λ is the regularization parameter.

[0099] Since the total variation term TV(u) (i.e., the non-smooth term) is not differentiable, it cannot be solved by traditional gradient descent algorithms to obtain a closed-form solution. The Chambolle algorithm is an iterative method for solving optimization problems with total variation regularization terms, which gradually updates the image to be recovered and its gradient to find the optimal solution. OpenCV provides the (denoise_tv_chambolle) function, which can directly call the Chambolle algorithm for iterative optimization, suitable for total variation regularization result approximation problems.

[0100] During the iterative update process, each update of the image gradually approaches the optimal solution. Generally, the number of iterations is set to 200, and when the iteration reaches the preset number of iterations, the final image to be recovered u can be output.

[0101] For the reflector, the adaptive high-lift sharpening algorithm introduces an adaptive mechanism based on traditional high-lift sharpening. High-lift sharpening can calculate the low-frequency part of the image, then subtract the low-frequency part from the original image to obtain the high-frequency component, and then add these high-frequency components to the original image to highlight the details of the image. The adaptive mechanism allows the sharpening intensity to vary according to the local characteristics of the image, rather than a fixed gain factor. In low-contrast areas, the enhancement factor is increased to improve the area contrast, and in high-contrast areas, the gain factor is reduced to avoid over-enhancement and maintain the natural feel of the image.

[0102] Specifically, the gradient ▽R(x,y) of each pixel or local area is calculated to dynamically adjust the gain factor α(x,y), which adaptively controls the local features of the image.

[0103] The gradient ▽R(x,y) of the local feature and the gain factor α(x,y) algorithm are as follows:

[0104]

[0105] α(x,y)=1+c·▽R(x,y)

[0106] where the gradient of the two-dimensional function R(x,y) of the reflector image is denoted as ▽R(x,y), α(x,y) is the gain factor, and c is a constant that controls the adaptive intensity. The reflector R s (x,y) after adaptive high-lift sharpening is expressed as follows:

[0107] R s (x,y)=R(x,y)+α(x,y)·(R(x,y)-R b (x,y))

[0108] In the formula, R(x,y) is the reflection layer, α(x,y) is the gain factor, R b (x,y) is a blurred image obtained by smoothing the image using a Gaussian filter.

[0109] Step 4, layer merging: calling the combine_layers function in the OpenCV library to merge the illumination layer and the reflection layer processed in step 3 and output;

[0110] Step 5, grayscale processing: calling the cv2.cvtColor function in the OpenCV library to perform grayscale processing on the image merged in step 4, and simplify the calculation result;

[0111] Step 6, edge detection: using the Canny edge detection operator to perform edge detection on the image processed in step 5, and obtain the edge result; image enhancement can realize the enhancement of low-contrast images with similar foreground and background colors, and can effectively detect the image edges and effectively avoid excessive noise, and the edge detection effect of the image is as shown in Figure 4 .

[0112] Step 7, output result: according to the actual application scene, the optimized edge image generated in step 6 is converted into a corresponding format.

[0113] The above only describes the preferred embodiments of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection scope of the present application.

Claims

1. A method of enhancing the edge detection effect of a low-contrast image, characterized by, The method comprises the following steps: Step 1, image filtering: using a bilateral filtering algorithm to filter out noise and ripples in a low-contrast image, reduce interference, and simplify calculation; Step 2, image layering: performing Gaussian filtering on the image I(x, y) filtered of noise and ripples in step 1 to obtain an estimated illumination layer L(x, y), and calculating a reflection layer R(x, y) according to the value of the estimated illumination layer L(x, y); Step 3, layer enhancement: for the estimated illumination layer u to be recovered in step 2, the total variation regularization mathematical model with the Proximal Gradient method correlating the fidelity term of the total variation regularization as the smooth term g(u) of the Proximal Gradient method, and the regularized total variation term λTV(u) as the non-smooth term h(u) of the Proximal Gradient method; For the smooth term g(u), the gradient of the smooth term g(u) is calculated; For the non-smooth term h(u), an intermediate variable v is set, and the intermediate variable v is iterated by using an iterative formula to obtain an updated intermediate variable v k , and v k is taken as a variable in a Proximal operator, and an iterative formula of a Proximal gradient method is combined After the intermediate variable v is iterated k times by using the Proximal operator, an estimated illumination layer u that preserves edges of an image after total variation regularization is obtained, and a total variation regularization mathematical model Adaptive high boost sharpening is performed on the reflection layer, and the gradient of the local feature of the image is calculated According to the gradient of the local feature of the image The gain factor a(x, y) is dynamically adjusted to obtain the sharpened image I s (x, y); Step 4, image layer merging: merging the illumination layer and the reflection layer processed in step 3 to output; Step 5, grayscale processing: performing grayscale processing on the image merged in step 4; Step 6, edge detection: using a Canny edge detection operator to perform edge detection on the image processed in step 5 to obtain an edge result.

2. The method of claim 1, wherein the edge detection effect of the low-contrast image is enhanced by, The relationship between the illumination layer L(x, y) and the reflection layer R(x, y) of the image I(x, y) in step 2 is represented as: I(x, y) = R(x, y) * L(x, y) In the formula, L(x, y) is the illumination layer of the image I(x, y), and R(x, y) is the reflection layer of the image I(x, y).

3. The method of claim 1, wherein the step of enhancing the edge detection effect of the low-contrast image is performed by using a Laplacian filter. The calculation formula of the estimated illumination layer L(x, y) in step 2 is as follows: L(x, y) = G(x, y) * I(x, y) In the formula, G(x, y) is a Gaussian kernel, * is a convolution operation, and I(x, y) is an original image. The calculation formula of the reflection layer R(x, y) is as follows: In the formula, I(x, y) is an original image, and L(x, y) is an estimated illumination layer.

4. The method of claim 2, wherein the step of enhancing the edge detection effect of the low-contrast image is performed by using a Laplacian filter. The calculation formula of the Gaussian kernel G(x, y) is as follows: In the formula, x and y are coordinates of a pixel, and sigma is a standard deviation for controlling the Gaussian kernel.

5. The method of claim 1, wherein the method is enhanced in edge detection of a low-contrast image. the sharpened image R described in step 3 s The calculation formula of (x, y) is as follows: R s (x,y) = R(x,y) + a(x,y) - (R b (x,y)) where R(x, y) is a two-dimensional function of the image, a(x, y) is a gain factor, and R b (x, y) is a blurred image obtained by smoothing the image using a Gaussian filter.

6. The method of claim 5, wherein the step of enhancing the edge detection effect of the low-contrast image is performed by using a Laplacian filter. The calculation formula of the gain factor alpha(x, y) is as follows: wherein is the gradient of the local feature and c is a constant that controls the adaptive intensity.

7. The method of claim 1, wherein the method is enhanced in edge detection of a low-contrast image. According to the actual application scenario, the optimized edge image generated in step 6 is converted into a corresponding format.

8. An electronic device, comprising: It comprises: One or more processors; A memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for enhancing the edge detection effect of a low-contrast image according to claim 1.

9. A computer-readable storage medium, characterized in that, The computer executable instructions stored in the memory are used to implement the method for enhancing the edge detection effect of a low-contrast image according to claim 1 when executed.

10. A computer program product, characterised in that, The computer program product comprises computer executable instructions, which are used to implement the method for enhancing the edge detection effect of a low-contrast image according to claim 1 when executed.