An image strong light suppression method and system
By performing subject recognition and brightness segmentation on the vehicle-mounted camera video, the problem of poor processing of strong light areas under the gradient grayscale mirror is solved, and the clarity and visual effect of the video are significantly improved.
Patent Information
- Application Number
- CN202411118367.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-08-15
AI Technical Summary
In the prior art, the gradient grayscale mirror has poor effect on the processing of strong light areas, affecting the clarity of the video of the on-board camera, especially in the night or dim environment, which is difficult to effectively suppress the problems of overexposure and uneven brightness.
By obtaining the input video, decompose it into a single-frame image and subject recognition and grouping marking, the brightness histogram is calculated and divided into normal lighting, high brightness and overexposure areas, select the reference image and apply its parameters, perform image fusion and brightness value conversion, and finally stitching into processed video.
It significantly improves the lighting, saturation and brightness of the video, improves the overall visual effect, makes the image more natural and comfortable, and retains important details and dynamic changes.
Smart Images

Figure CN119136064B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of visual imaging, and particularly to an image strong light suppression method and system. Background Art
[0002] In traditional vehicle-mounted cameras, due to insufficient light at night or in dim environments, it is often difficult to capture clear images. Especially when facing strong light sources, overexposure or uneven brightness of the images is more likely to occur, seriously affecting the driver's judgment. Therefore, it is particularly important to develop a vehicle-mounted night vision camera technology that can automatically adapt to complex lighting conditions at night, effectively suppress overexposure, and improve image contrast and brightness.
[0003] Currently, the Chinese invention patent with the application number CN201510657615.6 discloses a strong light suppression method based on a gradient neutral density filter. The light transmittance V(d) of this gradient neutral density filter is in a proportional relationship; where H represents the height of the gradient neutral density filter, d represents the height at the position of the lower edge of the gradient neutral density filter, and V(d) represents the light transmittance at the vertical distance d from the lower edge of the gradient neutral density filter. The method of using this gradient filter to suppress strong light is to set this gradient neutral density filter on a filter switching device. When a moving vehicle headlight is detected in the monitoring screen, the gradient neutral density filter of the filter switching device is switched to the optical path between the lens and the sensor. Although this invention can effectively suppress the problems of glare, ghosting, and image overexposure in the monitoring screen, and will not reduce the overall exposure of the monitoring screen and will not affect license plate capture, the processing effect on the strong light area by the method of the gradient neutral density filter is poor, affecting the clarity of the final video. Summary of the Invention
[0004] The technical problem solved by the present invention is that in the related art, although the problems of glare, ghosting, and image overexposure in the monitoring screen can be effectively suppressed, and the overall exposure of the monitoring screen will not be reduced and the license plate capture will not be affected, the processing effect on the strong light area by the method of the gradient neutral density filter is poor, affecting the clarity of the final video.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, an image strong light suppression method includes the following steps:
[0007] Step S1, obtain an input video, decompose the input video into single-frame images, perform main body recognition on the single-frame images and group and label them according to the main body, and output as image groups.
[0008] Step S2: According to the preset saturation threshold, saturation gradient value, contrast threshold, contrast gradient value, brightness threshold, and brightness gradient value, perform gradient adjustment on the saturation, contrast, and brightness of each single-frame image within each image group to obtain a single-frame image group. Detect the main part of each single-frame image at each gradient in the single-frame image group to obtain edge lines and store them.
[0009] Step S3: Calculate the brightness histogram of each single-frame image. According to the preset standard brightness threshold and brightness histogram, segment each single-frame image into a normal illumination area, a high-brightness area, and an overexposed area and store them. Select a reference image, record the image parameters of the reference image, and apply the image parameters to all single-frame images within the image group.
[0010] Step S4: Perform image fusion on the reference image and other single-frame images within the image group except the reference image.
[0011] Step S5: Calculate the channel histograms of the corresponding reference area, high-brightness area, and overexposed area on the single-frame image within the image group respectively and calculate the cumulative distribution function, and convert each brightness value in the high-brightness area and overexposed area into the brightness value of the corresponding reference area.
[0012] Step S6: Stitch the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression. Re-stitch the single-frame images after suppression into a processed video and output it.
[0013] Preferably, the step S1 includes the following sub-steps:
[0014] Step S101: Obtain the input video, set the export format to all frames, decompose it into single-frame images, and add corresponding timestamps.
[0015] Step S102: Convert the single-frame images into grayscale images and store them separately. Use a pre-trained convolutional neural network to extract high-level image feature vectors in the grayscale images, calculate the Euclidean distances between the image feature vectors, and merge the images with the smallest Euclidean distances into an image group, and output the image group.
[0016] Preferably, the step S2 includes the following sub-steps:
[0017] Step S201: Input the preset saturation threshold, saturation gradient value, contrast threshold, contrast gradient value, brightness threshold, and brightness gradient value, and adjust each single-frame image within each image group to obtain a single-frame image group with different saturations, contrasts, and brightnesses.
[0018] Step S202: Perform Gaussian blur on the grayscale image, calculate the gradients in the horizontal and vertical directions using the Sobel operator, calculate the gradient magnitude and direction by combining the horizontal and vertical gradients, and mark the pixels with gradient magnitude greater than the preset edge threshold as edge pixels.
[0019] Step S203: Merge the edge pixels and output them as edge lines, save them as an array and store.
[0020] Preferably, step S3 includes the following sub-steps:
[0021] Step S301: Calculate the brightness histogram of each single-frame image, segment each single-frame image into a normal illumination area, a high-brightness area, and an overexposed area according to the preset standard brightness threshold, and store them.
[0022] Step S302: Calculate the number of breakpoints of each edge line, and select the edge line with the fewest breakpoints as the clear edge line.
[0023] Step S303: Calculate the area overlap degree between the image within the clear edge line and the normal illumination area, select the single-frame image with the largest area overlap degree and mark it as the reference image, record the saturation, contrast, and brightness of the reference image, and apply them to all single-frame images in the image group corresponding to the reference image.
[0024] Preferably, step S4 includes the following sub-steps:
[0025] Step S401: Mark the normal illumination area of the reference image as the reference area, calculate the pixel gradient information of the reference area and the background area except the reference area near the boundary of the reference area, and output and store it as the standard gradient information.
[0026] Step S402: Calculate the gradient information and coordinates between adjacent pixel points of other single-frame images in the image group except the reference image respectively, and merge and output them as the gradient information to be fused.
[0027] Step S403: Input the standard gradient information into the gradient information to be fused, find the coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fuse the reference image onto other single-frame images in the image group except the reference image.
[0028] Preferably, step S5 includes the following sub-steps:
[0029] Step S501: Calculate the histograms of the reference area, high-brightness area, and overexposed area of the single-frame image respectively, and output them as the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram.
[0030] Step S502: Calculate the cumulative distribution function based on the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram, and output the reference cumulative distribution function, high-brightness cumulative distribution function, and overexposed cumulative distribution function.
[0031] Step S503: Map the high-brightness cumulative distribution function and overexposed cumulative distribution function onto the reference cumulative distribution function, and output the mapping relationship.
[0032] Step S504: Convert each brightness value in the high-brightness area and overexposed area into the corresponding brightness value in the reference area according to the mapping relationship.
[0033] Preferably, step S6 includes the following sub-steps:
[0034] Step S601: Stitch the adjusted reference area, high-brightness area, and overexposed area to generate a single-frame image after suppression.
[0035] Step S602: Stitch the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and output the processed video.
[0036] In a second aspect, an image strong light suppression system includes a preliminary processing module, a strong light suppression module, and a video output module:
[0037] The preliminary processing module is used to decompose the input video into single-frame images, perform main body recognition on each frame image, and group and label the images according to the recognition results, and output the image grouping.
[0038] The strong light suppression module is used to perform gradient adjustment on the saturation, contrast, and brightness of the single-frame images in each image grouping according to the preset parameter threshold and parameter gradient value, obtain a group of single-frame images, perform edge detection on the main body part of the single-frame images at each gradient in the group of single-frame images, obtain and store the edge lines, calculate the brightness histogram of the single-frame images, segment the single-frame images into a normal illumination area, a high-brightness area, and an overexposed area and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all single-frame images in the image grouping, perform image fusion on the reference image and other single-frame images, calculate the channel histograms of the corresponding reference area, high-brightness area, and overexposed area of the single-frame images respectively and calculate the cumulative distribution function, and convert each brightness value in the high-brightness area and overexposed area into the corresponding brightness value in the reference area.
[0039] The video output module is used to stitch the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression, and stitch the single-frame images after suppression in sequence and output the processed video.
[0040] In a third aspect, an electronic device includes a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method described in any one of the above are run.
[0041] In a fourth aspect, a storage medium stores a computer program. When the computer program is executed by a processor, the steps in the method described in any one of the above are run.
[0042] Advantages of the present invention: By identifying and grouping key objects in the video, finely adjusting saturation, contrast, and brightness, segmenting and normalizing the illumination area, fusing reference images to balance illumination and color differences, converting and suppressing the brightness values of high-brightness and overexposed areas, and finally stitching back to the original image, the processed video is significantly improved in terms of illumination, saturation, contrast, and brightness. The overall visual effect is more natural and comfortable, and important details and dynamic changes are retained. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of the steps of an image strong light suppression method provided by an embodiment of the present invention;
[0044] Figure 2 It is a basic process schematic diagram of an image strong light suppression system provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention is provided in conjunction with the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments.
[0046] Embodiment 1, referring to Figure 1 , a method for suppressing strong light in an image is provided, including the following steps:
[0047] Step S1, obtain an input video, decompose the input video into single-frame images, perform main body recognition on the single-frame images and group and label them according to the main body, and output them as image groups.
[0048] Step S2, according to the preset saturation threshold, saturation gradient value, contrast threshold, contrast gradient value, and brightness threshold and brightness gradient value, perform gradient adjustment on the saturation, contrast, and brightness of the single-frame images in each image group to obtain a single-frame image group. Perform edge detection on the main body part of the single-frame images at each gradient in the single-frame image group to obtain edge lines and store them.
[0049] Step S3: Calculate the luminance histogram of each single-frame image. According to the preset standard luminance threshold and the luminance histogram, segment each single-frame image into a normal illumination area, a high-luminance area, and an overexposed area, and store them. Select a reference image, record the image parameters of the reference image, and apply the image parameters to all single-frame images within the image group.
[0050] Step S4: Perform image fusion on the reference image and other single-frame images within the image group except the reference image.
[0051] Step S5: Calculate the channel histograms of the corresponding reference area, high-luminance area, and overexposed area on the single-frame images within the image group respectively, and calculate the cumulative distribution function. Convert each luminance value in the high-luminance area and the overexposed area into the corresponding luminance value of the reference area.
[0052] Step S6: Stitch the converted reference area, high-luminance area, and overexposed area to obtain a single-frame image after suppression. Re-stitch the single-frame images after suppression into a processed video and output it.
[0053] Step S1 includes the following sub-steps:
[0054] Step S101: Obtain the input video, set the export format to all frames, decompose it into single-frame images, and add corresponding timestamps.
[0055] Step S102: Convert the single-frame images into grayscale images and store them separately. Use a pre-trained convolutional neural network to extract high-level image feature vectors from the grayscale images. Calculate the Euclidean distance between the image feature vectors. Merge the images with the smallest Euclidean distance into an image group and output the image group.
[0056] Perform color normalization processing to convert the color single-frame images into grayscale images to simplify the image information and reduce the influence of color differences on feature extraction. Select a pre-trained convolutional neural network model that has been trained on a large dataset and can extract high-level features of the image. Use a deep learning framework to load and instantiate the model. Set parameters during instantiation to exclude the fully connected layer at the top of the model. Input the grayscale image into the model and obtain high-level image feature vectors through forward propagation. Repeat the above feature extraction process to obtain the image feature vectors of each single-frame image. Calculate the distance between each pair of image feature vectors using the Euclidean distance formula. Sort the single-frame images according to the calculated Euclidean distance. According to the preset Euclidean distance threshold, merge the images with Euclidean distances less than the threshold into an image group and output all image groups.
[0057] Decomposing the video into frames allows for more refined analysis. The dynamic information of the video is presented through the sequential playback of a series of static images. Processing individual frames enables independent analysis and processing of each moment in the video. Adding timestamps to each frame preserves the original temporal order of the frames in the video. Using a pre-trained convolutional neural network to extract high-level image features from grayscale images, the image features capture abstract information such as texture, shape, and edges in a single frame image. By calculating the Euclidean distance between the extracted feature vectors, the similarity between single frame images is evaluated. The smaller the Euclidean distance, the closer the two images are in the feature space and the more similar they are in content structure. Based on the results of the comparison calculated using the Euclidean distance, single frame images with similar features are merged into a group, which helps to identify duplicate scenes and similar objects in the video.
[0058] Step S2 includes the following sub-steps:
[0059] Step S201, input the preset saturation threshold, saturation gradient value, contrast threshold, contrast gradient value, and brightness threshold and brightness gradient value, and adjust the single frame images within each image group to obtain single frame image groups with different saturations, contrasts, and brightnesses.
[0060] Step S202, perform Gaussian blur on the grayscale image, calculate the gradients in the horizontal and vertical directions using the Sobel operator, combine the horizontal and vertical gradients to calculate the gradient magnitude and direction, and mark the pixels with a gradient magnitude greater than the preset edge threshold as edge pixels.
[0061] Step S203, merge the edge pixels and output them as edge lines, save them as an array and store them.
[0062] Input the preset saturation threshold, saturation gradient value, contrast threshold, contrast gradient value, brightness threshold, and brightness gradient value to define the range and step size of image adjustment. For each single-frame image within each image group, adjust the saturation, contrast, and brightness according to the input threshold and gradient values to generate a series of single-frame image groups with different saturations, contrasts, and brightnesses for subsequent analysis and processing. Perform Gaussian blur processing on the grayscale image to reduce noise and smooth the single-frame image. Use the Sobel operator to calculate the gradients of the image in the horizontal and vertical directions. The Sobel operator is a discrete differential operator used for edge detection and works by calculating the approximate gradient of the grayscale of the single-frame image brightness function. Combining the gradients in the horizontal and vertical directions, the gradient magnitude and direction of each pixel point can be calculated. The gradient magnitude represents the intensity of the edge, and the gradient direction represents the direction of the edge. Mark the pixels with a gradient magnitude greater than the preset edge threshold as edge pixels. Connect adjacent edge pixels through edge tracing to form complete edge lines. Store the edge lines in the storage medium in the form of an array.
[0063] By adjusting the saturation, contrast, and brightness of the image, a series of single-frame images with different visual characteristics are generated, which helps to more comprehensively analyze the characteristics of single-frame images in subsequent processing. Since the optimal visual parameters of single-frame images may vary under different scenarios or lighting conditions, adjusting through the preset threshold and gradient values makes the single-frame images more adaptable to the current processing requirements. Edge detection and feature extraction provide diverse input images for subsequent image processing steps, which helps to improve the accuracy and robustness of these steps. By calculating the gradients of the single-frame image and marking the edge pixels, the edge parts in the single-frame image become clearer and more prominent, which is crucial for subsequent image analysis. Gaussian blur processing reduces the noise in the single-frame image to a certain extent, making edge detection more accurate. Noise usually leads to false edges in edge detection, while Gaussian blur helps to smooth these noise points. The calculation of the gradient direction not only provides the intensity information of the edge but also the direction information of the edge, which is very useful for understanding the shape and arrangement of objects in the single-frame image. By merging adjacent edge pixels to form lines, the continuity of the edge is enhanced, making the edge more in line with the object boundary in human visual perception, which helps for subsequent image understanding and interpretation. Storing the edge lines in the form of an array makes these edge information more structured and easier to process, which helps subsequent image analysis algorithms to access and utilize these edge information more efficiently.
[0064] Step S3 includes the following sub-steps:
[0065] Step S301, calculate the brightness histogram of each single-frame image, and segment each single-frame image into a normal illumination area, a high-brightness area, and an overexposed area according to the preset standard brightness threshold and store them.
[0066] Step S302: Calculate the number of breakpoints of each edge line, and select the edge line with the fewest breakpoints as the clear edge line.
[0067] Step S303: Calculate the area overlap degree between the image within the clear edge line and the normal illumination area, select the single-frame image with the largest area overlap degree and mark it as the reference image, record the saturation, contrast, and brightness of the reference image, and apply them to all single-frame images in the image group corresponding to the reference image. The brightness histogram is a statistical chart of the brightness value distribution in a single-frame image. Traverse each pixel in the single-frame image, count the brightness values, and construct a histogram to represent the frequency distribution of different brightness values. According to the image content and processing requirements, preset two brightness thresholds T1 and T2. T1 is used to distinguish the normal illumination area from the high-brightness area, and T2 is used to distinguish the high-brightness area from the overexposed area. According to the preset brightness thresholds, assign each pixel in the single-frame image to the normal illumination area, high-brightness area, and overexposed area. Pixels with brightness values less than T1 are classified into the normal illumination area, pixels with brightness values between T1 and T2 are classified into the high-brightness area, and pixels with brightness values greater than T2 are classified into the overexposed area. Store the segmented image area as an image mask. The breakpoints of the edge line refer to the discontinuous points in the line. Traverse each edge line, calculate the number of its breakpoints, and among all the edge lines, select the line with the fewest breakpoints as the clear edge line. For each single-frame image, calculate the area overlap degree between its normal illumination area and the area covered by the clear edge line, perform a pixel-level comparison between the two areas, and calculate the proportion of the intersection area to their respective total areas. Among all single-frame images, select the single-frame image with the largest area overlap degree as the reference image, record the saturation, contrast, and brightness values of the reference image, and apply these attribute values to all single-frame images in the image group corresponding to the reference image. By adjusting the visual attributes of other images to make them visually consistent with the reference image, the consistency and quality of the entire image sequence are improved.
[0068] By calculating the luminance histogram and segmenting according to a preset luminance threshold, a single-frame image is clearly divided into a normal illumination area, a high-luminance area, and an overexposed area, which helps to adopt different processing strategies for different areas in subsequent processing, identify areas with different illumination conditions in the single-frame image, and provide a basis for subsequent luminance adjustment. By calculating the number of breakpoints of the edge lines, evaluating the clarity of the edge lines, and selecting the edge line with the fewest breakpoints as the clear edge line, the interference of image noise on the edge detection result is reduced, and the accuracy of edge detection is improved. By calculating the area coincidence degree between the clear edge line and the normal illumination area and selecting the single-frame image with the largest coincidence degree as the reference image, it can be ensured that the selected reference image is representative in terms of illumination conditions and edge clarity. Applying the saturation, contrast, and luminance values of the reference image to all single-frame images within the corresponding image group can achieve the consistency of the visual attributes of the image sequence, which helps to improve the visual perception and quality of the entire image sequence. By selecting the reference image and applying its attributes to the entire image group, the complex process of adjusting each single-frame image individually is avoided, thereby improving the processing efficiency.
[0069] Step S4 includes the following sub-steps:
[0070] Step S401: Mark the normal illumination area of the reference image as the reference area, calculate the pixel gradient information of the reference area and the background area except the reference area near the boundary of the reference area, and output and store it as the standard gradient information.
[0071] Step S402: Calculate the gradient information and coordinates between adjacent pixel points of other single-frame images except the reference image in the image group respectively, and merge and output them as the gradient information to be fused.
[0072] Step S403: Input the standard gradient information into the gradient information to be fused, find the coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fuse the reference image onto other single-frame images except the reference image in the image group.
[0073] In the reference image, clearly mark the normal illumination area as the reference area. Calculate the pixel gradient information between the area near the boundary of the reference area and the background area within the predefined boundary width. The pixel gradient reflects the brightness or color change rate of the image at that point. Output the calculated gradient information as the standard gradient information and store it for subsequent use. For each non-reference image in the image group, calculate the gradient information, i.e., the brightness change rate, between its adjacent pixel points, as well as the coordinates of these pixel points. Combine all the calculated gradient information and the corresponding coordinates to form the gradient information to be fused, which is used for the subsequent matching process with the standard gradient information. Take the standard gradient information calculated and stored in step S401 as the input, and search for the gradient information that matches the standard gradient information in the gradient information to be fused generated in step S402. The matching is based on the gradient value, direction, and their spatial relationship. Find the matching gradient information and determine the coordinates of these gradient information on the image to be fused. According to these coordinates, fuse the reference image onto the corresponding single-frame image using pixel value interpolation.
[0074] By taking the normal illumination area of the reference image as the standard, ensuring that other single-frame images in the image group are consistent with it in terms of illumination conditions helps to reduce the image quality differences caused by different illumination conditions and improve the visual consistency of the entire image sequence. The matching and fusion process of the gradient information helps to maintain the continuity of the image edges. During the fusion process, copy the clear edge features in the reference image to other single-frame images, thereby reducing the phenomenon of edge blurring or breaking.
[0075] Step S5 includes the following sub-steps:
[0076] Step S501: Calculate the histograms of the reference area, high-brightness area, and overexposed area of the single-frame image respectively, and output them as the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram.
[0077] Step S502: Calculate the cumulative distribution functions based on the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram, and output them as the reference cumulative distribution function, high-brightness cumulative distribution function, and overexposed cumulative distribution function.
[0078] Step S503: Map the high-brightness cumulative distribution function and the overexposed cumulative distribution function onto the reference cumulative distribution function, and output the mapping relationship.
[0079] Step S504: According to the mapping relationship, convert each brightness value in the high-brightness area and the overexposed area into the corresponding brightness value in the reference area.
[0080] A single-frame image is converted from an RGB color space to a YCrCb color space, where the YCrCb color space includes a Y channel, a Cr channel, and a Cb channel. Histograms of a reference area, a high-brightness area, and an overexposed area of the single-frame image in the Y channel, the Cr channel, and the Cb channel are calculated respectively, and the outputs are a reference channel histogram, a high-brightness channel histogram, and an overexposed channel histogram. Each channel histogram includes histograms of the Y channel, the Cr channel, and the Cb channel. The cumulative distribution functions of the Y channel, the Cr channel, and the Cb channel of the reference area, the high-brightness area, and the overexposed area are calculated, and the outputs are a reference cumulative distribution function, a high-brightness cumulative distribution function, and an overexposed cumulative distribution function. The high-brightness cumulative distribution function and the overexposed cumulative distribution function are mapped to the reference cumulative distribution function, and the output is a mapping relationship. According to the mapping relationship and the corresponding reference channel histogram, the high-brightness channel histogram, and the overexposed channel histogram, each brightness value of the high-brightness area and the overexposed area is converted to a brightness value of the corresponding reference area, and the brightness value is stored in the Y channel.
[0081] By calculating and mapping the cumulative distribution functions of different brightness areas, the brightness values of high-brightness areas and over-exposed areas can be adjusted to make them closer to the brightness distribution of the reference area, which helps to eliminate overexposure in the image and reduce the brightness differences in highlight areas, making the brightness distribution of the entire image more balanced. In overexposed areas, due to excessive brightness, image details are often lost. By adjusting the brightness values of these areas, it helps to restore some of the lost details and make the image information richer and more complete. The visual effect of a single-frame image after brightness adjustment will be significantly improved. The overexposed and high-brightness areas are no longer dazzling, the overall contrast of the image is more natural, and the colors are more saturated, thereby improving the image's viewing and readability. Through a series of automated calculation and adjustment processes, rapid optimization of image brightness distribution is achieved, reducing the need for manual intervention and improving the efficiency and consistency of image processing.
[0082] Step S6 includes the following sub-steps:
[0083] Step S601, stitching the adjusted reference area, high brightness area and over-exposed area to generate a suppressed single frame image.
[0084] Step S602 , stitching the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and outputting the new video as a processed video.
[0085] Use image processing software to fuse the adjusted reference area, high-brightness area, and overexposed area using multi-bands, and precisely stitch them according to their positions in the original image to avoid obvious seams or color differences, generate suppressed single-frame images, sort them according to the timestamp of each suppressed single-frame image to ensure the correct time sequence in the video, and output the processed video.
[0086] By precisely stitching together the adjusted reference regions, highlighted regions, and overexposed regions, single-frame images with higher visual quality are generated. These single-frame images are optimized in terms of brightness, contrast, and detail retention, making the entire image clearer, more natural, and with more saturated colors. For the overexposure and highlighting problems in the original video, through specific adjustment algorithms and techniques, the brightness of these regions is effectively reduced, and some details lost due to overexposure are restored, making the highlighted regions and overexposed regions in the single-frame images no longer glaring, and the overall visual effect more comfortable. During the process of recombining the adjusted single-frame images into a video, the correct chronological order between frames is ensured, avoiding jitter or jumping during video playback.
[0087] Through object recognition technology, the key objects in the video are separated from the background and grouped, which helps to optimize the objects more precisely in subsequent steps while reducing excessive processing of non-critical regions. By finely adjusting the single-frame images with preset threshold and gradient values, the visual effect of the single-frame images can be significantly improved, making the single-frame images clearer. The application of edge detection further enhances the details of the single-frame images, making the edges of the objects sharper. By calculating the brightness histogram and segmenting the single-frame image into normal illumination, high-brightness, and overexposed regions, the illumination problems can be more accurately identified and processed. Selecting a reference image and applying its parameters to the entire image group helps to maintain the consistency of the illumination conditions within the image group and reduce visual discomfort caused by illumination changes. Fusing the reference image with other single-frame images can further balance the illumination and color differences between single-frame images, making the video transition more natural and smooth. By calculating the channel histogram and cumulative distribution function, the brightness values of the high-brightness regions and overexposed regions are converted into the brightness values of the corresponding reference regions, effectively suppressing the problems of overexposure and excessive brightness while maintaining the details and layering of the image. The converted regions are stitched back to the original image to obtain the suppressed single-frame image. Re-stitching the suppressed single-frame images into a video, the output video will be significantly improved in terms of illumination, saturation, contrast, and brightness.
[0088] Example two, referring to Figure 2 , provides an image strong light suppression system, including a preliminary processing module, a strong light suppression module, and a video output module:
[0089] The preliminary processing module is used to decompose the input video into single-frame images, perform object recognition on each frame of the image, and group and label the images according to the recognition results, and output them as image groups.
[0090] Decompose the input video into single-frame images, identify the objects in each frame of the image, and group and label the images according to the recognition results. The output result is the image group that has been grouped and labeled.
[0091] The strong light suppression module is used to perform gradient adjustment on the saturation, contrast, and brightness of each single-frame image within each image group according to preset parameter thresholds and parameter gradient values, obtain a single-frame image group, perform edge detection on the main part of each single-frame image at each gradient in the single-frame image group, obtain and store the edge lines, calculate the brightness histogram of the single-frame image, segment the single-frame image into a normal illumination area, a high-brightness area, and an overexposed area and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all single-frame images within the image group, perform image fusion on the reference image and other single-frame images, calculate the channel histograms and cumulative distribution functions of the corresponding reference area, high-brightness area, and overexposed area of the single-frame image respectively, and convert each brightness value in the high-brightness area and the overexposed area into the brightness value of the corresponding reference area.
[0092] According to the preset parameter thresholds and gradient values, adjust the single-frame images within each image group, optimize the image quality, obtain and store the edge lines of the main part of the single-frame images, enhance the image details, select a reference image, apply its parameters to all single-frame images within the image group, and perform image fusion to balance the illumination and color differences between the images, calculate the histograms and cumulative distribution functions of the corresponding areas of the single-frame images, and convert the brightness values of the high-brightness and overexposed areas into the brightness values of the corresponding reference areas.
[0093] The video output module is used to splice the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression, splice the single-frame images after suppression in order again, and output it as a processed video.
[0094] Splice the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression, splice these single-frame images after suppression in chronological order into a video, and output the processed video.
[0095] Through this image strong light suppression system, the input video undergoes a series of complex image processing steps, significantly improving the video quality. The illumination, saturation, contrast, and brightness are significantly optimized, and the overexposure and high-brightness problems are effectively suppressed. The output video has a more natural visual effect, while retaining important image details and dynamic changes, enhancing the viewing experience of the audience.
[0096] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. Among them, the storage medium can be implemented by 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 memory, flash memory, magnetic disk, or optical disk. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or boxes Figure 1 the functions specified in one box or multiple boxes.
[0097] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.
Claims
1. An image strong light suppression method, characterized in that, It includes the following steps: Step S1: Obtain the input video, decompose the input video into single-frame images, perform object recognition on the single-frame images and group and label them according to the objects, and output them as image groups; Step S2: According to the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, perform gradient adjustment on the saturation, contrast, and brightness of the single-frame images in each image group to obtain a group of single-frame images. Perform edge detection on the object parts of the single-frame images at each gradient in the group of single-frame images to obtain edge lines and store them; Step S3: Calculate the brightness histogram of each single-frame image. According to the preset standard brightness threshold and the brightness histogram, divide each single-frame image into a normal illumination area, a high-brightness area, and an overexposed area and store them. Select a reference image, record the image parameters of the reference image, and apply the image parameters to all single-frame images in this image group; Step S4: Perform image fusion on the reference image and other single-frame images in this image group except the reference image; Step S5: Calculate the channel histograms of the corresponding reference areas, high-brightness areas, and overexposed areas on the single-frame images in the image group respectively and calculate the cumulative distribution function, and convert each brightness value in the high-brightness area and the overexposed area into the brightness value of the corresponding reference area; Step S6: Stitch the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression. Re-stitch the single-frame images after suppression into a processed video and output it.
2. The image strong light suppression method according to claim 1, wherein, The step S1 includes the following sub-steps: Step S101: Obtain the input video, set the export format to all frames, decompose it into single-frame images and add corresponding timestamps; Step S102: Convert the single-frame images into grayscale images and store them separately. Use a pre-trained convolutional neural network to extract high-level image feature vectors in the grayscale images, calculate the Euclidean distances between the image feature vectors, and merge the images with the smallest Euclidean distances into an image group and output the image group.
3. The image strong light suppression method according to claim 2, characterized in that The step S2 includes the following sub-steps: Step S201: Input the preset saturation threshold and saturation gradient value, contrast threshold and contrast gradient value, and brightness threshold and brightness gradient value, and adjust the single-frame images in each image group to obtain a group of single-frame images with different saturations, contrasts, and brightnesses; Step S202: Perform Gaussian blur on the grayscale images, use the Sobel operator to calculate the gradients in the horizontal and vertical directions, calculate the gradient magnitude and direction by combining the horizontal and vertical gradients, and mark the pixels with gradient magnitudes greater than the preset edge threshold as edge pixels; Step S203: Merge the edge pixels and output them as edge lines, save them as an array and store them.
4. The image highlight suppression method according to claim 3, wherein, The step S3 includes the following sub-steps: Step S301: Calculate the brightness histogram of each single-frame image. Divide each single-frame image into a normal illumination area, a high-brightness area, and an overexposed area according to the preset standard brightness threshold and store them; Step S302: Calculate the number of breakpoints of each edge line, and select the edge line with the fewest breakpoints as the clear edge line; Step S303: Calculate the area overlap between the image within the clear edge lines and the normal illumination area. Select the single-frame image with the largest area overlap and mark it as the reference image. Record the saturation, contrast, and brightness of the reference image and apply them to all single-frame images in the image group corresponding to the reference image.
5. The image strong light suppression method according to claim 4, characterized in that, The step S4 includes the following sub-steps: Step S401: Mark the normal illumination area of the reference image as the reference area. Calculate the pixel gradient information of the reference area and the background area except the reference area near the boundary of the reference area, and output and store it as the standard gradient information. Step S402: Calculate the gradient information and coordinates between adjacent pixel points of other single-frame images in the image group except the reference image respectively, and merge and output them as the gradient information to be fused. Step S403: Input the standard gradient information into the gradient information to be fused, find the coordinates corresponding to the gradient information to be fused that matches the standard gradient information, and fuse the reference image onto other single-frame images in the image group except the reference image.
6. The image highlight suppression method according to claim 5, characterized in that, The step S5 includes the following sub-steps: Step S501: Calculate the histograms of the reference area, high-brightness area, and overexposed area of the single-frame image respectively, and output them as the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram. Step S502: Calculate the cumulative distribution functions according to the reference channel histogram, high-brightness channel histogram, and overexposed channel histogram, and output them as the reference cumulative distribution function, high-brightness cumulative distribution function, and overexposed cumulative distribution function. Step S503: Map the high-brightness cumulative distribution function and the overexposed cumulative distribution function onto the reference cumulative distribution function, and output the mapping relationship. Step S504: According to the mapping relationship, convert each brightness value of the high-brightness area and the overexposed area into the corresponding brightness value of the reference area.
7. The image highlight suppression method according to claim 6, wherein The step S6 includes the following sub-steps: Step S601: Stitch the adjusted reference area, high-brightness area, and overexposed area to generate a single-frame image after suppression. Step S602: Stitch the adjusted single-frame images into a new video according to the timestamps of the adjusted single-frame images, and output it as the processed video.
8. An image strong light suppression system, characterized in that, It includes a preliminary processing module, a strong light suppression module, and a video output module: The preliminary processing module is used to decompose the input video into single-frame images, perform main body recognition on each frame image, and group and mark the images according to the recognition results, and output them as image groups. The strong light suppression module is used to perform gradient adjustment on the saturation, contrast, and brightness of each single-frame image in each image group according to preset parameter thresholds and parameter gradient values, obtain a single-frame image group, perform edge detection on the main part of each single-frame image at each gradient in the single-frame image group, obtain and store edge lines, calculate the brightness histogram of the single-frame image, segment the single-frame image into a normal illumination area, a high-brightness area, and an overexposed area and store them, select a reference image according to the edge lines, apply the image parameters of the reference image to all single-frame images in this image group, perform image fusion on the reference image and other single-frame images, calculate the channel histograms of the corresponding reference area, high-brightness area, and overexposed area of each single-frame image and calculate the cumulative distribution function, and convert each brightness value in the high-brightness area and the overexposed area into the brightness value of the corresponding reference area; The video output module is used to splice the converted reference area, high-brightness area, and overexposed area to obtain a single-frame image after suppression, splice the single-frame images after suppression in sequence, and output them as a processed video.
9. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1-7 are run.
10. A storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, the steps in the method according to any one of claims 1-7 are run.
Citation Information
Patent Citations
A method for suppressing strong light based on graded grayscale mirrors
CN105245789B
Image definition improving method and device based on AI large model and medium
CN118279184A
Dual surveillance camera system
US20070013779A1