Self-adaptive image contrast adjustment method and device, equipment and storage medium

By combining the Canny and Sobel algorithms for edge detection and adaptive histogram stretching, the problem of insufficient adaptability in image contrast adjustment is solved, achieving efficient image quality improvement under complex lighting conditions.

CN121685348APending Publication Date: 2026-03-17WUHAN GUIDE INFRARED CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing image contrast adjustment methods lack adaptability and are difficult to adjust stably under complex lighting conditions, resulting in insufficient image visual quality, especially in scenarios with high real-time requirements such as video processing and autonomous driving where efficiency is insufficient.

Method used

At least two edge detection algorithms (such as Canny and Sobel) are used to process the grayscale image, the edge map is fused and binarized, the image is divided into blocks and adaptive histogram stretching is performed according to the number of edges, and the contrast is adjusted by adaptive histogram stretching and weighted fusion.

Benefits of technology

It improves the adaptability and accuracy of image contrast adjustment, reduces artifact generation, enhances the visual quality of processed images, and adapts to different lighting conditions and complex backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685348A_ABST
    Figure CN121685348A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive image contrast adjustment method and device, equipment and a storage medium, and relates to the technical field of image processing, and the adjustment method comprises the steps: carrying out the processing of an original image, and obtaining a gray image; processing the gray level image by adopting at least two edge detection algorithms, carrying out weighted fusion on the obtained multiple edge images, and then carrying out binaryzation to obtain a fused edge image; and dividing the fused edge image into a plurality of image blocks, and performing adaptive histogram stretching on the corresponding image blocks of the original image according to the edge number of each image block to obtain a target image. According to the adaptive image contrast adjustment method and device, the equipment and the storage medium, the adaptivity of image contrast adjustment is effectively improved, so that the method can adapt to different illumination conditions and complex backgrounds, artifact generation is reduced, and the visual quality after image processing is improved.
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, specifically to an adaptive image contrast adjustment method, apparatus, device, and storage medium. Background Technology

[0002] With the widespread application of digital imaging technology, image contrast adjustment has become a crucial step in image processing. Currently, image contrast adjustment methods typically rely on manually set parameters or empirical formulas. This approach lacks adaptability, making it difficult to automatically adjust contrast based on different image content. Under complex lighting conditions, the results are unstable, potentially leading to overexposure or underexposure. Furthermore, it is inefficient for scenarios with high real-time requirements (such as video processing and autonomous driving), and it struggles to adapt to infrared video data contrast adjustment, resulting in insufficient visual quality after image processing. Summary of the Invention

[0003] This application provides an adaptive image contrast adjustment method, apparatus, device, and storage medium, which can solve the technical problem in the prior art where the inability to adaptively adjust image contrast leads to insufficient image visual quality.

[0004] In a first aspect, this application provides an adaptive image contrast adjustment method, the method comprising: The original image is processed to obtain a grayscale image; The grayscale image above is processed using at least two edge detection algorithms. The resulting edge maps are then weighted, fused, and binarized to obtain a fused edge map. The fused edge map is divided into multiple image blocks, and adaptive histogram stretching is performed on the corresponding image blocks of the original image according to the number of edges in each image block to obtain the target image.

[0005] In conjunction with the first aspect, in one implementation, adaptive histogram stretching is performed on corresponding image patches of the original image, specifically including: Obtain multiple preset ranges of edge quantity, with each range corresponding to a contrast stretching level; Based on the range of edge counts for each image patch, perform histogram stretching on the corresponding image patch of the original image at the corresponding contrast stretching level.

[0006] In conjunction with the first aspect, in one implementation, the above-mentioned at least two edge detection algorithms are the Canny algorithm and the Sobel algorithm; The obtained edge maps are weighted, fused, and then binarized, specifically including: The first edge map obtained by the Canny algorithm and the second edge map obtained by the Sobel algorithm are weighted and summed to obtain the intermediate fused map. Based on a preset global threshold, the above intermediate fused image is binarized:

[0007] in, This is an intermediate fusion diagram; T To preset a global threshold; To merge edge maps.

[0008] In conjunction with the first aspect, in one implementation, the Canny algorithm is used to obtain the first edge map, specifically including: The Sobel operator is used to calculate the horizontal and vertical gradients of the grayscale image, and the magnitude and direction of the first gradient are calculated. Based on the first gradient magnitude and first gradient direction, non-maximum suppression is performed to obtain the suppressed image after non-maximum suppression. Based on preset high and low thresholds, the above suppressed image is subjected to double thresholding to determine the edges, resulting in a first edge map.

[0009] In conjunction with the first aspect, in one implementation, the Sobel algorithm is used to obtain the second edge map, specifically including: Use the Sobel operator to calculate the horizontal and vertical gradient components of a grayscale image; The horizontal and vertical gradient components are fused to obtain the second edge map.

[0010] In conjunction with the first aspect, in one implementation, the original image is processed to obtain a grayscale image, specifically including: The original image was converted to a grayscale image, and then Gaussian filtering was used to reduce noise in the grayscale image.

[0011] In conjunction with the first aspect, in one implementation, after performing adaptive histogram stretching on the corresponding image patches of the original image, the method further includes: Resampling and edge smoothing are performed between stretched image blocks.

[0012] Secondly, this application provides an adaptive image contrast adjustment device, the device comprising: The grayscale processing module is used to process the original image to obtain a grayscale image; The fusion module is used to process the grayscale image using at least two edge detection algorithms, weightedly fuse the resulting edge maps, and then binarize them to obtain a fused edge map. The adaptive stretching module is used to divide the above-mentioned fused edge map into multiple image blocks, and perform adaptive histogram stretching on the corresponding image blocks of the original image according to the number of edges of each image block to obtain the target image.

[0013] Thirdly, this application provides an adaptive image contrast adjustment device, which includes a processor, a memory, and an adaptive image contrast adjustment program stored in the memory and executable by the processor. When the adaptive image contrast adjustment program is executed by the processor, it implements the steps of the adaptive image contrast adjustment method described above.

[0014] Fourthly, this application provides a computer-readable storage medium storing an adaptive image contrast adjustment program, wherein when the adaptive image contrast adjustment program is executed by a processor, it implements the steps of the adaptive image contrast adjustment method as described above.

[0015] The beneficial effects of the technical solution provided in this application include: The process involves processing the original image to obtain a grayscale image; then, at least two edge detection algorithms are used to process the grayscale image separately, and the resulting edge maps are weighted, fused, and binarized to obtain a fused edge map. Finally, the fused edge map is divided into multiple image blocks, and adaptive histogram stretching is performed on the corresponding image blocks of the original image based on the number of edges in each image block to obtain the target image. Therefore, by combining at least two edge detection algorithms and weighted fusion of multiple edge maps, edge information in the image can be captured more comprehensively and accurately, improving the overall detection effect and reducing the possibility of missed and false detections. Furthermore, by further dividing the fused edge map into regions and adjusting the contrast of each region according to its edge features, the contrast adjustment becomes more intelligent and precise, effectively improving the adaptability of image contrast adjustment. This allows the image to adapt to different lighting conditions and complex backgrounds, reduces artifact generation, and improves the visual quality of the processed image, solving the technical problem in related technologies where the inability to adaptively adjust image contrast leads to insufficient image visual quality. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating an embodiment of the adaptive image contrast adjustment method of this application; Figure 2 This is a flowchart illustrating another embodiment of the adaptive image contrast adjustment method of this application; Figure 3 This is a schematic diagram of the functional modules of an embodiment of the adaptive image contrast adjustment device of this application; Figure 4This is a schematic diagram of the hardware structure of the adaptive image contrast adjustment device involved in the embodiments of this application. Detailed Implementation

[0017] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0018] In a first aspect, embodiments of this application provide an adaptive image contrast adjustment method.

[0019] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the adaptive image contrast adjustment method of this application. The aforementioned adaptive image contrast adjustment method includes: S1. Process the original image to obtain a grayscale image; S2. The grayscale image above is processed using at least two edge detection algorithms. The resulting edge maps are then weighted, fused, and binarized to obtain a fused edge map. S3. Divide the above fused edge map into multiple image blocks, and perform adaptive histogram stretching on the corresponding image blocks of the original image according to the number of edges in each image block to obtain the target image.

[0020] Optionally, the original image described above is a color image.

[0021] In this embodiment, the original image is processed to obtain a grayscale image. Then, at least two edge detection algorithms are used to process the grayscale image respectively. The resulting edge maps are weighted and fused, and then binarized to obtain a fused edge map. Finally, the fused edge map is divided into multiple image blocks, and adaptive histogram stretching is performed on the corresponding image blocks of the original image according to the number of edges in each image block to obtain the target image. Therefore, by combining at least two edge detection algorithms and weighted fusion of multiple edge maps, edge information in the image can be captured more comprehensively and accurately, improving the overall detection effect and reducing the possibility of missed detections and false detections. By further dividing the fused edge map into regions and adjusting the contrast of each region according to its edge features, the contrast adjustment becomes more intelligent and precise, effectively improving the adaptability of image contrast adjustment, enabling it to adapt to different lighting conditions and complex backgrounds, reducing artifact generation, and improving the visual quality of the processed image. This solves the technical problem in related technologies where the inability to adaptively adjust image contrast leads to insufficient image visual quality.

[0022] Based on the above embodiments, in this embodiment, adaptive histogram stretching is performed on the corresponding image blocks of the original image, specifically including: Obtain multiple preset ranges of edge quantity, with each range corresponding to a contrast stretching level; Based on the range of edge counts for each image patch, perform histogram stretching at the corresponding contrast stretching level on the corresponding image patch in the original image.

[0023] In this embodiment, histogram stretching is performed to different degrees based on the total number of edges of each image block. The more edges an image block has, the higher the degree of stretching; similarly, the fewer edges an image block has, the lower the degree of stretching.

[0024] In this embodiment, by dividing the number of edges of an image block into multiple edge ranges and corresponding to different contrast stretching levels, more precise adaptive contrast adjustment is achieved, further avoiding overexposure or underexposure under complex lighting conditions and improving image visual quality.

[0025] In some embodiments, contrast adjustment methods using a single edge detection algorithm (such as Canny, Sobel, etc.) are employed. However, these methods often suffer from insufficient adaptability and excessive artifact generation when handling complex scenes. Furthermore, the performance of a single algorithm is not stable enough across different image types, making it difficult to meet the needs of practical applications.

[0026] Furthermore, in one embodiment, the above-mentioned at least two edge detection algorithms are the Canny algorithm and the Sobel algorithm.

[0027] The obtained edge maps are weighted, fused, and then binarized, specifically including: The first edge map obtained by the Canny algorithm and the second edge map obtained by the Sobel algorithm are weighted and summed to obtain the intermediate fused map. Based on a preset global threshold, the above intermediate fused image is binarized:

[0028] in, This is an intermediate fusion diagram; T To preset a global threshold; To merge edge maps.

[0029] In this embodiment, edge maps from the Canny and Sobel algorithms are fused and binarized, taking into account the advantages of both algorithms to generate highly robust edge contours. This provides accurate input for subsequent adaptive contrast adjustment based on the number of edges, significantly improving the image's contrast adjustment adaptability under complex lighting conditions.

[0030] Optionally, the above-mentioned at least two edge detection algorithms may also be the Canny algorithm, the Sobel algorithm, and the Laplacian algorithm, so as to obtain a fused edge map by weighted fusion of the three edge maps and binarization.

[0031] In other embodiments, the edge detection algorithm described above may also be the Diff algorithm, the Prewitt algorithm, the Roberts algorithm, etc.

[0032] In this embodiment, if the results obtained by the edge detection algorithm conform to the characteristics of graph data, multiple edge graph weighted fusions can be performed.

[0033] Furthermore, in one embodiment, the first edge map is obtained using the Canny algorithm, specifically including: The Sobel operator is used to calculate the horizontal and vertical gradients of the grayscale image, and the magnitude and direction of the first gradient are calculated. Based on the first gradient magnitude and first gradient direction, non-maximum suppression is performed to obtain the suppressed image after non-maximum suppression. Based on preset high and low thresholds, the above suppressed image is subjected to double thresholding to determine the edges, resulting in a first edge map.

[0034] In this embodiment, by applying nonmaximum suppression and dual threshold detection to the Sobel results, more obvious and reliable edge points are screened out. The dual threshold can effectively distinguish between real edges and noise, thereby improving detection accuracy.

[0035] Furthermore, in one embodiment, the Sobel algorithm is used to obtain the second edge map, specifically including: Use the Sobel operator to calculate the horizontal and vertical gradient components of a grayscale image; The horizontal and vertical gradient components are fused to obtain the second edge map.

[0036] In this embodiment, gradients are calculated using Sobel horizontal and vertical direction filters to obtain horizontal and vertical gradient components. The two gradient components are then combined, and all possible edge information is retained to provide a basis for subsequent fusion.

[0037] Furthermore, in one embodiment, the original image is processed to obtain a grayscale image, specifically including: The original image was converted to a grayscale image, and then Gaussian filtering was used to reduce noise in the grayscale image.

[0038] In this embodiment, the input color original image is converted into a grayscale image to reduce color interference. Then, a Gaussian filtering algorithm is used to denoise the grayscale image. By using a Gaussian filter, the image can be effectively smoothed, reducing the impact of noise on edge detection, thereby improving the stability and accuracy of edge detection.

[0039] Furthermore, in one embodiment, after performing adaptive histogram stretching on the corresponding image blocks of the original image, the method further includes: Resampling and edge smoothing are performed between stretched image blocks.

[0040] In this embodiment, by performing resampling edge smoothing between stretched image blocks, visual artifacts at the boundaries of image blocks are effectively eliminated, making the image transition natural and smooth, and further improving the visual quality of the image.

[0041] like Figure 2 As shown, based on the fusion of multiple edge detection algorithms, taking Sobel and Canny edge detection algorithms as examples, the method in this embodiment specifically includes the following steps: A1 Input Processing: Converts the input color image to grayscale and removes noise to obtain a smooth grayscale image.

[0042] First, grayscale conversion: This converts the input color image to a grayscale image to reduce color interference. The grayscale conversion formula is as follows:

[0043] Where R(x,y), G(x,y), and B(x,y) represent the red, green, and blue components of the original image, respectively, and I(x,y) is the converted grayscale image; Next, noise reduction: Gaussian filtering is used to denoise the grayscale image. The kernel function for Gaussian filtering is:

[0044] in, Let be the spatial coordinates (pixel position), where σ is the standard deviation of the Gaussian kernel. The weights of the Gaussian filter kernel.

[0045] Therefore, the denoised grayscale image for:

[0046] A2 Canny Algorithm: Process the grayscale image using the Canny algorithm to obtain the Canny image edge map, i.e., the first edge map.

[0047] Specifically, the Sobel operator is used to calculate the gradients in the horizontal and vertical directions of the image:

[0048] in, The Sobel operator is used to calculate the gradient in the horizontal direction. Used to compute the Sobel operator for the vertical gradient.

[0049] Calculate the magnitude of the first gradient:

[0050] in, The gradient component is in the horizontal direction. The gradient component is in the vertical direction. Let be the magnitude of the first gradient of the image at point (x,y).

[0051] Calculate the first gradient direction:

[0052] in, The first gradient direction (in radians).

[0053] Subsequently, Window size performs edge connections.

[0054] Then, non-maximum suppression is performed based on the first gradient magnitude and the first gradient direction: at each point, it is checked whether it is a local maximum in the gradient direction to obtain the suppressed image G after non-maximum suppression. nms .

[0055] Finally, a dual-thresholding process is performed: edges are determined based on two thresholds (high threshold Th and low threshold Ti).

[0056] like If so, then the point is a strong edge; like If a point is connected to a strong edge, then the point is a weak edge. Other cases are discarded.

[0057] Result: The edge intensity map detected by the Canny algorithm is obtained and used as the first edge map E. canny A3 Sobel algorithm: Process a grayscale image using the Sobel algorithm to obtain the Sobel image edge map, i.e., the second edge map.

[0058] Specifically, the Sobel operator is used to calculate the gradient components in the horizontal and vertical directions respectively, and then these two gradient components are combined to obtain the final edge map. The horizontal and vertical gradient components are calculated as follows:

[0059] in, The gradient component is in the horizontal direction. denoted as the gradient component in the vertical direction, and Ig as the input grayscale image.

[0060] Furthermore, the second gradient magnitude for:

[0061] Second gradient direction for:

[0062] Result: The edge intensity map detected by the Sobel algorithm is obtained and used as the second edge map E. sobel . A4 Image Fusion: The edge maps of the Sobel and Canny images are weighted, fused, and binarized to obtain a fused edge map. Specifically, the intermediate fused image is obtained:

[0063] in , where is the weight.

[0064] Then, a global threshold T is set to merge the intermediate values. Figure 2 Value-based, preserving edges detected by both Sobel and Canny:

[0065] Where T is the global threshold, which is set according to actual needs. The edge intensity map is the intermediate fusion map. It is a binary data map, i.e., a fused edge map after fusion.

[0066] In this embodiment, the above weights It can be configured according to actual needs.

[0067] In other embodiments, the optimal combination of the above weights can also be obtained through training.

[0068] Specifically, the initial weights are used to perform weighted fusion and binarization to obtain an initial fused edge map, and a preset judgment range for the number of edges is obtained.

[0069] If the number of edges in the initial fused edge map exceeds the preset judgment range, and if the number of edges is lower than the lower limit of the preset judgment range, then the weights of the edge map obtained by the Canny algorithm are reduced by a preset step size. And correspondingly increase the weight of the Sobel image edge map. Correspondingly, if the number of edges exceeds the upper limit of the preset judgment range, the weight of the edge map obtained by the Canny algorithm is increased by a preset step size. And correspondingly reduce the weight of the Sobel image edge map. .

[0070] The weighted fusion and binarization are performed again to obtain a fused edge map. The number of edges is then judged again until the number of edges in the fused edge map is within the preset judgment range. At this point, the image segmentation optimization and contrast adjustment process can be performed on the fused edge map.

[0071] A5 optimizes contrast adjustment through image segmentation: First, merge the edge map Divide the space into window sizes (such as 3*3 or 9*9, etc.); Secondly, find the number of edges for each window; Then, based on the number of edges in each block, a variable-length grayscale range histogram stretch is performed on each image block (square) corresponding to the original image to balance the contrast.

[0072] Finally, resampling and edge smoothing are performed between the stretched image blocks to obtain the adaptively adjusted target image.

[0073] In this embodiment, the contrast is adjusted by block, that is, the contrast of the original image is adjusted to different degrees according to the number of edges of each image block. The adjustment method is histogram equalization, and the target image is output after the adjustment is completed.

[0074] This embodiment presents an adaptive image contrast adjustment method based on machine vision image adjustment using a fusion of multiple edge detection algorithms. By combining classic edge detection algorithms such as Canny and Sobel with deep learning models, it improves the adaptability of image contrast adjustment, reduces artifact generation, and enhances the real-time performance of contrast adjustment, meeting the needs of video streaming and real-time processing, and achieving more efficient and accurate image contrast adjustment. This method is versatile and efficient for image contrast adjustment and can be applied to various application scenarios.

[0075] Secondly, embodiments of this application also provide an adaptive image contrast adjustment device.

[0076] In one embodiment, reference is made to Figure 3 , Figure 3 This is a functional block diagram of an embodiment of the adaptive image contrast adjustment device of this application. The adaptive image contrast adjustment device includes a grayscale processing module, a fusion module, and an adaptive stretching module.

[0077] The grayscale processing module described above is used to process the original image to obtain a grayscale image; The aforementioned fusion module is used to process the grayscale image using at least two edge detection algorithms, and then binarizes the resulting multiple edge maps after weighted fusion to obtain a fused edge map. The aforementioned adaptive stretching module is used to divide the fused edge map into multiple image blocks, and perform adaptive histogram stretching on the corresponding image blocks of the original image according to the number of edges in each image block to obtain the target image.

[0078] Furthermore, in one embodiment, the above-described adaptive stretching module is used for: Obtain multiple preset ranges of edge quantity, with each range corresponding to a contrast stretching level; Based on the range of edge counts for each image patch, perform histogram stretching on the corresponding image patch of the original image at the corresponding contrast stretching level.

[0079] Furthermore, in one embodiment, the above-mentioned at least two edge detection algorithms are the Canny algorithm and the Sobel algorithm; The above fusion module is used for: The first edge map obtained by the Canny algorithm and the second edge map obtained by the Sobel algorithm are weighted and summed to obtain the intermediate fused map. Based on a preset global threshold, the above intermediate fused image is binarized:

[0080] in, This is an intermediate fusion diagram; T To preset a global threshold; To merge edge maps.

[0081] Furthermore, in one embodiment, the fusion module is used for: The Sobel operator is used to calculate the horizontal and vertical gradients of the grayscale image, and the magnitude and direction of the first gradient are calculated. Based on the first gradient magnitude and first gradient direction, non-maximum suppression is performed to obtain the suppressed image after non-maximum suppression. Based on preset high and low thresholds, the above suppressed image is subjected to double thresholding to determine the edges, resulting in a first edge map.

[0082] Furthermore, in one embodiment, the fusion module is used for: Use the Sobel operator to calculate the horizontal and vertical gradient components of a grayscale image; The horizontal and vertical gradient components are fused to obtain the second edge map.

[0083] Furthermore, in one embodiment, the grayscale processing module described above is used for: The original image was converted to a grayscale image, and then Gaussian filtering was used to reduce noise in the grayscale image.

[0084] Furthermore, in one embodiment, the adaptive stretching module is also used for: Resampling and edge smoothing are performed between stretched image blocks.

[0085] The functions of each module in the adaptive image contrast adjustment device correspond to the steps in the above-described adaptive image contrast adjustment method embodiment, and their functions and implementation processes will not be described in detail here.

[0086] Thirdly, embodiments of this application provide an adaptive image contrast adjustment device, which can be a server or other device with data processing capabilities.

[0087] Reference Figure 4 , Figure 4 This is a schematic diagram of the hardware structure of the adaptive image contrast adjustment device involved in the embodiments of this application. In the embodiments of this application, the adaptive image contrast adjustment device may include a processor, a memory, a communication interface, and a communication bus.

[0088] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0089] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting internal components of the adaptive image contrast adjustment device, as well as interfaces used for interconnecting the adaptive image contrast adjustment device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.

[0090] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0091] The processor can be a general-purpose processor, which can call the adaptive image contrast adjustment program stored in memory and execute the adaptive image contrast adjustment method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the adaptive image contrast adjustment program is called can be referred to in various embodiments of the adaptive image contrast adjustment method of this application, and will not be repeated here.

[0092] Those skilled in the art will understand that Figure 4 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0093] Fourthly, embodiments of this application also provide a computer-readable storage medium.

[0094] The present application has a computer-readable storage medium storing an adaptive image contrast adjustment program, wherein when the adaptive image contrast adjustment program is executed by a processor, it implements the steps of the adaptive image contrast adjustment method as described above.

[0095] The method implemented when the adaptive image contrast adjustment program is executed can be referred to in various embodiments of the adaptive image contrast adjustment method of this application, and will not be repeated here.

[0096] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0097] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0098] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0099] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0100] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0102] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method of adaptive image contrast adjustment, characterized by, The method comprises: processing the original image to obtain a gray image; applying at least two edge detection algorithms to process the gray image respectively, performing weighted fusion on the obtained multiple edge maps, and then performing binarization to obtain a fused edge map; dividing the fused edge map into multiple image blocks, and performing adaptive histogram stretching on the corresponding image blocks of the original image according to the edge number of each image block to obtain a target image.

2. The adaptive image contrast adjustment method of claim 1, wherein, The adaptive histogram stretching performed on the corresponding image blocks of the original image specifically comprises: obtaining a plurality of preset edge number ranges, each edge number range corresponding to a contrast stretching level; performing histogram stretching of the corresponding contrast stretching level on the corresponding image blocks of the original image according to the edge number range in which the edge number of each image block falls.

3. The adaptive image contrast adjustment method of claim 1, wherein, The at least two edge detection algorithms are Canny algorithm and Sobel algorithm; The weighted fusion on the obtained multiple edge maps and then the binarization specifically comprise: performing weighted summation on a first edge map obtained by using Canny algorithm and a second edge map obtained by using Sobel algorithm to obtain an intermediate fusion map; performing binarization on the intermediate fusion map based on a preset global threshold value: wherein, is an intermediate fusion map; T is a preset global threshold value; is a fused edge map.

4. The adaptive image contrast adjustment method of claim 3, wherein, The first edge map obtained by using Canny algorithm specifically comprises: calculating the horizontal direction gradient and the vertical direction gradient of the gray image by using Sobel operator, and calculating the first gradient amplitude and the first gradient direction; performing non-maximum suppression based on the first gradient amplitude and the first gradient direction to obtain a suppressed image after non-maximum suppression; performing double-threshold processing on the suppressed image to determine edges according to a preset high threshold value and a low threshold value to obtain the first edge map.

5. The method for adaptive image contrast adjustment according to claim 3, wherein, The second edge map obtained by using Sobel algorithm specifically comprises: calculating the horizontal direction gradient component and the vertical direction gradient component of the gray image by using Sobel operator; fusing the horizontal direction gradient component and the vertical direction gradient component to obtain the second edge map.

6. The adaptive image contrast adjustment method of claim 1, wherein, The processing of the original image to obtain a gray image specifically comprises: converting the original image into a gray image, and performing noise reduction processing on the gray image by using Gaussian filtering.

7. The adaptive image contrast adjustment method of claim 1, wherein, After the adaptive histogram stretching performed on the corresponding image blocks of the original image, the method further comprises: performing resampling edge smoothing processing between the stretched image blocks.

8. An adaptive image contrast adjustment apparatus, characterized by, The device comprises: a gray processing module configured to process an original image to obtain a gray image; a fusion module configured to apply at least two edge detection algorithms to process the gray image respectively, perform weighted fusion on the obtained multiple edge maps, and then perform binarization to obtain a fused edge map; an adaptive stretching module configured to divide the fused edge map into multiple image blocks, and perform adaptive histogram stretching on the corresponding image blocks of the original image according to the edge number of each image block to obtain a target image.

9. An adaptive image contrast adjustment device, characterized by The adaptive image contrast adjustment device comprises a processor, a memory, and an adaptive image contrast adjustment program stored on the memory and executable by the processor, wherein the adaptive image contrast adjustment program, when executed by the processor, implements the steps of the adaptive image contrast adjustment method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium has stored thereon an adaptive image contrast adjustment program, wherein the adaptive image contrast adjustment program, when executed by a processor, implements the steps of the adaptive image contrast adjustment method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Diamond saw blade fissure extraction method based on edge detection

    CN107133962A

  • System for automatically adjusting brightness of cold light source of endoscope

    CN117557587A

  • Geological resource dynamic monitoring method and system based on RS image enhancement

    CN119831950A

  • Contrast enhancement method for ultrasonic detection image of generator circuit breaker box

    CN120876340A

  • Image processing device, image processing method, and program

    JP2014110624A