An image enhancement method and system for intelligent image processing
By enhancing edge contrast through adaptive histogram equalization and cumulative distribution function, and combining joint noise reduction and motion compensation techniques, the problems of unstable image enhancement effect and excessive computational resource consumption in low-light environments are solved, thereby improving image quality and stability.
Patent Information
- Application Number
- CN202511256142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-09-04
AI Technical Summary
Existing end-to-end image enhancement methods based on deep learning networks have unstable enhancement effects in low-light environments, are prone to introducing false textures, consume excessive computational resources, and are difficult to run in real time on mobile devices, affecting the reliability and applicability of critical mission scenarios.
Adaptive histogram equalization is used to generate equalized image data, the optical contrast of the edge region is enhanced based on the cumulative distribution function, and the target image data is generated by combining a joint noise reduction algorithm with motion compensation technology.
It effectively expands the dynamic range of images, improves the overall contrast of low-light images, enhances edge and detail clarity, suppresses noise, and improves image quality and stability. It is suitable for key feature extraction and recognition in low-light environments.
Smart Images

Figure CN120746850B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of computer vision and digital image processing technology, and in particular to an image enhancement method and system for intelligent image processing. Background Technology
[0002] In low-light environments, such as surveillance and security, medical imaging, and autonomous driving, images acquired by image acquisition devices often suffer from insufficient dynamic range, severe noise interference, and blurred edge details. These scenarios urgently require an intelligent image processing method that can simultaneously enhance brightness, suppress noise, and improve detail to ensure the effective extraction and recognition of critical information.
[0003] Current advanced solutions employ end-to-end image enhancement methods based on deep learning networks. These methods utilize convolutional neural networks with an encoder-decoder structure, training on a large number of low-light / normal-light image pairs to directly learn the mapping relationship from degraded images to sharp images. The network can complete brightness adjustment and noise removal in a single step during the inference phase, resulting in fast processing speed.
[0004] This approach relies on a large amount of high-quality training data, which can easily lead to unstable enhancement results due to changes in lighting conditions in practical applications. Furthermore, network processing can introduce false textures, affecting the realism of edge details. Additionally, it consumes significant computational resources, making it difficult to run in real-time on mobile devices. These limitations affect the reliability and applicability of the method in mission-critical scenarios. Summary of the Invention
[0005] This application provides an image enhancement method and system for intelligent image processing, which solves the problems of low dynamic range expansion capability and poor noise suppression effect of images under low light conditions in the prior art.
[0006] In a first aspect, this application provides an image enhancement method for intelligent image processing, comprising:
[0007] Acquire raw image data under low light conditions, wherein the raw image data includes grayscale distribution data;
[0008] Adaptive histogram equalization is performed on the gray-level distribution data to generate equalized image data;
[0009] The cumulative distribution function is calculated based on the frequency of occurrence of each gray level in the equalized image data;
[0010] The optical contrast of the edge regions in the equalized image data is enhanced based on the calculation results of the cumulative distribution function, thus forming enhanced image data;
[0011] The enhanced image data is denoised using a joint denoising algorithm, and the target image data is generated by motion compensation of the denoised enhanced image data.
[0012] Optionally, the calculation result based on the cumulative distribution function enhances the optical contrast of the edge regions in the equalized image data to form enhanced image data, including:
[0013] The pixel values of the equalized image data are mapped using the calculation result of the cumulative distribution function, and mapped pixel values are generated based on the mapping result;
[0014] Based on the mapped pixel values, regions in the equalized image data whose brightness change rate exceeds a preset brightness change rate threshold are identified, and these regions are determined as edge regions.
[0015] Enhanced image data is generated by enhancing the optical contrast of the edge region based on the mapped pixel values.
[0016] Optionally, the step of enhancing the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data includes:
[0017] For each pixel within the edge region, calculate the gradient change magnitude of the mapped pixel value;
[0018] Based on the gradient change magnitude, determine the brightness adjustment amount of the center pixel in the edge region;
[0019] Based on the brightness adjustment amount, calculate the brightness difference between the center pixel and the neighboring pixels of the edge region;
[0020] The brightness difference is superimposed on the original pixel values of the edge region to generate enhanced image data.
[0021] Optionally, performing adaptive histogram equalization on the grayscale distribution data to generate equalized image data includes:
[0022] The original image data is divided into multiple image sub-blocks;
[0023] Based on the gray-level distribution data, a gray-level distribution histogram is generated for each of the image sub-blocks;
[0024] Based on the grayscale distribution histogram, a mapping function is generated for each image sub-block;
[0025] The pixel values of the image sub-blocks are adjusted according to the mapping function to generate preliminary equalized sub-blocks;
[0026] According to the mapping function, the pixel values at the boundary between adjacent preliminary equalization sub-blocks are weighted and fused to generate equalized image data.
[0027] Optionally, the step of weighted fusion of pixel values at the boundary between adjacent preliminary equalization sub-blocks according to the mapping function to generate equalized image data includes:
[0028] Determine the pixel positions on both sides of the boundary of adjacent preliminary equalization sub-blocks;
[0029] Based on the mapping function, and combined with the distance between the pixel at the pixel position and the center pixel of the adjacent preliminary equalization sub-block, the weight allocation coefficient is calculated;
[0030] Based on the weight allocation coefficients, the output values of the mapping functions on both sides of the boundary are weighted and fused.
[0031] The weighted fusion result is assigned to the pixel positions on both sides of the boundary to generate equalized image data.
[0032] Optionally, the step of using a joint denoising algorithm to denoise the enhanced image data and then performing motion compensation on the denoised enhanced image data to generate target image data includes:
[0033] Extract multiple consecutive frames of images from the enhanced image data to form an image sequence;
[0034] The image sequence is subjected to joint temporal and spatial filtering to generate a denoised image sequence;
[0035] Calculate the pixel displacement between corresponding pixels in adjacent frames of the denoised image sequence;
[0036] Establish an inter-frame motion trajectory function based on the pixel displacement;
[0037] Motion compensation is performed on the denoised image sequence based on the inter-frame motion trajectory function;
[0038] The current frame of the motion-compensated denoised image sequence is output as the target image data.
[0039] Optionally, calculating the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data includes:
[0040] Count the frequency of occurrence of each gray level in the equalized image data;
[0041] Sort the occurrence frequencies according to gray level from smallest to largest, and sum the sorted occurrence frequencies to obtain a cumulative frequency sequence;
[0042] Using the cumulative distribution function, each accumulated value in the accumulated frequency sequence is divided by the total number of pixels in the equalized image data to obtain a normalized accumulated frequency sequence, which is the calculation result of the cumulative distribution function.
[0043] Secondly, this application provides an image enhancement system for intelligent image processing, comprising:
[0044] The acquisition module is used to acquire raw image data under low light conditions, wherein the raw image data includes gray level distribution data;
[0045] The first generation module is used to perform adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data.
[0046] The calculation module is used to calculate the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data;
[0047] A forming module is used to enhance the optical contrast of edge regions in the equalized image data based on the calculation result of the cumulative distribution function, thereby forming enhanced image data;
[0048] The second generation module is used to perform noise reduction processing on the enhanced image data using a joint noise reduction algorithm, and to generate target image data by performing motion compensation on the noise-reduced enhanced image data.
[0049] Thirdly, this application provides a computing device including a processor and a memory, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform an image enhancement method for intelligent image processing as described in any of the first aspects.
[0050] Fourthly, this application provides a computer storage medium storing computer program instructions thereon, which, when executed by a processor, implement an image enhancement method for intelligent image processing as described in any one of the first aspects.
[0051] This application provides an image enhancement method for intelligent image processing. The method includes: acquiring original image data under low-light conditions, the original image data including gray-level distribution data; performing adaptive histogram equalization on the gray-level distribution data to generate equalized image data; calculating a cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data; enhancing the optical contrast of edge regions in the equalized image data based on the calculation result of the cumulative distribution function to form enhanced image data; performing noise reduction processing on the enhanced image data using a joint noise reduction algorithm, and generating target image data by performing motion compensation on the noise-reduced enhanced image data.
[0052] The technical solution provided in this application has the following beneficial effects:
[0053] This application provides fundamental data support for subsequent processing, ensuring that image enhancement processing has complete original information. It effectively expands the dynamic range of the image, improves the overall contrast of low-light images, and reveals details in dark areas. It establishes a probability distribution model of image grayscale, providing a precise mathematical basis for subsequent edge enhancement. It focuses on improving the sharpness of edges and details in the image, enhancing the recognizability of key features. It effectively suppresses image noise, eliminates motion blur, and improves the overall quality and stability of the image.
[0054] Furthermore, this application also utilizes the cumulative distribution function to map and transform the pixel values of the equalized image to generate mapped pixel values; then, based on the mapped pixel values, it identifies edge regions whose brightness change rate exceeds a preset threshold; finally, it enhances the optical contrast of these edge regions in a targeted manner according to the mapped pixel values, ultimately forming enhanced image data with improved quality.
[0055] Furthermore, this application achieves precise localization and selective enhancement of image edge regions through the mapping transformation of the cumulative distribution function, improving the clarity and contrast of edge details while maintaining the naturalness of the image, making it particularly suitable for the extraction and recognition of key features in low-light environments.
[0056] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 A flowchart of an image enhancement method for intelligent image processing provided in an embodiment of this application;
[0059] Figure 2 This application provides a schematic diagram of the structure of an image enhancement system for intelligent image processing, as shown in the embodiments of the present application.
[0060] Figure 3 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0061] 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.
[0062] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0063] In the field of intelligent image processing in low-light environments, existing end-to-end image enhancement methods based on deep learning networks suffer from three key drawbacks: First, these methods have stringent requirements for the quality of training data, leading to unstable enhancement effects due to variations in lighting conditions in practical applications. Second, the network processing introduces false textures, compromising the realism of edge details. Finally, the computational resource consumption is excessive, making it difficult to meet the real-time processing demands of mobile devices. These problems severely restrict the reliable application of this method in critical scenarios such as security monitoring and medical imaging.
[0064] To address the aforementioned problems, this application proposes an image enhancement method for intelligent image processing. This method first acquires the original image data and its gray-level distribution data under low-light conditions, and generates equalized image data through adaptive histogram equalization. Then, it calculates the cumulative distribution function based on the frequency of occurrence of each gray level, and uses the cumulative distribution function to accurately enhance the optical contrast of edge regions to form enhanced image data. Finally, it uses a joint noise reduction algorithm combined with motion compensation technology to generate the target image data. This scheme achieves targeted enhancement of image features by establishing a dynamic correlation between gray-level distribution data and the cumulative distribution function. This avoids the false texture problem of deep learning methods and reduces computational complexity through staged processing, effectively solving the problems of unstable enhancement effects, edge distortion, and excessive computational resource consumption in existing technologies.
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] Figure 1 A flowchart of an image enhancement method for intelligent image processing provided in this application embodiment is shown below. Figure 1 As shown, the method includes:
[0067] Step 101: Obtain raw image data under low light conditions, wherein the raw image data includes gray level distribution data.
[0068] In step 101, the raw image data represents an unprocessed low-light environment image directly acquired by the image acquisition device, containing brightness information for each pixel. The grayscale distribution data represents statistical data reflecting the frequency of occurrence of each brightness level in the image, used to analyze the overall brightness characteristics of the image.
[0069] In this embodiment of the application, under low light conditions, the image acquisition device first captures the original image data of the scene, which includes the brightness value of each pixel; then the system counts all possible brightness levels in the image and their frequency of occurrence to generate grayscale distribution data, which is presented in the form of a histogram, with the horizontal axis representing the brightness level and the vertical axis representing the number of pixels at the corresponding brightness level; these data provide the basis for subsequent adaptive histogram equalization processing.
[0070] For example, in a nighttime road monitoring scenario in location A, the monitoring equipment captures a traffic image in a low-light environment with a resolution of 800×600. The system reads the brightness value of each pixel in the image, counts the occurrence of all possible brightness levels from the darkest to the brightest, and forms a grayscale distribution histogram containing 256 brightness levels. The horizontal axis represents the brightness value from 0 to 255, and the vertical axis represents the number of pixels corresponding to each brightness value. The histogram shows that most pixels are concentrated in the darker brightness areas.
[0071] Step 102: Perform adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data.
[0072] In step 102, the equalized image data represents the image data after local contrast adjustment, which enhances the details in the dark areas.
[0073] In this embodiment, the system divides the original image into multiple rectangular regions of the same size and calculates the gray-level distribution data of each region separately. Based on the gray-level distribution characteristics of each region, a mapping relationship from the original brightness to the target brightness is established. These mapping relationships are applied to adjust the brightness values of all pixels in the corresponding region. Finally, the processing results of all regions are smoothly stitched together to eliminate brightness abrupt changes between regions and generate balanced image data with a more uniform overall brightness distribution.
[0074] For example, taking the road monitoring image from the previous example, the system divides it into 1200 small regions of 16×16 (the total number of blocks is adapted according to the resolution). The brightness mapping curve is calculated independently for each small region. Darker regions are given a larger brightness boost, while brighter regions remain relatively stable. After processing, the dark details of each small region are clearly revealed. Then, the block effect is eliminated by weighted averaging of boundary pixels, and finally a balanced image with moderate overall brightness and clear details in dark areas is obtained.
[0075] Step 103: Calculate the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data.
[0076] In step 103, gray level refers to the quantization level of pixel brightness in the image. In this application, 256 gray levels (0-255) are used. This value comes from the analog-to-digital conversion process of the image acquisition device, which discretizes the continuous light intensity signal into digital brightness values, where 0 represents the darkest (pure black) and 255 represents the brightest (pure white). In the equalized image data, these gray levels have undergone adaptive histogram equalization processing, redistributing the brightness distribution. The frequency of occurrence refers to the number of pixels corresponding to each specific gray value in the equalized image. The system obtains this by scanning all pixels in the image and counting the number of times each gray value (such as 50, 51, etc.) appears. For example, in an 800×600 image, if the brightness value 60 appears 1800 times, then the frequency of occurrence of this gray level is 1800. These data directly reflect the statistical characteristics of the image brightness distribution. The cumulative distribution function represents the statistical function of the proportion of pixels in the image whose brightness value is less than or equal to a certain specific value.
[0077] In this embodiment, the system scans the entire equalized image data and counts the number of times each possible brightness level appears; the number of pixels at each level is accumulated sequentially in order of brightness value from low to high; the accumulated number is divided by the total number of pixels in the image to obtain the cumulative probability value corresponding to each brightness level; the function formed by these probability values is the cumulative distribution function, which reflects the overall distribution characteristics of the image brightness.
[0078] For example, taking the aforementioned equalized road image as an example, the system statistics found that there are 1,000 pixels with a brightness value of 50 and 1,200 pixels with a brightness value of 51, so the cumulative number of pixels with a brightness value of 51 is 2,200; assuming that the total number of pixels in the image is 100,000, then the cumulative probability of a brightness value of 51 is 0.022; and so on, the cumulative probability of all brightness levels is calculated in sequence, forming a cumulative distribution function curve that monotonically increases from 0 to 1.
[0079] Step 104: Enhance the optical contrast of the edge regions in the equalized image data based on the calculation results of the cumulative distribution function to form enhanced image data.
[0080] In step 104, the edge region refers to a continuous pixel region in the image where the brightness changes drastically, typically corresponding to the outline of an object. Optical contrast represents the degree of brightness difference between pixels on both sides of the edge. Enhanced image data refers to image data after edge contrast enhancement processing. Its characteristic is that the optical contrast of the edge region is specifically improved. This is achieved by remapping the brightness of edge pixels in the equalized image through a cumulative distribution function, which expands the brightness difference between the object outline and the background while keeping the brightness of non-edge regions basically unchanged. For example, the brightness difference between the vehicle outline and the road surface increases from 30 to 45.
[0081] In this embodiment, the system uses the cumulative distribution function to convert each pixel value in the equalized image into a corresponding probability value; calculates the rate of change of the probability value of each pixel in the image with respect to the surrounding pixels; marks continuous regions with a rate of change exceeding a preset threshold as edge regions; and dynamically adjusts the brightness value of pixels in the edge regions according to the gradient characteristics of the cumulative distribution function, so that the brightness difference between the two sides of the edge is more obvious but the transition is natural, thereby enhancing the optical contrast.
[0082] For example, for equalized road images, the system first converts pixel values into cumulative probability values; when the probability value change rate at a vehicle outline reaches a set standard, it is identified as an edge region; based on the slope of the cumulative distribution function of the region, the brightness difference between the vehicle and the background is increased from the original value of 30 to 45, while maintaining the smoothness of the edge transition, making the vehicle outline clearer and more distinguishable.
[0083] Step 105: Use a joint denoising algorithm to denoise the enhanced image data, and generate target image data by performing motion compensation on the denoised enhanced image data.
[0084] In step 105, the joint denoising algorithm represents a noise suppression method that considers both spatial and temporal dimensions. The specific process of denoising involves first performing local smoothing filtering on a single frame image in the spatial dimension to eliminate isolated noise points; then, in the temporal dimension, performing a weighted average of pixel values at the same location in consecutive frames after motion compensation. For example, a weight combination of [previous frame 0.25, current frame 0.5, next frame 0.25] is used for a three-frame sequence to calculate new pixel values. Motion compensation refers to the technique of adjusting pixel positions based on the movement of objects between adjacent frames. The target image data refers to the final high-quality output image, which has three characteristics: first, it completes dynamic range expansion and edge enhancement; second, it undergoes effective noise suppression; and third, motion blur is eliminated. This data is generated by integrating the results of all processing stages and is the final output of the system.
[0085] In this embodiment, the system acquires multiple consecutive frames of enhanced image data and analyzes the positional offset of corresponding pixels between adjacent frames; establishes a pixel motion trajectory model based on these offsets; performs a weighted average of pixel values along the motion trajectory in the spatiotemporal dimension to suppress random noise; and finally fuses the processing results with the current frame data to eliminate motion blur and noise interference, and outputs high-quality target image data.
[0086] For example, when processing three consecutive enhanced road monitoring images, the system calculates that a vehicle's pixel moves 5 pixels to the right between adjacent frames; along this motion trajectory, the brightness values of the corresponding pixels in the three frames are weighted and averaged to eliminate random noise; in the final output target image, the moving vehicle maintains a clear outline without significant noise interference.
[0087] This method effectively improves the overall brightness and dark details of low-light images through adaptive histogram equalization, accurately enhances the contrast of key edge features by using cumulative distribution function, and eliminates noise and motion blur by combining spatiotemporal joint denoising and motion compensation techniques. Finally, it obtains high-quality images with moderate brightness, rich details, clear contours and good noise suppression, thus improving the visibility and usability of images in low-light environments.
[0088] To address the issue of unclear image edge details in low-light environments, in some embodiments, step 104: enhancing the optical contrast of edge regions in the equalized image data based on the calculation result of the cumulative distribution function to form enhanced image data includes:
[0089] Step 201: Map the pixel values of the equalized image data using the calculation result of the cumulative distribution function, and generate mapped pixel values based on the mapping result.
[0090] In step 201, the pixel values of the equalized image data refer to the brightness values of each pixel in the image after adaptive histogram equalization. These values originate from the brightness levels redistributed after the original image is segmented. The local histogram equalization algorithm maps the original pixel values to a new dynamic range, enhancing details in dark areas while preventing overexposure in bright areas. The mapping process involves the system querying the cumulative distribution function table to find the cumulative probability value corresponding to each equalized pixel value, and then linearly mapping this probability value to the target brightness range. This is achieved using the formula P_new = CDF(P_old) × 255, where P_new is the mapped pixel value, CDF(P_old) represents the cumulative probability of the original pixel value, and 255 is the maximum brightness value. The mapping result converts the equalized pixel values into new values reflecting their global distribution position. These values retain the relative brightness relationships of the original image, but through the recalibration of the cumulative probability, the contrast distribution of different brightness areas becomes more reasonable, providing an optimized data foundation for subsequent edge detection. Mapped pixel values refer to the new values obtained by transforming the original brightness values of each pixel in the equalized image through a cumulative distribution function, reflecting the distribution position of the brightness value in the entire image.
[0091] In this embodiment, the system first reads the brightness value of each pixel in the equalized image, then queries the pre-calculated cumulative distribution function table to find the cumulative probability value corresponding to each brightness value, and maps these probability values proportionally to a new brightness range to generate mapped pixel values that better reflect the global distribution of the image.
[0092] Step 202: Based on the mapped pixel values, identify regions in the equalized image data whose brightness change rate exceeds a preset brightness change rate threshold, and determine the regions as edge regions.
[0093] In step 202, the brightness change rate refers to the degree of difference between the mapped pixel values of a pixel and its neighboring pixels. It is obtained by calculating the maximum difference between the mapped values of the center pixel and its eight surrounding pixels, reflecting the steepness of the edge at that location. The formula is G=max|P_center-P_neighbor|. The preset brightness change rate threshold is an empirical value set according to image quality requirements. It is a critical value that can effectively distinguish between real edges and noise, determined through a large number of experiments. It is usually a value between 0.15 and 0.25. In this embodiment, 0.2 is used as the judgment standard. The process of identifying regions involves the system scanning the entire image, calculating the brightness change rate of each pixel, marking pixels with a change rate exceeding the threshold as candidate points, and then performing connected component analysis on adjacent candidate points to form closed edge contours. These continuous sets of pixels exceeding the threshold are the identified edge regions. Edge regions refer to the set of pixels in the image whose brightness change rate continuously exceeds the threshold. These regions usually correspond to the real contours or textures of objects and are automatically extracted through gradient calculation and region growing algorithms. Their size and shape are determined by the edge features in the actual scene.
[0094] In this embodiment of the application, the system calculates the degree of difference between each mapped pixel value and its surrounding pixel values. When the degree of difference of multiple consecutive pixels in a certain area exceeds a set threshold, the area is determined to be an edge area that needs to be enhanced. These areas usually correspond to the outline or texture details of an object.
[0095] Step 203: Enhance the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data. In this embodiment, the system calculates the enhancement magnitude of each edge pixel based on the mapped pixel value characteristics of the edge region. The central edge pixels receive greater enhancement, while the edge transition regions receive moderate enhancement, ultimately generating enhanced image data that maintains a natural transition while enhancing detail.
[0096] Here is a specific example:
[0097] In a nighttime road monitoring scenario at location A, when the system performs edge enhancement processing on the generated equalized road monitoring image, it first uses the calculated cumulative distribution function to convert the brightness value of each pixel in the image into a corresponding probability value. The conversion formula is P_new = CDF(P_old) × K, where P_new represents the mapped pixel value, CDF represents the cumulative distribution function, P_old represents the original pixel value, and K is an adjustment coefficient with a fixed constant value of 255. This conversion gives each pixel a new value reflecting its global distribution position. Next, the system calculates the rate of change of the mapping value between each pixel and its eight neighboring pixels. When the rate of change of consecutive pixels in a certain area exceeds a preset threshold of 0.15, it is determined to be an edge region. This threshold is... Through multiple experiments, empirical values were determined to effectively distinguish between edges and flat areas. Then, for the identified vehicle outline edge areas, a linear enhancement method was used to adjust the pixel values based on the slope characteristics of the cumulative distribution function of the area. Specifically, the pixel value at the edge center was increased by ΔL=slope×C, where slope represents the derivative of the cumulative distribution function at that point, and C is an adjustment coefficient set to a fixed value of 10. This increased the brightness difference between the vehicle and the road surface from the original 30 to 45. At the same time, bilateral filtering was used to maintain the natural smoothness of the edge transition. In the final enhanced image, the clarity of the vehicle outline was improved, the texture details of the road surface were well preserved, and the overall appearance was natural without obvious artificial processing traces, effectively improving the recognizability of nighttime surveillance images.
[0098] In this embodiment, the method achieves precise localization and targeted enhancement of edge regions through the mapping transformation of the cumulative distribution function. While maintaining the naturalness of the image, it improves the visibility of key details, effectively enhances the outline and texture features of objects in low-light environments, and improves the recognizability and usability of the image.
[0099] To further improve the accuracy of edge region enhancement, in some embodiments, step 203: enhancing the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data includes:
[0100] Step 301: For each pixel within the edge region, calculate the gradient change magnitude of the mapped pixel value.
[0101] In step 301, the gradient change magnitude refers to the degree of change in the mapped pixel value between a pixel in the edge region and its surrounding pixels, reflecting the edge strength at that location.
[0102] In this embodiment, the system first determines the difference in the mapped pixel value between each pixel in the edge region and its eight neighboring pixels, and takes the largest difference as the gradient change magnitude of that point, which can accurately reflect the steepness of the edge.
[0103] Step 302: Determine the brightness adjustment amount of the center pixel of the edge region based on the gradient change amplitude.
[0104] In step 302, the center pixel refers to the core pixel with the largest gradient change among the continuous set of pixels identified as edges. This is determined by comparing the gradient magnitudes of each pixel within the region, with the pixel having the largest gradient magnitude being identified as the center pixel. These center pixels are typically located on the center line of the object's outline. The brightness adjustment amount refers to the amount of brightness change required for the center pixel based on the edge intensity.
[0105] In this embodiment, the system calculates the brightness adjustment amount that each edge center pixel should have according to the magnitude of the gradient change and a preset proportional relationship. The steeper the edge, the greater the adjustment amount is obtained, ensuring that the edge enhancement effect matches the actual situation.
[0106] Step 303: Calculate the brightness difference between the center pixel and the neighboring pixels of the edge region based on the brightness adjustment amount.
[0107] In step 303, neighboring pixels refer to the surrounding pixels directly adjacent to the center pixel. An eight-neighborhood determination method is used, meaning that the eight closest pixels in the top, bottom, left, right, and four diagonal directions are considered as neighboring pixels. These pixels, together with the center pixel, constitute the transition area of the edge. The brightness difference refers to the expected degree of brightness difference between the center pixel and its neighboring pixels.
[0108] In this embodiment, the system calculates the target brightness difference between the center pixel and each neighboring pixel in a distance-weighted manner based on the brightness adjustment amount of the center pixel. Pixels closer to the center receive a larger difference adjustment to maintain the naturalness of the edge transition.
[0109] Step 304: Superimpose the brightness difference with the original pixel values of the edge region to generate enhanced image data.
[0110] In step 304, the original pixel value refers to the initial pixel brightness value after equalization processing but without edge enhancement. These values are derived from the adaptive histogram equalization processing result, preserving the relative brightness relationship of the original image but optimizing the dynamic range. The pixel value superposition process refers to the process of combining the calculated brightness difference with the original pixel value.
[0111] In this embodiment, the system superimposes the calculated target brightness difference onto the original pixel value proportionally, while limiting the range of the superposition result to ensure that the processed pixel value is within the effective range, and finally generates enhanced image data that enhances the edges while maintaining a natural transition.
[0112] Here is a specific example:
[0113] In a nighttime road monitoring scenario at location A, when the system performs optical contrast enhancement on the identified vehicle outline edge region, it first calculates the maximum difference between the mapped pixel value and its eight neighboring pixels for each pixel within the edge region as the gradient change amplitude G, where G = MAX|P_center - P_neighbor|, P_center represents the mapped value of the center pixel, and P_neighbor represents the mapped values of the neighboring pixels. Next, based on the gradient change amplitude G, it determines the brightness adjustment amount ΔL = G × α for the center pixel, where α is an adjustment coefficient taken as an empirical value of 0.5. This coefficient has been determined through multiple experiments to maintain a natural enhancement effect. Then, based on the brightness adjustment amount ΔL, it adjusts the brightness of the center pixel according to the distance from neighboring pixels... The brightness difference ΔD = ΔL × (1 - d / D_max) of each neighboring pixel is calculated from distance d, where D_max is the maximum influence distance set to 3 pixels. Finally, these calculated brightness differences ΔD are added to the original pixel values, while limiting the final pixel values to not exceed the effective range. At the boundary between the vehicle and the road, the original brightness difference of 30 in the area is expanded to 45 after processing, while the area farther from the edge remains with a smaller adjustment range. Through this adaptive adjustment method, the vehicle outline becomes clearer and more prominent, while maintaining a natural transition with the road surface. The texture details of the road surface are not over-enhanced. The final enhanced image improves the recognition of key targets while maintaining the realism and naturalness of the overall image.
[0114] In this embodiment, the method achieves quantitative evaluation of edge intensity by accurately calculating the gradient change amplitude, then adaptively determines the enhancement degree at each position based on the evaluation result, and finally completes natural transition edge enhancement by difference superposition. This not only improves the visibility of key edges but also maintains the overall coordination of the image, effectively solving the problem of blurred edges in low-light images.
[0115] To further improve the adaptability of low-light image processing, in some embodiments, step 102: performing adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data includes:
[0116] Step 401: Divide the original image data into multiple image sub-blocks.
[0117] In step 401, an image sub-block refers to a number of regular rectangular regions into which the original image is divided. Each sub-block is processed independently to adapt to local lighting conditions.
[0118] In this embodiment, the system divides the entire image into several non-overlapping square regions according to a fixed size, ensuring that each sub-block can reflect the brightness characteristics of the local area.
[0119] Step 402: Based on the gray level distribution data, generate a gray level distribution histogram for each of the image sub-blocks.
[0120] In step 402, the grayscale distribution histogram refers to a chart that shows the distribution of the frequency of each brightness level within a statistical sub-block.
[0121] In this embodiment of the application, the system counts the number of pixels at each brightness level in each sub-block and generates a histogram reflecting the brightness distribution of the sub-block for subsequent equalization processing.
[0122] Step 403: Generate a mapping function for each image sub-block based on the grayscale distribution histogram.
[0123] In step 403, the mapping function refers to the mathematical relationship that converts input pixel values into output pixel values. This function is derived from the cumulative distribution calculation of the sub-block grayscale distribution histogram, and the specific formula is as follows: ;in This indicates the output pixel value. Maximum gray level grayscale The number of pixels. The total number of pixels in the sub-block is 256. This function maps the original pixel values to new values that reflect the local statistical characteristics of the sub-block.
[0124] In this embodiment, the system calculates the cumulative distribution function based on the sub-block histogram and uses it as the basis for the mapping function to ensure that dark area pixels receive a greater degree of brightness improvement.
[0125] Step 404: Adjust the pixel values of the image sub-blocks according to the mapping function to generate preliminary equalized sub-blocks.
[0126] In step 404, the pixel value of an image sub-block refers to the original brightness value of each pixel within the sub-block region after block processing, maintaining the original image acquisition data but limited to the local processing range. The preliminary equalization sub-block refers to the intermediate result after local mapping processing but before boundary fusion.
[0127] In this embodiment, the system uses the mapping function of each sub-block to adjust the brightness value of all pixels within it, so that the brightness distribution of each sub-block is more uniform.
[0128] Step 405: According to the mapping function, the pixel values at the boundary between adjacent preliminary equalization sub-blocks are weighted and fused to generate equalized image data.
[0129] In step 405, adjacent preliminary equalization sub-blocks refer to image sub-blocks that are spatially adjacent and have undergone independent equalization processing. Adjacency is determined by the sub-block coordinates; if the difference between the row and column numbers of two sub-blocks is 1, they are considered adjacent. For example, the sub-block with coordinates (3,4) is adjacent to sub-blocks (3,5) and (4,4). Pixel values at boundaries refer to the pixel brightness values corresponding to the boundary lines of adjacent sub-blocks. This is determined by comparing the sub-block matrix coordinates. If the row or column coordinates of a pixel are equal to an integer multiple of the sub-block size (e.g., 16, 32), it is considered a boundary pixel, and these pixels require special fusion processing.
[0130] In this embodiment, the system calculates weighting coefficients based on the distance from the boundary pixel to the center of the two sub-blocks, and performs a weighted average on the mapping results of the two sub-blocks to eliminate obvious block effects.
[0131] Here is a specific example:
[0132] In a nighttime road monitoring scenario at location A, the system analyzed the brightness distribution of a relatively dark sub-block (16×16 pixels) located in the center of the road. The system found that the brightness values were concentrated in the range of 30-80, with 18 pixels having a brightness value of 50 and 22 pixels having a brightness value of 60. Based on this data, the system established a mapping function for this sub-block. The specific calculation method was as follows: First, the cumulative number of pixels was calculated; the cumulative number of pixels with a brightness value of 60 was 40. Then, the cumulative probability was calculated as P = 40 / 256 ≈ 0.156. Finally, the cumulative probability was linearly mapped to the range of 0-255, resulting in a new brightness value New = 0.156 × 255 ≈ 40. This mapping function was applied to adjust the pixel values of all pixels in the sub-block, increasing the brightness value of pixels with a brightness value of 60 to 100. For pixels at the boundary of two adjacent sub-blocks, the system calculated weights based on the distance of the pixel to the center of the two adjacent sub-blocks. Pixels at the boundary closer to the center of the left sub-block were weighted using a combination of 70% left-side mapping results and 30% right-side mapping results. After processing and boundary fusion of all sub-blocks, the brightness of the originally darker road area is moderately improved, and the details of the road surface cracks are clearly visible, while the originally brighter headlight area remains relatively stable. The final generated equalized image has a uniform overall brightness distribution, and the details of each area are well displayed. Furthermore, the transition between sub-blocks is natural, with no obvious block segmentation marks.
[0133] In this embodiment, the method effectively solves the problem of local over-brightness or under-brightness caused by global equalization through local adaptive processing. Sub-block division ensures that the processing can adapt to the lighting differences in different regions. Boundary fusion technology eliminates block artifacts. The final equalized image maintains good naturalness and detail while improving overall brightness.
[0134] To further improve the naturalness of the transition between sub-block boundaries, in some embodiments, step 405: weighted fusion of pixel values at the boundaries between adjacent pre-equalized sub-blocks according to the mapping function to generate equalized image data includes:
[0135] Step 501: Determine the pixel positions on both sides of the boundary of adjacent preliminary equalization sub-blocks.
[0136] In step 501, "both sides of the boundary" refers to the regions corresponding to the left and right / up and down sides of the boundary line between adjacent image sub-blocks. After the system completes the sub-block division of the original image, it automatically marks the boundary lines between all sub-blocks, defining the sub-block regions immediately adjacent to the boundary lines as the two sides of the boundary. Pixel position refers to the specific coordinates of the boundary pixels to be processed in the image, determined by the sub-block size and row and column numbers. The system divides the grid according to the sub-blocks, calculates the row and column coordinates of each boundary pixel (e.g., the 16th column pixel at the intersection of the 3rd and 4th sub-blocks), and precisely locates it using (x, y) two-dimensional coordinates.
[0137] In this embodiment, the system first identifies the boundary lines shared by adjacent sub-blocks, and then determines the corresponding pixel coordinates of each pair on the boundary lines. These locations are key areas that require special processing.
[0138] Step 502: Based on the mapping function, and combined with the distance between the pixel at the pixel position and the center pixel of the adjacent preliminary equalization sub-block, calculate the weight allocation coefficient.
[0139] In step 502, the pixel at the pixel location refers to the specific pixel data located at the boundary position, originating from the preliminary equalization sub-block. These pixels simultaneously belong to the boundary region of two adjacent sub-blocks and carry the mapping processing information of the sub-blocks on both sides, making them target pixels requiring special fusion. Distance refers to the pixel distance from the boundary pixel to the center of each sub-block, calculated through two-dimensional coordinate differences. The system first determines the center coordinates of the sub-block (e.g., the center of a 16×16 sub-block is (8,8)), then calculates the Euclidean distance from the boundary pixel to the center of the left / right / up / down sub-blocks, using the formula sqrt[(x- )²+(y- )²], where (x,y) are pixel coordinates, ( , () represents the center coordinates of the sub-block. The weight allocation coefficient refers to the weight allocation coefficient of the mapping function on both sides of the boundary, which is the fusion ratio calculated based on the distance from the pixel position to the center of the sub-block.
[0140] In this embodiment, the system measures the distance from the boundary pixel to the center of the left and right sub-blocks, and calculates the weight according to the inverse distance principle. The closer the pixel is to the center of the sub-block, the greater the weight of the mapping function on that side.
[0141] Step 503: Based on the weight allocation coefficients, perform weighted fusion on the output values of the mapping functions on both sides of the boundary.
[0142] In step 503, the output value of the mapping function refers to the transformation result of the boundary pixel under the mapping functions of the two sub-blocks. It originates from the mapping functions of the image sub-blocks. The system inputs the original value of the boundary pixel into the mapping functions T_left(k) and T_right(k) of the left and right / upper and lower sub-blocks respectively, and obtains two different output values, which serve as the basis data for fusion. The weighted fusion process refers to the process of mixing the mapping results of the two sides proportionally.
[0143] In this embodiment, the system obtains the output values of the boundary pixels under the mapping functions of the left and right sub-blocks, and performs linear combination according to the calculated weight coefficients to generate new pixel values with smooth transition.
[0144] Step 504: Assign the weighted fusion result to the pixel positions on both sides of the boundary to generate equalized image data.
[0145] In step 504, the weighted fusion result refers to the final pixel value output by mixing the mappings on both sides according to the distance weight. The system directly assigns this result to the boundary pixels, and after the assignment is completed, seamlessly connected equalized image data is generated. The assignment process refers to the process of applying the fusion result to the actual image.
[0146] In this embodiment, the system replaces the original boundary pixel values with the new pixel values obtained by weighted fusion to ensure a natural brightness transition between adjacent sub-blocks.
[0147] Here is a specific example:
[0148] In a nighttime road monitoring scenario at location A, when the system performs boundary fusion processing on two adjacent 16×16 pixel sub-blocks, it first determines the common boundary line of the two sub-blocks in the vertical direction and identifies all 16 pairs of corresponding pixels in the 5th column of the boundary line. For one pair of boundary pixels located in the 8th row, the system measures the horizontal distance from this pixel to the center of the left sub-block as 7 pixels and the horizontal distance to the center of the right sub-block as 8 pixels. Then, it calculates the weight allocation coefficients according to the inverse distance principle, where the left weight W_left = 8 / (7+8) ≈ 0.533 and the right weight W_right = 7 / (7+8) ≈ 0.467. Next, the system queries the output value of this pixel under the mapping function of the left and right sub-blocks. The mapping result for the left side is a brightness value of 110, and for the right side it is 105. Therefore, the weighted fusion value is 110×0.533 + 105×0.467 ≈ 108. The system assigns this fusion value to the boundary pixel and, after iteratively processing the boundary pixels of all 256 sub-blocks, finally generates seamlessly connected equalized image data. The image completely eliminates the block artifacts on the road surface, the brightness transition of the vehicle outline is natural and smooth, and all dark details are preserved, meeting the image quality requirements of the monitoring scene.
[0149] In this embodiment of the application, the method effectively solves the block artifact problem caused by block processing through precise weight allocation and boundary fusion, so that the equalized image can achieve an overall coordinated visual effect while maintaining the advantages of local adaptive enhancement, thereby improving the processing quality of low-light images.
[0150] To further improve the noise reduction effect and maintain the sharpness of moving objects, in some embodiments, step 105: using a joint noise reduction algorithm to perform noise reduction processing on the enhanced image data, and generating target image data by performing motion compensation on the noise-reduced enhanced image data, includes:
[0151] Step 601: Extract multiple consecutive frames of images from the enhanced image data to form an image sequence.
[0152] In step 601, consecutive multi-frame images refer to a group of monitoring video frames that are sequential in time. The continuity is determined by the frame timestamps; when the time interval between adjacent frames is equal to the reciprocal of the device's frame rate (e.g., 1 / 30 of a second), they are considered consecutive frames. These images originate from video stream data collected by the monitoring device at a fixed frequency. An image sequence refers to consecutive enhanced images arranged in chronological order.
[0153] In this embodiment, the system selects three frames of edge-enhanced images from the video stream at fixed intervals. These three frames are temporally continuous and content-related, providing a basis for subsequent temporal processing.
[0154] Step 602: Perform temporal and spatial domain joint filtering on the image sequence to generate a denoised image sequence.
[0155] In step 602, the joint temporal and spatial filtering process refers to the noise suppression process performed simultaneously in the temporal and spatial dimensions. The denoised image sequence refers to the frame sequence after joint temporal and spatial denoising processing. Its characteristics are that it retains the detailed features of the original image while suppressing random noise. This sequence is generated by performing spatiotemporal filtering with motion compensation on multiple input images, thereby improving the signal-to-noise ratio of each frame.
[0156] In this embodiment, the system first performs spatial smoothing on each frame of the image, and then performs a weighted average of the pixel values at the same position in the three frames of the image in the temporal dimension, which effectively suppresses random noise while preserving real details.
[0157] Step 603: Calculate the pixel displacement of corresponding pixels between adjacent frames in the denoised image sequence.
[0158] In step 603, adjacent frames refer to consecutive frames directly connected on the video timeline. They are determined by the continuity of frame numbers; if the frame number difference is 1 (e.g., frame n and frame (n+1)), they are considered adjacent frames, and the system automatically extracts these frame pairs for motion analysis. Corresponding pixels refer to pixels representing the same scene point in adjacent frames. Specifically, a feature pixel point in the previous frame (e.g., the center point of a vehicle headlight) and the same feature point in the subsequent frame after motion displacement form a corresponding pixel pair. The system establishes this cross-frame pixel correspondence using a feature matching algorithm to ensure the accuracy of motion calculation. Pixel displacement refers to the change in position of the same object in different frames, calculated using a feature point matching algorithm. The system detects feature points (e.g., corner points, edge points) in adjacent frames and calculates the coordinate differences Δx and Δy of the matching point pairs using optical flow. The displacement formula is sqrt(Δx² + Δy²), with units in pixels.
[0159] In this embodiment of the application, the system calculates the displacement by comparing the movement distance of specific feature points in adjacent frames. These feature points are usually selected as edges or corners with obvious contrast in the image.
[0160] Step 604: Establish an inter-frame motion trajectory function based on the pixel displacement.
[0161] In step 604, the inter-frame motion trajectory function is a mathematical model describing the change of pixel position over time, and its specific expression is: ;in Represents the pixel coordinates at that moment. This is a reference position (usually taken as the coordinates of the current frame). It is the velocity vector (calculated from displacement / time difference). This is the acceleration vector (calculated using the rate of change of displacement over three frames). This function can predict the motion path of pixels between frames.
[0162] In this embodiment, the system establishes a quadratic function model based on the displacement of feature points in three consecutive frames to predict the motion path of pixels, providing a basis for accurate compensation.
[0163] Step 605: Perform motion compensation on the denoised image sequence based on the inter-frame motion trajectory function.
[0164] In step 605, the motion compensation process is the process of adjusting the pixel position according to the motion trajectory.
[0165] In this embodiment, the system aligns relevant pixels in previous and subsequent frames to their corresponding positions in the current frame according to the established trajectory function, thereby eliminating the blurring effect caused by object movement.
[0166] Step 606: Output the current frame of the motion-compensated denoised image sequence as the target image data.
[0167] In step 606, the current frame refers to the target image frame that serves as the reference output time. It is determined by the middle position of the processing sequence. When the system processes a three-frame sequence [n-1, n, n+1], the nth frame is the current frame, and its timestamp is in the center of the sequence. The motion compensation result is aligned with this frame as the reference.
[0168] In this embodiment, the system selects the middle frame of the three-frame sequence as the reference and uses the result of noise reduction and motion compensation processing as the final output image.
[0169] Here is a specific example:
[0170] In a nighttime road monitoring scenario at location A, when the system performs noise reduction and motion compensation on three consecutive traffic images that have undergone equalization and edge enhancement, it first extracts these three enhanced images from the video stream to form a processing sequence. For vehicle targets in the sequence, the system first performs local smoothing on each frame in the spatial dimension to eliminate isolated noise points. Then, in the temporal dimension, it performs a weighted average of pixel values at the same position in the three frames, with the current frame having a weight of 0.5 and the preceding and following frames each having a weight of 0.25. The denoised pixel value is calculated using the formula P_clean = 0.25 × P_prev + 0.5 × P_curr + 0.25 × P_next, where P represents the pixel brightness value. Next, the system detects the movement of vehicle headlight feature points between adjacent frames, measuring a movement of 6 pixels from the second to the third frame. A motion trajectory function is established as P(t) = P0 + 3t, where P0 is the initial position and t is the frame interval. Based on this function, the vehicle features in the preceding and following frames are aligned to the current frame position, and the target image with the second frame as the reference is output.
[0171] In this embodiment of the application, the method effectively solves the problem of insufficient effect of a single noise reduction method through spatiotemporal joint processing. The motion compensation technology preserves the clarity of moving objects. The final generated image not only reduces noise interference but also maintains the visual quality of key targets in dynamic scenes, greatly improving the usability of low-light surveillance videos.
[0172] To further improve the accuracy of image enhancement processing, in some embodiments, step 103: calculating the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data includes:
[0173] Step 701: Count the frequency of occurrence of each gray level in the equalized image data.
[0174] In this embodiment of the application, the system scans the entire equalized image and counts the number of pixels corresponding to each possible brightness value from darkest to brightest, forming a frequency table reflecting the brightness distribution of the image.
[0175] Step 702: Sort the occurrence frequencies according to the gray level from smallest to largest, and accumulate the sorted occurrence frequencies to obtain the accumulated frequency sequence.
[0176] In step 702, the accumulation process refers to the system first sorting all gray levels in ascending order of value, and then starting from the lowest gray level, adding the frequency of the current gray level to the cumulative frequency of all previous gray levels to obtain the cumulative frequency of the current gray level. For example, if the frequency of gray level 50 is 1000 and the frequency of gray level 51 is 1200, then the cumulative frequency of gray level 51 is 2200 (1000 + 1200). This process is iterated until the highest gray level, forming a monotonically increasing cumulative frequency sequence. The cumulative frequency sequence refers to the sequence of pixel counts accumulated sequentially from smallest to largest brightness value.
[0177] In this embodiment of the application, the system sorts the frequency table obtained by statistics in ascending order of brightness value, and then accumulates the number of pixels for each brightness value starting from the minimum value to generate a sequence that reflects the cumulative distribution of brightness.
[0178] Step 703: Using the cumulative distribution function, divide each accumulated value in the accumulated frequency sequence by the total number of pixels in the equalized image data to obtain a normalized accumulated frequency sequence, which is the calculation result of the cumulative distribution function.
[0179] In step 703, the accumulated value refers to the sum of frequencies of all lower gray levels up to the current gray level. It originates from the accumulated calculation result and reflects the total number of pixels in the image less than or equal to the current gray level. This value serves as intermediate data for constructing the cumulative distribution function. For example, when processing down to gray level 100, the accumulated value is the sum of all pixels from gray levels 0 to 100. The total number of pixels refers to the total number of pixels in the image after block equalization. Its value is the product of the image width and height. For example, for an 800×600 resolution image, the total number of pixels is 480,000. This value originates from the inherent parameters of the image acquisition device and remains unchanged during the equalization process, serving as the denominator for normalization calculations. The normalized accumulated frequency sequence is the probability distribution sequence obtained by dividing each value in the original accumulated frequency sequence by the total number of pixels in the image. Its value ranges from 0 to 1. Each element of this sequence represents the proportion of pixels in the image less than or equal to the corresponding gray level, forming a complete cumulative probability distribution function that directly reflects the statistical distribution characteristics of image brightness. The normalization process converts the accumulated values into a probability distribution. The result of the cumulative distribution function is the normalized cumulative probability value corresponding to each gray level. It is obtained by dividing the accumulated frequency sequence by the total number of pixels. This result constitutes a monotonically increasing function from 0 to 1, and its mathematical expression is CDF(k)=Sum(n_i) / N (k=0~255), where Sum(n_i) represents the accumulated frequency of gray level k, and N is the total number of pixels. This function fully describes the probability distribution characteristics of image brightness and is the core basis for subsequent edge enhancement processing.
[0180] In this embodiment, the system divides each value in the cumulative frequency sequence by the total number of pixels in the image to obtain a probability distribution function that monotonically increases from 0 to 1, which is the final cumulative distribution function.
[0181] Here is a specific example:
[0182] In a nighttime road monitoring scenario at location A, when the system calculates the cumulative distribution function for the equalized monitoring image, it first counts the number of pixels for each brightness value in the 800×600 resolution image. It finds that brightness value 60 corresponds to 1800 pixels, and brightness value 61 corresponds to 2000 pixels. After arranging these brightness values in ascending order, the system calculates the cumulative pixel count for brightness value 61 to be 3800. Since the total number of pixels in the image is 480,000, the cumulative probability of brightness value 61 is approximately 0.0079 (3800 divided by 480,000). Following this calculation method, the system sequentially processes all 256 brightness levels. The cumulative pixel count for a brightness value of 100 is 150,000, with a cumulative probability of 150,000 divided by 480,000 equaling 0.3125. The cumulative pixel count for a brightness value of 200 is 450,000, with a cumulative probability of 450,000 divided by 480,000 equaling 0.9375. The resulting cumulative distribution function curve exhibits a monotonically increasing characteristic from 0 to 1, with slow growth in darker areas, faster growth in intermediate brightness areas, and a flattening trend in bright areas. This curve accurately reflects the actual brightness distribution characteristics of the nighttime road image, providing a precise adjustment basis for subsequent edge enhancement processing. This ensures that different brightness areas in the image receive appropriate contrast enhancement, resulting in a final processing result that improves the visibility of details in dark areas while maintaining the integrity of details in bright areas.
[0183] In this embodiment of the application, the method establishes a mathematical model that reflects the true brightness distribution of the image through precise statistics and normalization, providing a reliable quantitative basis for subsequent adaptive image enhancement, enabling the processing to accurately adapt to image features under different lighting conditions, and improving the rationality and consistency of the enhancement effect.
[0184] Figure 2 This application provides a schematic diagram of the structure of an image enhancement system for intelligent image processing, as shown in the embodiments of this application. Figure 2 As shown, the system includes:
[0185] The acquisition module 21 is used to acquire raw image data under low light conditions, the raw image data including gray level distribution data.
[0186] The first generation module 22 is used to perform adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data.
[0187] The calculation module 23 is used to calculate the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data.
[0188] The forming module 24 is used to enhance the optical contrast of the edge regions in the equalized image data based on the calculation result of the cumulative distribution function, thereby forming enhanced image data.
[0189] The second generation module 25 is used to perform noise reduction processing on the enhanced image data using a joint noise reduction algorithm, and to generate target image data by performing motion compensation on the enhanced image data after noise reduction processing.
[0190] Figure 2 The image enhancement system for intelligent image processing described above can perform... Figure 1 The implementation principle and technical effects of the image enhancement method for intelligent image processing described in the illustrated embodiment will not be repeated here. The specific methods by which each module and unit performs operations in the image enhancement system for intelligent image processing described in the above embodiments have been described in detail in the embodiments related to this method, and will not be elaborated upon here.
[0191] In one possible design, Figure 2 An image enhancement system for intelligent image processing, as shown in the embodiment, can be implemented as a computing device, such as... Figure 3 As shown, the computing device may include a storage component 31 and a processing component 32;
[0192] The storage component 31 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 32.
[0193] The processing component 32 is used to perform the above. Figure 1 The embodiment describes an image enhancement method for intelligent image processing.
[0194] The processing component 32 may include one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component may be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.
[0195] Storage component 31 is configured to store various types of data to support operations at the terminal. The storage component can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0196] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.
[0197] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.
[0198] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.
[0199] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.
[0200] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The illustrated embodiment is an image enhancement method for intelligent image processing.
[0201] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0202] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0203] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, 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 can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An image enhancement method for intelligent image processing, characterized in that, include: Acquire raw image data under low light conditions, wherein the raw image data includes grayscale distribution data; Adaptive histogram equalization is performed on the gray-level distribution data to generate equalized image data; The cumulative distribution function is calculated based on the frequency of occurrence of each gray level in the equalized image data; The optical contrast of the edge regions in the equalized image data is enhanced based on the calculation results of the cumulative distribution function, thus forming enhanced image data; The enhanced image data is denoised using a joint denoising algorithm, and the target image data is generated by motion compensation of the denoised enhanced image data. The calculation result based on the cumulative distribution function enhances the optical contrast of the edge regions in the equalized image data, forming enhanced image data, including: The pixel values of the equalized image data are mapped using the calculation result of the cumulative distribution function, and mapped pixel values are generated based on the mapping result; Based on the mapped pixel values, regions in the equalized image data whose brightness change rate exceeds a preset brightness change rate threshold are identified, and these regions are determined as edge regions. Enhance the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data; The method involves using a joint denoising algorithm to denoise the enhanced image data, and then performing motion compensation on the denoised enhanced image data to generate target image data, including: Extract multiple consecutive frames of images from the enhanced image data to form an image sequence; The image sequence is subjected to joint temporal and spatial filtering to generate a denoised image sequence; Calculate the pixel displacement between corresponding pixels in adjacent frames of the denoised image sequence; Establish an inter-frame motion trajectory function based on the pixel displacement; Motion compensation is performed on the denoised image sequence based on the inter-frame motion trajectory function; The current frame of the motion-compensated denoised image sequence is output as the target image data.
2. The method according to claim 1, characterized in that, The step of enhancing the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data includes: For each pixel within the edge region, calculate the gradient change magnitude of the mapped pixel value; Based on the gradient change magnitude, determine the brightness adjustment amount of the center pixel in the edge region; Based on the brightness adjustment amount, calculate the brightness difference between the center pixel and the neighboring pixels of the edge region; The brightness difference is superimposed on the original pixel values of the edge region to generate enhanced image data.
3. The method according to claim 1, characterized in that, The step of performing adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data includes: The original image data is divided into multiple image sub-blocks; Based on the gray-level distribution data, a gray-level distribution histogram is generated for each of the image sub-blocks; Based on the grayscale distribution histogram, a mapping function is generated for each image sub-block; The pixel values of the image sub-blocks are adjusted according to the mapping function to generate preliminary equalized sub-blocks; According to the mapping function, the pixel values at the boundary between adjacent preliminary equalization sub-blocks are weighted and fused to generate equalized image data.
4. The method according to claim 3, characterized in that, The step of weighted fusion of pixel values at the boundary between adjacent pre-equalized sub-blocks according to the mapping function to generate equalized image data includes: Determine the pixel positions on both sides of the boundary of adjacent preliminary equalization sub-blocks; Based on the mapping function, and combined with the distance between the pixel at the pixel position and the center pixel of the adjacent preliminary equalization sub-block, the weight allocation coefficient is calculated; Based on the weight allocation coefficients, the output values of the mapping functions on both sides of the boundary are weighted and fused. The weighted fusion result is assigned to the pixel positions on both sides of the boundary to generate equalized image data.
5. The method according to claim 1, characterized in that, The calculation of the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data includes: Count the frequency of occurrence of each gray level in the equalized image data; Sort the occurrence frequencies according to gray level from smallest to largest, and sum the sorted occurrence frequencies to obtain a cumulative frequency sequence; Using the cumulative distribution function, each accumulated value in the accumulated frequency sequence is divided by the total number of pixels in the equalized image data to obtain a normalized accumulated frequency sequence, which is the calculation result of the cumulative distribution function.
6. An image enhancement system for intelligent image processing, characterized in that, include: The acquisition module is used to acquire raw image data under low light conditions, wherein the raw image data includes gray level distribution data; The first generation module is used to perform adaptive histogram equalization processing on the gray-level distribution data to generate equalized image data. The calculation module is used to calculate the cumulative distribution function based on the frequency of occurrence of each gray level in the equalized image data; A forming module is used to enhance the optical contrast of edge regions in the equalized image data based on the calculation result of the cumulative distribution function, thereby forming enhanced image data; The second generation module is used to perform noise reduction processing on the enhanced image data using a joint noise reduction algorithm, and to generate target image data by performing motion compensation on the noise-reduced enhanced image data. The calculation result based on the cumulative distribution function enhances the optical contrast of the edge regions in the equalized image data, forming enhanced image data, including: The pixel values of the equalized image data are mapped using the calculation result of the cumulative distribution function, and mapped pixel values are generated based on the mapping result; Based on the mapped pixel values, regions in the equalized image data whose brightness change rate exceeds a preset brightness change rate threshold are identified, and these regions are determined as edge regions. Enhance the optical contrast of the edge region based on the mapped pixel values to generate enhanced image data; The method involves using a joint denoising algorithm to denoise the enhanced image data, and then performing motion compensation on the denoised enhanced image data to generate target image data, including: Extract multiple consecutive frames of images from the enhanced image data to form an image sequence; The image sequence is subjected to joint temporal and spatial filtering to generate a denoised image sequence; Calculate the pixel displacement between corresponding pixels in adjacent frames of the denoised image sequence; Establish an inter-frame motion trajectory function based on the pixel displacement; Motion compensation is performed on the denoised image sequence based on the inter-frame motion trajectory function; The current frame of the motion-compensated denoised image sequence is output as the target image data.
7. A computing device, characterized in that, It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement an image enhancement method for intelligent image processing as described in any one of claims 1 to 5.
8. A computer storage medium, characterized in that, The device contains a computer program that, when executed by a computer, implements an image enhancement method for intelligent image processing as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Image enhancement method and device and computer equipment
CN117115020A
System and method for making colored low-light image
CN120070231A
Histogram equalization apparatus for contrast enhancement of moving image and method therefor
US6259472B1